zeromq-4.2.5/0000775000372000037200000000000013255253403013743 5ustar00travistravis00000000000000zeromq-4.2.5/unittests/0000775000372000037200000000000013255253302016003 5ustar00travistravis00000000000000zeromq-4.2.5/unittests/unittest_ypipe.cpp0000664000372000037200000000414713255253220021601 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../tests/testutil.hpp" #include #include void setUp () { } void tearDown () { } void test_create () { zmq::ypipe_t ypipe; } void test_check_read_empty () { zmq::ypipe_t ypipe; TEST_ASSERT_FALSE (ypipe.check_read ()); } void test_read_empty () { zmq::ypipe_t ypipe; int read_value = -1; TEST_ASSERT_FALSE (ypipe.read (&read_value)); TEST_ASSERT_EQUAL (-1, read_value); } void test_write_complete_and_check_read_and_read () { const int value = 42; zmq::ypipe_t ypipe; ypipe.write (value, false); TEST_ASSERT_FALSE (ypipe.check_read ()); int read_value = -1; TEST_ASSERT_FALSE (ypipe.read (&read_value)); TEST_ASSERT_EQUAL_INT (-1, read_value); } void test_write_complete_and_flush_and_check_read_and_read () { const int value = 42; zmq::ypipe_t ypipe; ypipe.write (value, false); ypipe.flush (); TEST_ASSERT_TRUE (ypipe.check_read ()); int read_value = -1; TEST_ASSERT_TRUE (ypipe.read (&read_value)); TEST_ASSERT_EQUAL_INT (value, read_value); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_create); RUN_TEST (test_check_read_empty); RUN_TEST (test_read_empty); RUN_TEST (test_write_complete_and_check_read_and_read); RUN_TEST (test_write_complete_and_flush_and_check_read_and_read); return UNITY_END (); } zeromq-4.2.5/unittests/CMakeLists.txt0000664000372000037200000000401213255253220020537 0ustar00travistravis00000000000000# CMake build script for ZeroMQ unit tests cmake_minimum_required(VERSION "2.8.1") set(unittests unittest_ypipe unittest_poller unittest_mtrie ) #IF (ENABLE_DRAFTS) # list(APPEND tests # ) #ENDIF (ENABLE_DRAFTS) # add location of platform.hpp for Windows builds if(WIN32) add_definitions(-DZMQ_CUSTOM_PLATFORM_HPP) add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) # Same name on 64bit systems link_libraries(ws2_32.lib) endif() include_directories("${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}") foreach(test ${unittests}) # target_sources not supported before CMake 3.1 add_executable(${test} ${test}.cpp) # per-test directories not generated on OS X / Darwin if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang.*") link_directories(${test} PRIVATE "${CMAKE_SOURCE_DIR}/../lib") endif() target_link_libraries(${test} libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} unity) if(RT_LIBRARY) target_link_libraries(${test} ${RT_LIBRARY}) endif() if(WIN32) add_test(NAME ${test} WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} COMMAND ${test}) else() add_test(NAME ${test} COMMAND ${test}) endif() set_tests_properties(${test} PROPERTIES TIMEOUT 10) # TODO prevent libzmq (non-static) being in the list of link libraries at all get_target_property(LIBS ${test} LINK_LIBRARIES) list(REMOVE_ITEM LIBS libzmq) set_target_properties(${test} PROPERTIES LINK_LIBRARIES "${LIBS}") endforeach() #Check whether all tests in the current folder are present #TODO duplicated with tests/CMakeLists.txt, define as a function? file(READ "${CMAKE_CURRENT_LIST_FILE}" CURRENT_LIST_FILE_CONTENT) file(GLOB ALL_TEST_SOURCES "test_*.cpp") foreach(TEST_SOURCE ${ALL_TEST_SOURCES}) get_filename_component(TESTNAME "${TEST_SOURCE}" NAME_WE) string(REGEX MATCH "${TESTNAME}" MATCH_TESTNAME "${CURRENT_LIST_FILE_CONTENT}") if (NOT MATCH_TESTNAME) message(AUTHOR_WARNING "Test '${TESTNAME}' is not known to CTest.") endif() endforeach() zeromq-4.2.5/unittests/unittest_poller.cpp0000664000372000037200000001170613255253220021747 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../tests/testutil.hpp" #include #include #include #include #ifndef _WIN32 #define closesocket close #endif void setUp () { } void tearDown () { } void test_create () { zmq::thread_ctx_t thread_ctx; zmq::poller_t poller (thread_ctx); } #if 0 // TODO this triggers an assertion. should it be a valid use case? void test_start_empty () { zmq::thread_ctx_t thread_ctx; zmq::poller_t poller (thread_ctx); poller.start (); msleep (SETTLE_TIME); } #endif struct test_events_t : zmq::i_poll_events { test_events_t (zmq::fd_t fd_, zmq::poller_t &poller_) : fd (fd_), poller (poller_) { } virtual void in_event () { poller.rm_fd (handle); handle = (zmq::poller_t::handle_t) NULL; // this must only be incremented after rm_fd in_events.add (1); } virtual void out_event () { // TODO } virtual void timer_event (int id_) { LIBZMQ_UNUSED (id_); poller.rm_fd (handle); handle = (zmq::poller_t::handle_t) NULL; // this must only be incremented after rm_fd timer_events.add (1); } void set_handle (zmq::poller_t::handle_t handle_) { handle = handle_; } zmq::atomic_counter_t in_events, timer_events; private: zmq::fd_t fd; zmq::poller_t &poller; zmq::poller_t::handle_t handle; }; void wait_in_events (test_events_t &events) { void *watch = zmq_stopwatch_start (); while (events.in_events.get () < 1) { #ifdef ZMQ_BUILD_DRAFT TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME, zmq_stopwatch_intermediate (watch), "Timeout waiting for in event"); #endif } zmq_stopwatch_stop (watch); } void wait_timer_events (test_events_t &events) { void *watch = zmq_stopwatch_start (); while (events.timer_events.get () < 1) { #ifdef ZMQ_BUILD_DRAFT TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME, zmq_stopwatch_intermediate (watch), "Timeout waiting for timer event"); #endif } zmq_stopwatch_stop (watch); } void create_nonblocking_fdpair (zmq::fd_t *r, zmq::fd_t *w) { int rc = zmq::make_fdpair (r, w); TEST_ASSERT_EQUAL_INT (0, rc); TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *r); TEST_ASSERT_NOT_EQUAL (zmq::retired_fd, *w); zmq::unblock_socket (*r); zmq::unblock_socket (*w); } void send_signal (zmq::fd_t w) { #if defined ZMQ_HAVE_EVENTFD const uint64_t inc = 1; ssize_t sz = write (w, &inc, sizeof (inc)); assert (sz == sizeof (inc)); #else { char msg[] = "test"; int rc = send (w, msg, sizeof (msg), 0); assert (rc == sizeof (msg)); } #endif } void close_fdpair (zmq::fd_t w, zmq::fd_t r) { int rc = closesocket (w); TEST_ASSERT_EQUAL_INT (0, rc); #if !defined ZMQ_HAVE_EVENTFD rc = closesocket (r); TEST_ASSERT_EQUAL_INT (0, rc); #else LIBZMQ_UNUSED (r); #endif } void test_add_fd_and_start_and_receive_data () { zmq::thread_ctx_t thread_ctx; zmq::poller_t poller (thread_ctx); zmq::fd_t r, w; create_nonblocking_fdpair (&r, &w); test_events_t events (r, poller); zmq::poller_t::handle_t handle = poller.add_fd (r, &events); events.set_handle (handle); poller.set_pollin (handle); poller.start (); send_signal (w); wait_in_events (events); // required cleanup close_fdpair (w, r); } void test_add_fd_and_remove_by_timer () { zmq::fd_t r, w; create_nonblocking_fdpair (&r, &w); zmq::thread_ctx_t thread_ctx; zmq::poller_t poller (thread_ctx); test_events_t events (r, poller); zmq::poller_t::handle_t handle = poller.add_fd (r, &events); events.set_handle (handle); poller.add_timer (50, &events, 0); poller.start (); wait_timer_events (events); // required cleanup close_fdpair (w, r); } int main (void) { UNITY_BEGIN (); zmq::initialize_network (); setup_test_environment (); RUN_TEST (test_create); RUN_TEST (test_add_fd_and_start_and_receive_data); RUN_TEST (test_add_fd_and_remove_by_timer); zmq::shutdown_network (); return UNITY_END (); } zeromq-4.2.5/unittests/unittest_mtrie.cpp0000664000372000037200000003207313255253220021572 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../tests/testutil.hpp" #if defined(min) #undef min #endif #include #include void setUp () { } void tearDown () { } int getlen (const zmq::generic_mtrie_t::prefix_t &data) { return (int) strlen (reinterpret_cast (data)); } void test_create () { zmq::generic_mtrie_t mtrie; } void mtrie_count (int *pipe, int *count) { LIBZMQ_UNUSED (pipe); ++*count; } void test_check_empty_match_nonempty_data () { zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (0, count); } void test_check_empty_match_empty_data () { zmq::generic_mtrie_t mtrie; int count = 0; mtrie.match (NULL, 0, mtrie_count, &count); TEST_ASSERT_EQUAL_INT (0, count); } void test_add_single_entry_match_exact () { int pipe; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); bool res = mtrie.add (test_name, getlen (test_name), &pipe); TEST_ASSERT_TRUE (res); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (1, count); } void test_add_single_entry_twice_match_exact () { int pipe; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); bool res = mtrie.add (test_name, getlen (test_name), &pipe); TEST_ASSERT_TRUE (res); res = mtrie.add (test_name, getlen (test_name), &pipe); TEST_ASSERT_FALSE (res); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (1, count); } void test_add_two_entries_with_same_name_match_exact () { int pipe_1, pipe_2; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); bool res = mtrie.add (test_name, getlen (test_name), &pipe_1); TEST_ASSERT_TRUE (res); res = mtrie.add (test_name, getlen (test_name), &pipe_2); TEST_ASSERT_FALSE (res); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (2, count); } void test_add_two_entries_match_prefix_and_exact () { int pipe_1, pipe_2; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name_prefix = reinterpret_cast::prefix_t> ("foo"); const zmq::generic_mtrie_t::prefix_t test_name_full = reinterpret_cast::prefix_t> ("foobar"); bool res = mtrie.add (test_name_prefix, getlen (test_name_prefix), &pipe_1); TEST_ASSERT_TRUE (res); res = mtrie.add (test_name_full, getlen (test_name_full), &pipe_2); TEST_ASSERT_TRUE (res); int count = 0; mtrie.match (test_name_full, getlen (test_name_full), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (2, count); } void test_add_rm_single_entry_match_exact () { int pipe; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); mtrie.add (test_name, getlen (test_name), &pipe); zmq::generic_mtrie_t::rm_result res = mtrie.rm (test_name, getlen (test_name), &pipe); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::last_value_removed, res); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (0, count); } void test_rm_nonexistent_0_size_empty () { int pipe; zmq::generic_mtrie_t mtrie; zmq::generic_mtrie_t::rm_result res = mtrie.rm (0, 0, &pipe); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::not_found, res); } void test_rm_nonexistent_empty () { int pipe; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t test_name = reinterpret_cast::prefix_t> ("foo"); zmq::generic_mtrie_t::rm_result res = mtrie.rm (test_name, getlen (test_name), &pipe); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::not_found, res); int count = 0; mtrie.match (test_name, getlen (test_name), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (0, count); } void test_add_and_rm_other (const char *add_name, const char *rm_name) { int addpipe, rmpipe; zmq::generic_mtrie_t mtrie; const zmq::generic_mtrie_t::prefix_t add_name_data = reinterpret_cast::prefix_t> (add_name); const zmq::generic_mtrie_t::prefix_t rm_name_data = reinterpret_cast::prefix_t> (rm_name); mtrie.add (add_name_data, getlen (add_name_data), &addpipe); zmq::generic_mtrie_t::rm_result res = mtrie.rm (rm_name_data, getlen (rm_name_data), &rmpipe); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::not_found, res); { int count = 0; mtrie.match (add_name_data, getlen (add_name_data), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (1, count); } if (strncmp (add_name, rm_name, std::min (strlen (add_name), strlen (rm_name) + 1)) != 0) { int count = 0; mtrie.match (rm_name_data, getlen (rm_name_data), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (0, count); } } void test_rm_nonexistent_nonempty_samename () { // TODO this triggers an assertion test_add_and_rm_other ("foo", "foo"); } void test_rm_nonexistent_nonempty_differentname () { test_add_and_rm_other ("foo", "bar"); } void test_rm_nonexistent_nonempty_prefix () { // TODO here, a test assertion fails test_add_and_rm_other ("foobar", "foo"); } void test_rm_nonexistent_nonempty_prefixed () { test_add_and_rm_other ("foo", "foobar"); } void add_indexed_expect_unique (zmq::generic_mtrie_t &mtrie, int *pipes, const char **names, size_t i) { const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (names[i]); bool res = mtrie.add (name_data, getlen (name_data), &pipes[i]); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::last_value_removed, res); } void test_rm_nonexistent_between () { int pipes[3]; const char *names[] = {"foo1", "foo2", "foo3"}; zmq::generic_mtrie_t mtrie; add_indexed_expect_unique (mtrie, pipes, names, 0); add_indexed_expect_unique (mtrie, pipes, names, 2); const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (names[1]); zmq::generic_mtrie_t::rm_result res = mtrie.rm (name_data, getlen (name_data), &pipes[1]); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::not_found, res); } template void add_entries (zmq::generic_mtrie_t &mtrie, int (&pipes)[N], const char *(&names)[N]) { for (size_t i = 0; i < N; ++i) { add_indexed_expect_unique (mtrie, pipes, names, i); } } void test_add_multiple () { int pipes[3]; const char *names[] = {"foo1", "foo2", "foo3"}; zmq::generic_mtrie_t mtrie; add_entries (mtrie, pipes, names); for (size_t i = 0; i < sizeof (names) / sizeof (names[0]); ++i) { const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (names[i]); int count = 0; mtrie.match (name_data, getlen (name_data), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (1, count); } } void test_add_multiple_reverse () { int pipes[3]; const char *names[] = {"foo1", "foo2", "foo3"}; zmq::generic_mtrie_t mtrie; for (int i = 2; i >= 0; --i) { add_indexed_expect_unique (mtrie, pipes, names, (size_t) i); } for (size_t i = 0; i < 3; ++i) { const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (names[i]); int count = 0; mtrie.match (name_data, getlen (name_data), mtrie_count, &count); TEST_ASSERT_EQUAL_INT (1, count); } } template void add_and_rm_entries (const char *(&names)[N]) { int pipes[N]; zmq::generic_mtrie_t mtrie; add_entries (mtrie, pipes, names); for (size_t i = 0; i < N; ++i) { const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (names[i]); zmq::generic_mtrie_t::rm_result res = mtrie.rm (name_data, getlen (name_data), &pipes[i]); TEST_ASSERT_EQUAL (zmq::generic_mtrie_t::last_value_removed, res); } } void test_rm_multiple_in_order () { const char *names[] = {"foo1", "foo2", "foo3"}; add_and_rm_entries (names); } void test_rm_multiple_reverse_order () { const char *names[] = {"foo3", "foo2", "foo1"}; add_and_rm_entries (names); } void check_name (zmq::generic_mtrie_t::prefix_t data_, size_t len_, const char *name_) { TEST_ASSERT_EQUAL_UINT (strlen (name_), len_); TEST_ASSERT_EQUAL_STRING_LEN (name_, data_, len_); } template void add_entries_rm_pipes_unique (const char *(&names)[N]) { int pipes[N]; zmq::generic_mtrie_t mtrie; add_entries (mtrie, pipes, names); for (size_t i = 0; i < N; ++i) { mtrie.rm (&pipes[i], check_name, names[i], false); } } void test_rm_with_callback_multiple_in_order () { const char *names[] = {"foo1", "foo2", "foo3"}; add_entries_rm_pipes_unique (names); } void test_rm_with_callback_multiple_reverse_order () { const char *names[] = {"foo3", "foo2", "foo1"}; add_entries_rm_pipes_unique (names); } void check_count (zmq::generic_mtrie_t::prefix_t data_, size_t len_, int *count_) { --(*count_); TEST_ASSERT_GREATER_OR_EQUAL (0, *count_); } void add_duplicate_entry (zmq::generic_mtrie_t &mtrie, int (&pipes)[2]) { const char *name = "foo"; const zmq::generic_mtrie_t::prefix_t name_data = reinterpret_cast::prefix_t> (name); bool res = mtrie.add (name_data, getlen (name_data), &pipes[0]); TEST_ASSERT_TRUE (res); res = mtrie.add (name_data, getlen (name_data), &pipes[1]); TEST_ASSERT_FALSE (res); } void test_rm_with_callback_duplicate () { int pipes[2]; zmq::generic_mtrie_t mtrie; add_duplicate_entry (mtrie, pipes); int count = 1; mtrie.rm (&pipes[0], check_count, &count, false); count = 1; mtrie.rm (&pipes[1], check_count, &count, false); } void test_rm_with_callback_duplicate_uniq_only () { int pipes[2]; zmq::generic_mtrie_t mtrie; add_duplicate_entry (mtrie, pipes); int count = 0; mtrie.rm (&pipes[0], check_count, &count, true); count = 1; mtrie.rm (&pipes[1], check_count, &count, true); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_create); RUN_TEST (test_check_empty_match_nonempty_data); RUN_TEST (test_check_empty_match_empty_data); RUN_TEST (test_add_single_entry_match_exact); RUN_TEST (test_add_single_entry_twice_match_exact); RUN_TEST (test_add_rm_single_entry_match_exact); RUN_TEST (test_add_two_entries_match_prefix_and_exact); RUN_TEST (test_add_two_entries_with_same_name_match_exact); RUN_TEST (test_rm_nonexistent_0_size_empty); RUN_TEST (test_rm_nonexistent_empty); RUN_TEST (test_rm_nonexistent_nonempty_samename); RUN_TEST (test_rm_nonexistent_nonempty_differentname); RUN_TEST (test_rm_nonexistent_nonempty_prefix); RUN_TEST (test_rm_nonexistent_nonempty_prefixed); RUN_TEST (test_rm_nonexistent_between); RUN_TEST (test_add_multiple); RUN_TEST (test_add_multiple_reverse); RUN_TEST (test_rm_multiple_in_order); RUN_TEST (test_rm_multiple_reverse_order); RUN_TEST (test_rm_with_callback_multiple_in_order); RUN_TEST (test_rm_with_callback_multiple_reverse_order); RUN_TEST (test_rm_with_callback_duplicate); RUN_TEST (test_rm_with_callback_duplicate_uniq_only); return UNITY_END (); } zeromq-4.2.5/doc/0000775000372000037200000000000013255253402014507 5ustar00travistravis00000000000000zeromq-4.2.5/doc/zmq_curve_public.html0000664000372000037200000004537613255253341020767 0ustar00travistravis00000000000000 zmq_curve_public(3)

SYNOPSIS

int zmq_curve_public (char *z85_public_key, char *z85_secret_key);

DESCRIPTION

The zmq_curve_public() function shall derive the public key from a private key. The caller provides two buffers, each at least 41 octets large. In z85_secret_key the caller shall provide the private key, and the function will store the public key in z85_public_key. The keys are encoded using zmq_z85_encode(3).

RETURN VALUE

The zmq_curve_public() function shall return 0 if successful, else it shall return -1 and set errno to one of the values defined below.

ERRORS

ENOTSUP

The libzmq library was not built with cryptographic support (libsodium).

EXAMPLE

Deriving the public key from a CURVE private key
char public_key [41];
char secret_key [41];
int rc = zmq_curve_keypair (public_key, secret_key);
assert (rc == 0);
char derived_public[41];
rc = zmq_curve_public (derived_public, secret_key);
assert (rc == 0);
assert (!strcmp (derived_public, public_key));

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_get.30000664000372000037200000000641713255253362017124 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_get .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_GET" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_get \- get message property .SH "SYNOPSIS" .sp \fBint zmq_msg_get (zmq_msg_t \fR\fB\fI*message\fR\fR\fB, int \fR\fB\fIproperty\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_get()\fR function shall return the value for the property specified by the \fIproperty\fR argument for the message pointed to by the \fImessage\fR argument\&. .sp The following properties can be retrieved with the \fIzmq_msg_get()\fR function: .PP \fBZMQ_MORE\fR .RS 4 Indicates that there are more message frames to follow after the \fImessage\fR\&. .RE .PP \fBZMQ_SRCFD\fR .RS 4 Returns the file descriptor of the socket the \fImessage\fR was read from\&. This allows application to retrieve the remote endpoint via \fIgetpeername(2)\fR\&. Be aware that the respective socket might be closed already, reused even\&. Currently only implemented for TCP sockets\&. .RE .PP \fBZMQ_SHARED\fR .RS 4 Indicates that a message MAY share underlying storage with another copy of this message\&. .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_get()\fR function shall return the value for the property if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested \fIproperty\fR is unknown\&. .RE .SH "EXAMPLE" .PP \fBReceiving a multi-frame message\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_msg_t frame; while (true) { // Create an empty 0MQ message to hold the message frame int rc = zmq_msg_init (&frame); assert (rc == 0); // Block until a message is available to be received from socket rc = zmq_msg_recv (socket, &frame, 0); assert (rc != \-1); if (zmq_msg_get (&frame, ZMQ_MORE)) fprintf (stderr, "more\en"); else { fprintf (stderr, "end\en"); break; } zmq_msg_close (&frame); } .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_set\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_shutdown.txt0000664000372000037200000000231413255253220020666 0ustar00travistravis00000000000000zmq_ctx_shutdown(3) ================== NAME ---- zmq_ctx_shutdown - shutdown a 0MQ context SYNOPSIS -------- *int zmq_ctx_shutdown (void '*context');* DESCRIPTION ----------- The _zmq_ctx_shutdown()_ function shall shutdown the 0MQ context 'context'. Context shutdown will cause any blocking operations currently in progress on sockets open within 'context' to return immediately with an error code of ETERM. With the exception of _zmq_close()_, any further operations on sockets open within 'context' shall fail with an error code of ETERM. This function is optional, client code is still required to call the linkzmq:zmq_ctx_term[3] function to free all resources allocated by zeromq. RETURN VALUE ------------ The _zmq_ctx_shutdown()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EFAULT*:: The provided 'context' was invalid. SEE ALSO -------- linkzmq:zmq[7] linkzmq:zmq_init[3] linkzmq:zmq_ctx_term[3] linkzmq:zmq_close[3] linkzmq:zmq_setsockopt[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_udp.70000664000372000037200000001045313255253402016261 0ustar00travistravis00000000000000'\" t .\" Title: zmq_udp .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_UDP" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_udp \- 0MQ UDP multicast and unicast transport .SH "SYNOPSIS" .sp UDP is unreliable protocol transport of data over IP networks\&. UDP support both unicast and multicast communication\&. .SH "DESCRIPTION" .sp UDP transport can only be used with the \fIZMQ_RADIO\fR and \fIZMQ_DISH\fR socket types\&. .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the UDP transport, the transport is udp\&. The meaning of the \fIaddress\fR part is defined below\&. .sp Binding a socket .sp .if n \{\ .RS 4 .\} .nf With \*(Aqudp\*(Aq we can only bind the \*(AqZMQ_DISH\*(Aq socket type\&. When binding a socket using _zmq_bind()_ with the \*(Aqudp\*(Aq transport the \*(Aqendpoint\*(Aq shall be interpreted as an \*(Aqinterface\*(Aq followed by a colon and the UDP port number to use\&. An \*(Aqinterface\*(Aq may be specified by either of the following: * The wild\-card `*`, meaning all available interfaces\&. * The primary IPv4 address assigned to the interface, in its numeric representation\&. * Multicast address in its numeric representation the socket should join\&. The UDP port number may be specified a numeric value, usually above 1024 on POSIX systems\&. Connecting a socket .fi .if n \{\ .RE .\} .sp With \fIudp\fR we can only connect the \fIZMQ_RADIO\fR socket type\&. When connecting a socket to a peer address using \fIzmq_connect()\fR with the \fIudp\fR transport, the \fIendpoint\fR shall be interpreted as a \fIpeer address\fR followed by a colon and the UDP port number to use\&. .sp A \fIpeer address\fR may be specified by either of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The IPv4 or IPv6 address of the peer, in its numeric representation\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Multicast address in its numeric representation\&. .RE .SH "EXAMPLES" .PP \fBBinding a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Unicast \- UDP port 5555 on all available interfaces rc = zmq_bind(dish, "udp://*:5555"); assert (rc == 0); // Unicast \- UDP port 5555 on the local loop\-back interface rc = zmq_bind(dish, "udp://127\&.0\&.0\&.1:5555"); assert (rc == 0); // Multicast \- UDP port 5555 on a Multicast address rc = zmq_bind(dish, "udp://239\&.0\&.0\&.1:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connecting using an Unicast IP address rc = zmq_connect(radio, "udp://192\&.168\&.1\&.1:5555"); assert (rc == 0); // Connecting using a Multicast address" rc = zmq_connect(socket, "udp://239\&.0\&.0\&.1:5555); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_connect\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_tcp\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq_vmci\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_poll.txt0000664000372000037200000001114513255253220017105 0ustar00travistravis00000000000000zmq_poll(3) =========== NAME ---- zmq_poll - input/output multiplexing SYNOPSIS -------- *int zmq_poll (zmq_pollitem_t '*items', int 'nitems', long 'timeout');* DESCRIPTION ----------- The _zmq_poll()_ function provides a mechanism for applications to multiplex input/output events in a level-triggered fashion over a set of sockets. Each member of the array pointed to by the 'items' argument is a *zmq_pollitem_t* structure. The 'nitems' argument specifies the number of items in the 'items' array. The *zmq_pollitem_t* structure is defined as follows: ["literal", subs="quotes"] typedef struct { void '*socket'; int 'fd'; short 'events'; short 'revents'; } zmq_pollitem_t; For each *zmq_pollitem_t* item, _zmq_poll()_ shall examine either the 0MQ socket referenced by 'socket' *or* the standard socket specified by the file descriptor 'fd', for the event(s) specified in 'events'. If both 'socket' and 'fd' are set in a single *zmq_pollitem_t*, the 0MQ socket referenced by 'socket' shall take precedence and the value of 'fd' shall be ignored. For each *zmq_pollitem_t* item, _zmq_poll()_ shall first clear the 'revents' member, and then indicate any requested events that have occurred by setting the bit corresponding to the event condition in the 'revents' member. If none of the requested events have occurred on any *zmq_pollitem_t* item, _zmq_poll()_ shall wait 'timeout' milliseconds for an event to occur on any of the requested items. If the value of 'timeout' is `0`, _zmq_poll()_ shall return immediately. If the value of 'timeout' is `-1`, _zmq_poll()_ shall block indefinitely until a requested event has occurred on at least one *zmq_pollitem_t*. The 'events' and 'revents' members of *zmq_pollitem_t* are bit masks constructed by OR'ing a combination of the following event flags: *ZMQ_POLLIN*:: For 0MQ sockets, at least one message may be received from the 'socket' without blocking. For standard sockets this is equivalent to the 'POLLIN' flag of the _poll()_ system call and generally means that at least one byte of data may be read from 'fd' without blocking. *ZMQ_POLLOUT*:: For 0MQ sockets, at least one message may be sent to the 'socket' without blocking. For standard sockets this is equivalent to the 'POLLOUT' flag of the _poll()_ system call and generally means that at least one byte of data may be written to 'fd' without blocking. *ZMQ_POLLERR*:: For standard sockets, this flag is passed through _zmq_poll()_ to the underlying _poll()_ system call and generally means that some sort of error condition is present on the socket specified by 'fd'. For 0MQ sockets this flag has no effect if set in 'events', and shall never be returned in 'revents' by _zmq_poll()_. *ZMQ_POLLPRI*:: For 0MQ sockets this flags is of no use. For standard sockets this means there is urgent data to read. Refer to the POLLPRI flag for more informations. For file descriptor, refer to your use case: as an example, GPIO interrupts are signaled through a POLLPRI event. This flag has no effect on Windows. NOTE: The _zmq_poll()_ function may be implemented or emulated using operating system interfaces other than _poll()_, and as such may be subject to the limits of those interfaces in ways not defined in this documentation. RETURN VALUE ------------ Upon successful completion, the _zmq_poll()_ function shall return the number of *zmq_pollitem_t* structures with events signaled in 'revents' or `0` if no events have been signaled. Upon failure, _zmq_poll()_ shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ETERM*:: At least one of the members of the 'items' array refers to a 'socket' whose associated 0MQ 'context' was terminated. *EFAULT*:: The provided 'items' was not valid (NULL). *EINTR*:: The operation was interrupted by delivery of a signal before any events were available. EXAMPLE ------- .Polling indefinitely for input events on both a 0MQ socket and a standard socket. ---- zmq_pollitem_t items [2]; /* First item refers to 0MQ socket 'socket' */ items[0].socket = socket; items[0].events = ZMQ_POLLIN; /* Second item refers to standard socket 'fd' */ items[1].socket = NULL; items[1].fd = fd; items[1].events = ZMQ_POLLIN; /* Poll for events indefinitely */ int rc = zmq_poll (items, 2, -1); assert (rc >= 0); /* Returned events will be stored in items[].revents */ ---- SEE ALSO -------- linkzmq:zmq_socket[3] linkzmq:zmq_send[3] linkzmq:zmq_recv[3] linkzmq:zmq[7] Your operating system documentation for the _poll()_ system call. AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_sendmsg.txt0000664000372000037200000000752313255253220017604 0ustar00travistravis00000000000000zmq_sendmsg(3) ============== NAME ---- zmq_sendmsg - send a message part on a socket SYNOPSIS -------- *int zmq_sendmsg (void '*socket', zmq_msg_t '*msg', int 'flags');* DESCRIPTION ----------- The _zmq_sendmsg()_ function shall queue the message referenced by the 'msg' argument to be sent to the socket referenced by the 'socket' argument. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the 'socket', the _zmq_sendmsg()_ function shall fail with 'errno' set to EAGAIN. *ZMQ_SNDMORE*:: Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description. The _zmq_msg_t_ structure passed to _zmq_sendmsg()_ is nullified during the call. If you want to send the same message to multiple sockets you have to copy it (e.g. using _zmq_msg_copy()_). NOTE: A successful invocation of _zmq_sendmsg()_ does not indicate that the message has been transmitted to the network, only that it has been queued on the 'socket' and 0MQ has assumed responsibility for the message. NOTE: this API method is deprecated in favor of zmq_msg_send(3). Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. Each message part is an independent 'zmq_msg_t' in its own right. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag when sending each message part except the final one. RETURN VALUE ------------ The _zmq_sendmsg()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and the message cannot be sent at the moment. *ENOTSUP*:: The _zmq_sendmsg()_ operation is not supported by this socket type. *EINVAL*:: The sender tried to send multipart data, which the socket type does not allow. *EFSM*:: The _zmq_sendmsg()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before the message was sent. *EFAULT*:: Invalid message. *EHOSTUNREACH*:: The message cannot be routed. EXAMPLE ------- .Filling in a message and sending it to a socket ---- /* Create a new message, allocating 6 bytes for message content */ zmq_msg_t msg; int rc = zmq_msg_init_size (&msg, 6); assert (rc == 0); /* Fill in message content with 'AAAAAA' */ memset (zmq_msg_data (&msg), 'A', 6); /* Send the message to the socket */ rc = zmq_sendmsg (socket, &msg, 0); assert (rc == 6); ---- .Sending a multi-part message ---- /* Send a multi-part message consisting of three parts to socket */ rc = zmq_sendmsg (socket, &part1, ZMQ_SNDMORE); rc = zmq_sendmsg (socket, &part2, ZMQ_SNDMORE); /* Final part; no more parts to follow */ rc = zmq_sendmsg (socket, &part3, 0); ---- SEE ALSO -------- linkzmq:zmq_recv[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_z85_encode.html0000664000372000037200000004472513255253341020245 0ustar00travistravis00000000000000 zmq_z85_encode(3)

SYNOPSIS

char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);

DESCRIPTION

The zmq_z85_encode() function shall encode the binary block specified by data and size into a string in dest. The size of the binary block must be divisible by 4. The dest must have sufficient space for size * 1.25 plus 1 for a null terminator. A 32-byte CURVE key is encoded as 40 ASCII characters plus a null terminator.

The encoding shall follow the ZMQ RFC 32 specification.

RETURN VALUE

The zmq_z85_encode() function shall return dest if successful, else it shall return NULL.

EXAMPLE

Encoding a CURVE key
#include <sodium.h>
uint8_t public_key [32];
uint8_t secret_key [32];
int rc = crypto_box_keypair (public_key, secret_key);
assert (rc == 0);
char encoded [41];
zmq_z85_encode (encoded, public_key, 32);
puts (encoded);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_disconnect.30000664000372000037200000000710713255253350017622 0ustar00travistravis00000000000000'\" t .\" Title: zmq_disconnect .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_DISCONNECT" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_disconnect \- Disconnect a socket .SH "SYNOPSIS" .sp \fBint zmq_disconnect (void \fR\fB\fI*socket\fR\fR\fB, const char \fR\fB\fI*endpoint\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_disconnect()\fR function shall disconnect a socket specified by the \fIsocket\fR argument from the endpoint specified by the \fIendpoint\fR argument\&. Any outstanding messages physically received from the network but not yet received by the application with \fIzmq_recv()\fR shall be discarded\&. The behaviour for discarding messages sent by the application with \fIzmq_send()\fR but not yet physically transferred to the network depends on the value of the \fIZMQ_LINGER\fR socket option for the specified \fIsocket\fR\&. .sp The \fIendpoint\fR argument is as described in \fBzmq_connect\fR(3) .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The default setting of \fIZMQ_LINGER\fR does not discard unsent messages; this behaviour may cause the application to block when calling \fIzmq_ctx_term()\fR\&. For details refer to \fBzmq_setsockopt\fR(3) and \fBzmq_ctx_term\fR(3)\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_disconnect()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The endpoint supplied is invalid\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBENOENT\fR .RS 4 The provided endpoint is not connected\&. .RE .SH "EXAMPLE" .PP \fBConnecting a subscriber socket to an in-process and a TCP transport\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_connect (socket, "tcp://server001:5555"); assert (rc == 0); /* Disconnect from the previously connected endpoint */ rc = zmq_disconnect (socket, "tcp://server001:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_unbind.html0000664000372000037200000005030413255253325017551 0ustar00travistravis00000000000000 zmq_unbind(3)

SYNOPSIS

int zmq_unbind (void *socket, const char *endpoint);

DESCRIPTION

The zmq_unbind() function shall unbind a socket specified by the socket argument from the endpoint specified by the endpoint argument.

The endpoint argument is as described in zmq_bind(3)

Unbinding wild-card address from a socket

When wild-card * endpoint (described in zmq_tcp(7), zmq_ipc(7) and zmq_vmci(7)) was used in zmq_bind(), the caller should use real endpoint obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this endpoint from a socket.

RETURN VALUE

The zmq_unbind() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The endpoint supplied is invalid.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

ENOENT

The endpoint supplied was not previously bound.

EXAMPLES

Unbind a subscriber socket from a TCP transport
/* Create a ZMQ_SUB socket */
void *socket = zmq_socket (context, ZMQ_SUB);
assert (socket);
/* Connect it to the host server001, port 5555 using a TCP transport */
rc = zmq_bind (socket, "tcp://127.0.0.1:5555");
assert (rc == 0);
/* Disconnect from the previously connected endpoint */
rc = zmq_unbind (socket, "tcp://127.0.0.1:5555");
assert (rc == 0);
Unbind wild-card * binded socket
/* Create a ZMQ_SUB socket */
void *socket = zmq_socket (context, ZMQ_SUB);
assert (socket);
/* Bind it to the system-assigned ephemeral port using a TCP transport */
rc = zmq_bind (socket, "tcp://127.0.0.1:*");
assert (rc == 0);
/* Obtain real endpoint */
const size_t buf_size = 32;
char buf[buf_size];
rc = zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, buf, (size_t *)&buf_size);
assert (rc == 0);
/* Unbind socket by real endpoint */
rc = zmq_unbind (socket, buf);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_proxy.html0000664000372000037200000005142513255253340017455 0ustar00travistravis00000000000000 zmq_proxy(3)

SYNOPSIS

int zmq_proxy (const void *frontend, const void *backend, const void *capture);

DESCRIPTION

The zmq_proxy() function starts the built-in ØMQ proxy in the current application thread.

The proxy connects a frontend socket to a backend socket. Conceptually, data flows from frontend to backend. Depending on the socket types, replies may flow in the opposite direction. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between frontend and backend.

Before calling zmq_proxy() you must set any socket options, and connect or bind both frontend and backend sockets. The two conventional proxy models are:

zmq_proxy() runs in the current thread and returns only if/when the current context is closed.

If the capture socket is not NULL, the proxy shall send all messages, received on both frontend and backend, to the capture socket. The capture socket should be a ZMQ_PUB, ZMQ_DEALER, ZMQ_PUSH, or ZMQ_PAIR socket.

Refer to zmq_socket(3) for a description of the available socket types.

EXAMPLE USAGE

Shared Queue

When the frontend is a ZMQ_ROUTER socket, and the backend is a ZMQ_DEALER socket, the proxy shall act as a shared queue that collects requests from a set of clients, and distributes these fairly among a set of services. Requests shall be fair-queued from frontend connections and distributed evenly across backend connections. Replies shall automatically return to the client that made the original request.

Forwarder

When the frontend is a ZMQ_XSUB socket, and the backend is a ZMQ_XPUB socket, the proxy shall act as a message forwarder that collects messages from a set of publishers and forwards these to a set of subscribers. This may be used to bridge networks transports, e.g. read on tcp:// and forward on pgm://.

Streamer

When the frontend is a ZMQ_PULL socket, and the backend is a ZMQ_PUSH socket, the proxy shall collect tasks from a set of clients and forwards these to a set of workers using the pipeline pattern.

RETURN VALUE

The zmq_proxy() function always returns -1 and errno set to ETERM or EINTR (the ØMQ context associated with either of the specified sockets was terminated).

EXAMPLE

Creating a shared queue proxy
//  Create frontend and backend sockets
void *frontend = zmq_socket (context, ZMQ_ROUTER);
assert (backend);
void *backend = zmq_socket (context, ZMQ_DEALER);
assert (frontend);
//  Bind both sockets to TCP ports
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
assert (zmq_bind (backend, "tcp://*:5556") == 0);
//  Start the queue proxy, which runs until ETERM
zmq_proxy (frontend, backend, NULL);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_bind.30000664000372000037200000001213613255253347016411 0ustar00travistravis00000000000000'\" t .\" Title: zmq_bind .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_BIND" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_bind \- accept incoming connections on a socket .SH "SYNOPSIS" .sp \fBint zmq_bind (void \fR\fB\fI*socket\fR\fR\fB, const char \fR\fB\fI*endpoint\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_bind()\fR function binds the \fIsocket\fR to a local \fIendpoint\fR and then accepts incoming connections on that endpoint\&. .sp The \fIendpoint\fR is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to bind to\&. .sp 0MQ provides the the following transports: .PP \fItcp\fR .RS 4 unicast transport using TCP, see \fBzmq_tcp\fR(7) .RE .PP \fIipc\fR .RS 4 local inter\-process communication transport, see \fBzmq_ipc\fR(7) .RE .PP \fIinproc\fR .RS 4 local in\-process (inter\-thread) communication transport, see \fBzmq_inproc\fR(7) .RE .PP \fIpgm\fR, \fIepgm\fR .RS 4 reliable multicast transport using PGM, see \fBzmq_pgm\fR(7) .RE .PP \fIvmci\fR .RS 4 virtual machine communications interface (VMCI), see \fBzmq_vmci\fR(7) .RE .sp Every 0MQ socket type except \fIZMQ_PAIR\fR supports one\-to\-many and many\-to\-one semantics\&. The precise semantics depend on the socket type and are defined in \fBzmq_socket\fR(3)\&. .sp The \fIipc\fR, \fItcp\fR and \fIvmci\fR transports accept wildcard addresses: see \fBzmq_ipc\fR(7), \fBzmq_tcp\fR(7) and \fBzmq_vmci\fR(7) for details\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp the address syntax may be different for \fIzmq_bind()\fR and \fIzmq_connect()\fR especially for the \fItcp\fR, \fIpgm\fR and \fIepgm\fR transports\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp following a \fIzmq_bind()\fR, the socket enters a \fImute\fR state unless or until at least one incoming or outgoing connection is made, at which point the socket enters a \fIready\fR state\&. In the mute state, the socket blocks or drops messages according to the socket type, as defined in \fBzmq_socket\fR(3)\&. By contrast, following a libzmq:zmq_connect[3], the socket enters the \fIready\fR state\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_bind()\fR function returns zero if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The endpoint supplied is invalid\&. .RE .PP \fBEPROTONOSUPPORT\fR .RS 4 The requested \fItransport\fR protocol is not supported\&. .RE .PP \fBENOCOMPATPROTO\fR .RS 4 The requested \fItransport\fR protocol is not compatible with the socket type\&. .RE .PP \fBEADDRINUSE\fR .RS 4 The requested \fIaddress\fR is already in use\&. .RE .PP \fBEADDRNOTAVAIL\fR .RS 4 The requested \fIaddress\fR was not local\&. .RE .PP \fBENODEV\fR .RS 4 The requested \fIaddress\fR specifies a nonexistent interface\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEMTHREAD\fR .RS 4 No I/O thread is available to accomplish the task\&. .RE .SH "EXAMPLE" .PP \fBBinding a publisher socket to an in-process and a TCP transport\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a ZMQ_PUB socket */ void *socket = zmq_socket (context, ZMQ_PUB); assert (socket); /* Bind it to a in\-process transport with the address \*(Aqmy_publisher\*(Aq */ int rc = zmq_bind (socket, "inproc://my_publisher"); assert (rc == 0); /* Bind it to a TCP transport on port 5555 of the \*(Aqeth0\*(Aq interface */ rc = zmq_bind (socket, "tcp://eth0:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_close.html0000664000372000037200000004635613255253326017414 0ustar00travistravis00000000000000 zmq_close(3)

SYNOPSIS

int zmq_close (void *socket);

DESCRIPTION

The zmq_close() function shall destroy the socket referenced by the socket argument. Any outstanding messages physically received from the network but not yet received by the application with zmq_recv() shall be discarded. The behaviour for discarding messages sent by the application with zmq_send() but not yet physically transferred to the network depends on the value of the ZMQ_LINGER socket option for the specified socket.

zmq_close() must be called exactly once for each socket. If it is never called, zmq_ctx_term() will block forever. If it is called multiple times for the same socket or if socket does not point to a socket, the behaviour is undefined.

Note
The default setting of ZMQ_LINGER does not discard unsent messages; this behaviour may cause the application to block when calling zmq_ctx_term(). For details refer to zmq_setsockopt(3) and zmq_ctx_term(3).
Note
This API will complete asynchronously, so not everything will be deallocated after it returns. See above for details about linger.

RETURN VALUE

The zmq_close() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

ENOTSOCK

The provided socket was NULL.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/Makefile.am0000664000372000037200000000354013255253220016543 0ustar00travistravis00000000000000# # documentation # MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_disconnect.3 zmq_close.3 \ zmq_ctx_new.3 zmq_ctx_term.3 zmq_ctx_get.3 zmq_ctx_set.3 zmq_ctx_shutdown.3 \ zmq_msg_init.3 zmq_msg_init_data.3 zmq_msg_init_size.3 \ zmq_msg_move.3 zmq_msg_copy.3 zmq_msg_size.3 zmq_msg_data.3 zmq_msg_close.3 \ zmq_msg_send.3 zmq_msg_recv.3 \ zmq_msg_routing_id.3 zmq_msg_set_routing_id.3 \ zmq_send.3 zmq_recv.3 zmq_send_const.3 \ zmq_msg_get.3 zmq_msg_set.3 zmq_msg_more.3 zmq_msg_gets.3 \ zmq_getsockopt.3 zmq_setsockopt.3 \ zmq_socket.3 zmq_socket_monitor.3 zmq_poll.3 \ zmq_errno.3 zmq_strerror.3 zmq_version.3 \ zmq_sendmsg.3 zmq_recvmsg.3 \ zmq_proxy.3 zmq_proxy_steerable.3 \ zmq_z85_encode.3 zmq_z85_decode.3 zmq_curve_keypair.3 zmq_curve_public.3 \ zmq_has.3 \ zmq_atomic_counter_new.3 zmq_atomic_counter_set.3 \ zmq_atomic_counter_inc.3 zmq_atomic_counter_dec.3 \ zmq_atomic_counter_value.3 zmq_atomic_counter_destroy.3 MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \ zmq_null.7 zmq_plain.7 zmq_curve.7 zmq_tipc.7 zmq_vmci.7 zmq_udp.7 \ zmq_gssapi.7 MAN_DOC = MAN_TXT = $(MAN3:%.3=%.txt) MAN_TXT += $(MAN7:%.7=%.txt) MAN_HTML = MAINTAINERCLEANFILES = EXTRA_DIST = asciidoc.conf $(MAN_TXT) if INSTALL_MAN MAN_DOC += $(MAN1) $(MAN3) $(MAN7) dist_man_MANS = $(MAN_DOC) MAINTAINERCLEANFILES += $(MAN_DOC) endif if BUILD_DOC MAN_HTML += $(MAN_TXT:%.txt=%.html) EXTRA_DIST += $(MAN_HTML) MAINTAINERCLEANFILES += $(MAN_HTML) SUFFIXES=.html .txt .xml .3 .7 .txt.html: asciidoc -d manpage -b xhtml11 -f $(srcdir)/asciidoc.conf \ -azmq_version=@PACKAGE_VERSION@ -o$@ $< .txt.xml: asciidoc -d manpage -b docbook -f $(srcdir)/asciidoc.conf \ -azmq_version=@PACKAGE_VERSION@ -o$@ $< .xml.1: xmlto man $< .xml.3: xmlto man $< .xml.7: xmlto man $< endif dist-hook : $(MAN_DOC) $(MAN_HTML) zeromq-4.2.5/doc/zmq_atomic_counter_destroy.txt0000664000372000037200000000316713255253220022730 0ustar00travistravis00000000000000zmq_atomic_counter_destroy(3) ============================= NAME ---- zmq_atomic_counter_destroy - destroy an atomic counter SYNOPSIS -------- *void zmq_atomic_counter_destroy (void **counter_p);* DESCRIPTION ----------- The _zmq_atomic_counter_destroy_ function destroys an atomic counter and nullifies its reference. Pass the address of an atomic counter (void **) rather than the counter itself. You must destroy all counters that you create, to avoid memory leakage. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_destroy()_ function has no return value. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_value[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_recv.txt0000664000372000037200000000734713255253220017755 0ustar00travistravis00000000000000zmq_msg_recv(3) =============== NAME ---- zmq_msg_recv - receive a message part from a socket SYNOPSIS -------- *int zmq_msg_recv (zmq_msg_t '*msg', void '*socket', int 'flags');* DESCRIPTION ----------- The _zmq_msg_recv()_ function is identical to linkzmq:zmq_recvmsg[3], which shall be deprecated in future versions. _zmq_msg_recv()_ is more consistent with other message manipulation functions. The _zmq_msg_recv()_ function shall receive a message part from the socket referenced by the 'socket' argument and store it in the message referenced by the 'msg' argument. Any content previously stored in 'msg' shall be properly deallocated. If there are no message parts available on the specified 'socket' the _zmq_msg_recv()_ function shall block until the request can be satisfied. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified 'socket', the _zmq_msg_recv()_ function shall fail with 'errno' set to EAGAIN. Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. Each message part is an independent 'zmq_msg_t' in its own right. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that processes multi-part messages must use the _ZMQ_RCVMORE_ linkzmq:zmq_getsockopt[3] option after calling _zmq_msg_recv()_ to determine if there are further parts to receive. RETURN VALUE ------------ The _zmq_msg_recv()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and no messages are available at the moment. *ENOTSUP*:: The _zmq_msg_recv()_ operation is not supported by this socket type. *EFSM*:: The _zmq_msg_recv()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before a message was available. *EFAULT*:: The message passed to the function was invalid. EXAMPLE ------- .Receiving a message from a socket ---- /* Create an empty 0MQ message */ zmq_msg_t msg; int rc = zmq_msg_init (&msg); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_msg_recv (&msg, socket, 0); assert (rc != -1); /* Release message */ zmq_msg_close (&msg); ---- .Receiving a multi-part message ---- int more; size_t more_size = sizeof (more); do { /* Create an empty 0MQ message to hold the message part */ zmq_msg_t part; int rc = zmq_msg_init (&part); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_msg_recv (&part, socket, 0); assert (rc != -1); /* Determine if more message parts are to follow */ rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); zmq_msg_close (&part); } while (more); ---- SEE ALSO -------- linkzmq:zmq_recv[3] linkzmq:zmq_send[3] linkzmq:zmq_msg_send[3] linkzmq:zmq_getsockopt[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_set.30000664000372000037200000000426613255253362017140 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_set .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_SET" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_set \- set message property .SH "SYNOPSIS" .sp \fBint zmq_msg_set (zmq_msg_t \fR\fB\fI*message\fR\fR\fB, int \fR\fB\fIproperty\fR\fR\fB, int \fR\fB\fIvalue\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_set()\fR function shall set the property specified by the \fIproperty\fR argument to the value of the \fIvalue\fR argument for the 0MQ message fragment pointed to by the \fImessage\fR argument\&. .sp Currently the \fIzmq_msg_set()\fR function does not support any property names\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_set()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested property \fIproperty\fR is unknown\&. .RE .SH "SEE ALSO" .sp \fBzmq_msg_get\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_version.html0000664000372000037200000004442313255253336017766 0ustar00travistravis00000000000000 zmq_version(3)

SYNOPSIS

void zmq_version (int *major, int *minor, int *patch);

DESCRIPTION

The zmq_version() function shall fill in the integer variables pointed to by the major, minor and patch arguments with the major, minor and patch level components of the ØMQ library version.

This functionality is intended for applications or language bindings dynamically linking to the ØMQ library that wish to determine the actual version of the ØMQ library they are using.

RETURN VALUE

There is no return value.

ERRORS

No errors are defined.

EXAMPLE

Printing out the version of the ØMQ library
int major, minor, patch;
zmq_version (&major, &minor, &patch);
printf ("Current 0MQ version is %d.%d.%d\n", major, minor, patch);

SEE ALSO

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_set.html0000664000372000037200000004536313255253342022170 0ustar00travistravis00000000000000 zmq_atomic_counter_set(3)

SYNOPSIS

void zmq_atomic_counter_set (void *counter, int value);

DESCRIPTION

The zmq_atomic_counter_set function sets the counter to a new value, in a threadsafe fashion. The largest value that is guaranteed to work across all platforms is 2^31-1. This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_set() function has no return value.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_ctx_get.30000664000372000037200000001006113255253351017120 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ctx_get .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CTX_GET" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_get \- get context options .SH "SYNOPSIS" .sp \fBint zmq_ctx_get (void \fR\fB\fI*context\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_get()\fR function shall return the option specified by the \fIoption_name\fR argument\&. .sp The \fIzmq_ctx_get()\fR function accepts the following option names: .SS "ZMQ_IO_THREADS: Get number of I/O threads" .sp The \fIZMQ_IO_THREADS\fR argument returns the size of the 0MQ thread pool for this context\&. .SS "ZMQ_MAX_SOCKETS: Get maximum number of sockets" .sp The \fIZMQ_MAX_SOCKETS\fR argument returns the maximum number of sockets allowed for this context\&. .SS "ZMQ_MAX_MSGSZ: Get maximum message size" .sp The \fIZMQ_MAX_MSGSZ\fR argument returns the maximum size of a message allowed for this context\&. Default value is INT_MAX\&. .SS "ZMQ_ZERO_COPY_RCV: Get message decoding strategy" .sp The \fIZMQ_ZERO_COPY_RCV\fR argument return whether message decoder uses a zero copy strategy when receiving messages\&. Default value is 1\&. NOTE: in DRAFT state, not yet available in stable releases\&. .SS "ZMQ_SOCKET_LIMIT: Get largest configurable number of sockets" .sp The \fIZMQ_SOCKET_LIMIT\fR argument returns the largest number of sockets that \fBzmq_ctx_set\fR(3) will accept\&. .SS "ZMQ_IPV6: Set IPv6 option" .sp The \fIZMQ_IPV6\fR argument returns the IPv6 option for the context\&. .SS "ZMQ_BLOCKY: Get blocky setting" .sp The \fIZMQ_BLOCKY\fR argument returns 1 if the context will block on terminate, zero if the "block forever on context termination" gambit was disabled by setting ZMQ_BLOCKY to false on all new contexts\&. .SS "ZMQ_MSG_T_SIZE: Get the zmq_msg_t size at runtime" .sp The \fIZMQ_MSG_T_SIZE\fR argument returns the size of the zmq_msg_t structure at runtime, as defined in the include/zmq\&.h public header\&. This is useful for example for FFI bindings that can\(cqt simply do a sizeof()\&. NOTE: in DRAFT state, not yet available in stable releases\&. .SH "RETURN VALUE" .sp The \fIzmq_ctx_get()\fR function returns a value of 0 or greater if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown\&. .RE .SH "EXAMPLE" .PP \fBSetting a limit on the number of sockets\fR. .sp .if n \{\ .RS 4 .\} .nf void *context = zmq_ctx_new (); zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256); int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS); assert (max_sockets == 256); .fi .if n \{\ .RE .\} .PP \fBSwitching off the context deadlock gambit\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_ctx_set (ctx, ZMQ_BLOCKY, false); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_ctx_set\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_get.html0000664000372000037200000005206413255253327017736 0ustar00travistravis00000000000000 zmq_ctx_get(3)

SYNOPSIS

int zmq_ctx_get (void *context, int option_name);

DESCRIPTION

The zmq_ctx_get() function shall return the option specified by the option_name argument.

The zmq_ctx_get() function accepts the following option names:

ZMQ_IO_THREADS: Get number of I/O threads

The ZMQ_IO_THREADS argument returns the size of the ØMQ thread pool for this context.

ZMQ_MAX_SOCKETS: Get maximum number of sockets

The ZMQ_MAX_SOCKETS argument returns the maximum number of sockets allowed for this context.

ZMQ_MAX_MSGSZ: Get maximum message size

The ZMQ_MAX_MSGSZ argument returns the maximum size of a message allowed for this context. Default value is INT_MAX.

ZMQ_ZERO_COPY_RCV: Get message decoding strategy

The ZMQ_ZERO_COPY_RCV argument return whether message decoder uses a zero copy strategy when receiving messages. Default value is 1. NOTE: in DRAFT state, not yet available in stable releases.

ZMQ_SOCKET_LIMIT: Get largest configurable number of sockets

The ZMQ_SOCKET_LIMIT argument returns the largest number of sockets that zmq_ctx_set(3) will accept.

ZMQ_IPV6: Set IPv6 option

The ZMQ_IPV6 argument returns the IPv6 option for the context.

ZMQ_BLOCKY: Get blocky setting

The ZMQ_BLOCKY argument returns 1 if the context will block on terminate, zero if the "block forever on context termination" gambit was disabled by setting ZMQ_BLOCKY to false on all new contexts.

ZMQ_MSG_T_SIZE: Get the zmq_msg_t size at runtime

The ZMQ_MSG_T_SIZE argument returns the size of the zmq_msg_t structure at runtime, as defined in the include/zmq.h public header. This is useful for example for FFI bindings that can’t simply do a sizeof(). NOTE: in DRAFT state, not yet available in stable releases.

RETURN VALUE

The zmq_ctx_get() function returns a value of 0 or greater if successful. Otherwise it returns -1 and sets errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown.

EXAMPLE

Setting a limit on the number of sockets
void *context = zmq_ctx_new ();
zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);
int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);
assert (max_sockets == 256);
Switching off the context deadlock gambit
zmq_ctx_set (ctx, ZMQ_BLOCKY, false);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_tipc.html0000664000372000037200000004721213255253345017237 0ustar00travistravis00000000000000 zmq_tipc(7)

SYNOPSIS

TIPC is a cluster IPC protocol with a location transparent addressing scheme.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the TIPC transport, the transport is tipc, and the meaning of the address part is defined below.

Assigning a port name to a socket

When assigning a port name to a socket using zmq_bind() with the tipc transport, the endpoint is defined in the form: {type, lower, upper}

  • Type is the numerical (u32) ID of your service.

  • Lower and Upper specify a range for your service.

Publishing the same service with overlapping lower/upper ID’s will cause connection requests to be distributed over these in a round-robin manner.

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the tipc transport, the endpoint shall be interpreted as a service ID, followed by a comma and the instance ID.

The instance ID must be within the lower/upper range of a published port name for the endpoint to be valid.

EXAMPLES

Assigning a local address to a socket
//  Publish TIPC service ID 5555
rc = zmq_bind(socket, "tipc://{5555,0,0}");
assert (rc == 0);
//  Publish TIPC service ID 5555 with a service range of 0-100
rc = zmq_bind(socket, "tipc://{5555,0,100}");
assert (rc == 0);
Connecting a socket
//  Connect to service 5555 instance id 50
rc = zmq_connect(socket, "tipc://{5555,50}");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_dec.30000664000372000037200000000537213255253375021330 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_dec .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_D" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_dec \- decrement an atomic counter .SH "SYNOPSIS" .sp \fBint zmq_atomic_counter_dec (void *counter);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_dec\fR function decrements an atomic counter in a threadsafe fashion\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_dec()\fR function returns 1 if the counter is greater than zero after decrementing, or zero if the counter reached zero\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_new\fR(3) \fBzmq_atomic_counter_set\fR(3) \fBzmq_atomic_counter_inc\fR(3) \fBzmq_atomic_counter_value\fR(3) \fBzmq_atomic_counter_destroy\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_poll.html0000664000372000037200000005644713255253334017256 0ustar00travistravis00000000000000 zmq_poll(3)

SYNOPSIS

int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);

DESCRIPTION

The zmq_poll() function provides a mechanism for applications to multiplex input/output events in a level-triggered fashion over a set of sockets. Each member of the array pointed to by the items argument is a zmq_pollitem_t structure. The nitems argument specifies the number of items in the items array. The zmq_pollitem_t structure is defined as follows:

typedef struct
{
    void *socket;
    int fd;
    short events;
    short revents;
} zmq_pollitem_t;

For each zmq_pollitem_t item, zmq_poll() shall examine either the ØMQ socket referenced by socket or the standard socket specified by the file descriptor fd, for the event(s) specified in events. If both socket and fd are set in a single zmq_pollitem_t, the ØMQ socket referenced by socket shall take precedence and the value of fd shall be ignored.

For each zmq_pollitem_t item, zmq_poll() shall first clear the revents member, and then indicate any requested events that have occurred by setting the bit corresponding to the event condition in the revents member.

If none of the requested events have occurred on any zmq_pollitem_t item, zmq_poll() shall wait timeout milliseconds for an event to occur on any of the requested items. If the value of timeout is 0, zmq_poll() shall return immediately. If the value of timeout is -1, zmq_poll() shall block indefinitely until a requested event has occurred on at least one zmq_pollitem_t.

The events and revents members of zmq_pollitem_t are bit masks constructed by OR’ing a combination of the following event flags:

ZMQ_POLLIN

For ØMQ sockets, at least one message may be received from the socket without blocking. For standard sockets this is equivalent to the POLLIN flag of the poll() system call and generally means that at least one byte of data may be read from fd without blocking.

ZMQ_POLLOUT

For ØMQ sockets, at least one message may be sent to the socket without blocking. For standard sockets this is equivalent to the POLLOUT flag of the poll() system call and generally means that at least one byte of data may be written to fd without blocking.

ZMQ_POLLERR

For standard sockets, this flag is passed through zmq_poll() to the underlying poll() system call and generally means that some sort of error condition is present on the socket specified by fd. For ØMQ sockets this flag has no effect if set in events, and shall never be returned in revents by zmq_poll().

ZMQ_POLLPRI

For ØMQ sockets this flags is of no use. For standard sockets this means there is urgent data to read. Refer to the POLLPRI flag for more informations. For file descriptor, refer to your use case: as an example, GPIO interrupts are signaled through a POLLPRI event. This flag has no effect on Windows.

Note
The zmq_poll() function may be implemented or emulated using operating system interfaces other than poll(), and as such may be subject to the limits of those interfaces in ways not defined in this documentation.

RETURN VALUE

Upon successful completion, the zmq_poll() function shall return the number of zmq_pollitem_t structures with events signaled in revents or 0 if no events have been signaled. Upon failure, zmq_poll() shall return -1 and set errno to one of the values defined below.

ERRORS

ETERM

At least one of the members of the items array refers to a socket whose associated ØMQ context was terminated.

EFAULT

The provided items was not valid (NULL).

EINTR

The operation was interrupted by delivery of a signal before any events were available.

EXAMPLE

Polling indefinitely for input events on both a ØMQ socket and a standard socket.
zmq_pollitem_t items [2];
/* First item refers to 0MQ socket 'socket' */
items[0].socket = socket;
items[0].events = ZMQ_POLLIN;
/* Second item refers to standard socket 'fd' */
items[1].socket = NULL;
items[1].fd = fd;
items[1].events = ZMQ_POLLIN;
/* Poll for events indefinitely */
int rc = zmq_poll (items, 2, -1);
assert (rc >= 0);
/* Returned events will be stored in items[].revents */

SEE ALSO

Your operating system documentation for the poll() system call.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_value.txt0000664000372000037200000000316613255253220022352 0ustar00travistravis00000000000000zmq_atomic_counter_value(3) =========================== NAME ---- zmq_atomic_counter_value - return value of atomic counter SYNOPSIS -------- *int zmq_atomic_counter_value (void *counter);* DESCRIPTION ----------- The _zmq_atomic_counter_value_ function returns the value of an atomic counter created by _zmq_atomic_counter_new()_. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_value()_ function returns the value of the atomic counter. If _counter_ does not point to an atomic counter created by _zmq_atomic_counter_new()_, the behaviour is undefined. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_destroy[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_move.txt0000664000372000037200000000231713255253220017754 0ustar00travistravis00000000000000zmq_msg_move(3) =============== NAME ---- zmq_msg_move - move content of a message to another message SYNOPSIS -------- *int zmq_msg_move (zmq_msg_t '*dest', zmq_msg_t '*src');* DESCRIPTION ----------- The _zmq_msg_move()_ function shall move the content of the message object referenced by 'src' to the message object referenced by 'dest'. No actual copying of message content is performed, 'dest' is simply updated to reference the new content. 'src' becomes an empty message after calling _zmq_msg_move()_. The original content of 'dest', if any, shall be released. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. RETURN VALUE ------------ The _zmq_msg_move()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EFAULT*:: Invalid message. SEE ALSO -------- linkzmq:zmq_msg_copy[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_proxy_steerable.html0000664000372000037200000005205313255253340021501 0ustar00travistravis00000000000000 zmq_proxy_steerable(3)

SYNOPSIS

int zmq_proxy_steerable (const void *frontend, const void *backend, const void *capture, const void *control);

DESCRIPTION

The zmq_proxy_steerable() function starts the built-in ØMQ proxy in the current application thread, as zmq_proxy() do. Please, refer to this function for the general description and usage. We describe here only the additional control flow provided by the socket passed as the fourth argument "control".

If the control socket is not NULL, the proxy supports control flow. If PAUSE is received on this socket, the proxy suspends its activities. If RESUME is received, it goes on. If TERMINATE is received, it terminates smoothly. If STATISTICS is received, the proxy will reply on the control socket sending a multipart message with 8 frames, each with an unsigned integer 64-bit wide that provide in the following order: - number of messages received by the frontend socket - number of bytes received by the frontend socket - number of messages sent out the frontend socket - number of bytes sent out the frontend socket - number of messages received by the backend socket - number of bytes received by the backend socket - number of messages sent out the backend socket - number of bytes sent out the backend socket

At start, the proxy runs normally as if zmq_proxy was used.

If the control socket is NULL, the function behave exactly as if zmq_proxy(3) had been called.

Refer to zmq_socket(3) for a description of the available socket types. Refer to zmq_proxy(3) for a description of the zmq_proxy.

EXAMPLE USAGE

cf zmq_proxy

RETURN VALUE

The zmq_proxy_steerable() function returns 0 if TERMINATE is sent to its control socket. Otherwise, it returns -1 and errno set to ETERM or EINTR (the ØMQ context associated with either of the specified sockets was terminated).

EXAMPLE

Creating a shared queue proxy
//  Create frontend, backend and control sockets
void *frontend = zmq_socket (context, ZMQ_ROUTER);
assert (backend);
void *backend = zmq_socket (context, ZMQ_DEALER);
assert (frontend);
void *control = zmq_socket (context, ZMQ_SUB);
assert (control);

//  Bind sockets to TCP ports
assert (zmq_bind (frontend, "tcp://*:5555") == 0);
assert (zmq_bind (backend, "tcp://*:5556") == 0);
assert (zmq_connect (control, "tcp://*:5557") == 0);

// Subscribe to the control socket since we have chosen SUB here
assert (zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0));

//  Start the queue proxy, which runs until ETERM or "TERMINATE"
//  received on the control socket
zmq_proxy_steerable (frontend, backend, NULL, control);
Set up a controller in another node, process or whatever
void *control = zmq_socket (context, ZMQ_PUB);
assert (control);
assert (zmq_bind (control, "tcp://*:5557") == 0);

// pause the proxy
assert (zmq_send (control, "PAUSE", 5, 0) == 0);

// resume the proxy
assert (zmq_send (control, "RESUME", 6, 0) == 0);

// terminate the proxy
assert (zmq_send (control, "TERMINATE", 9, 0) == 0);
---


SEE ALSO

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_set.txt0000664000372000037200000000305013255253220022021 0ustar00travistravis00000000000000zmq_atomic_counter_set(3) ========================= NAME ---- zmq_atomic_counter_set - set atomic counter to new value SYNOPSIS -------- *void zmq_atomic_counter_set (void *counter, int value);* DESCRIPTION ----------- The _zmq_atomic_counter_set_ function sets the counter to a new value, in a threadsafe fashion. The largest value that is guaranteed to work across all platforms is 2^31-1. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_set()_ function has no return value. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_value[3] linkzmq:zmq_atomic_counter_destroy[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ctx_new.30000664000372000037200000000430013255253351017131 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ctx_new .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CTX_NEW" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_new \- create new 0MQ context .SH "SYNOPSIS" .sp \fBvoid *zmq_ctx_new ();\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_new()\fR function creates a new 0MQ \fIcontext\fR\&. .sp This function replaces the deprecated function \fBzmq_init\fR(3)\&. .PP \fBThread safety\fR. A 0MQ \fIcontext\fR is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller\&. .SH "RETURN VALUE" .sp The \fIzmq_ctx_new()\fR function shall return an opaque handle to the newly created \fIcontext\fR if successful\&. Otherwise it shall return NULL and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .sp No error values are defined for this function\&. .SH "SEE ALSO" .sp \fBzmq\fR(7) \fBzmq_ctx_set\fR(3) \fBzmq_ctx_get\fR(3) \fBzmq_ctx_term\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_inproc.txt0000664000372000037200000000514113255253220017430 0ustar00travistravis00000000000000zmq_inproc(7) ============= NAME ---- zmq_inproc - 0MQ local in-process (inter-thread) communication transport SYNOPSIS -------- The in-process transport passes messages via memory directly between threads sharing a single 0MQ 'context'. NOTE: No I/O threads are involved in passing messages using the 'inproc' transport. Therefore, if you are using a 0MQ 'context' for in-process messaging only you can initialise the 'context' with zero I/O threads. See linkzmq:zmq_init[3] for details. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the in-process transport, the transport is `inproc`, and the meaning of the 'address' part is defined below. Assigning a local address to a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When assigning a local address to a 'socket' using _zmq_bind()_ with the 'inproc' transport, the 'endpoint' shall be interpreted as an arbitrary string identifying the 'name' to create. The 'name' must be unique within the 0MQ 'context' associated with the 'socket' and may be up to 256 characters in length. No other restrictions are placed on the format of the 'name'. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a 'socket' to a peer address using _zmq_connect()_ with the 'inproc' transport, the 'endpoint' shall be interpreted as an arbitrary string identifying the 'name' to connect to. Before version 4.0 he 'name' must have been previously created by assigning it to at least one 'socket' within the same 0MQ 'context' as the 'socket' being connected. Since version 4.0 the order of _zmq_bind()_ and _zmq_connect()_ does not matter just like for the tcp transport type. EXAMPLES -------- .Assigning a local address to a socket ---- // Assign the in-process name "#1" rc = zmq_bind(socket, "inproc://#1"); assert (rc == 0); // Assign the in-process name "my-endpoint" rc = zmq_bind(socket, "inproc://my-endpoint"); assert (rc == 0); ---- .Connecting a socket ---- // Connect to the in-process name "#1" rc = zmq_connect(socket, "inproc://#1"); assert (rc == 0); // Connect to the in-process name "my-endpoint" rc = zmq_connect(socket, "inproc://my-endpoint"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_ipc[7] linkzmq:zmq_tcp[7] linkzmq:zmq_pgm[7] linkzmq:zmq_vmci[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_data.30000664000372000037200000000431213255253356017251 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_data .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_DATA" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_data \- retrieve pointer to message content .SH "SYNOPSIS" .sp \fBvoid *zmq_msg_data (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_data()\fR function shall return a pointer to the message content of the message object referenced by \fImsg\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .SH "RETURN VALUE" .sp Upon successful completion, \fIzmq_msg_data()\fR shall return a pointer to the message content\&. .SH "ERRORS" .sp No errors are defined\&. .SH "SEE ALSO" .sp \fBzmq_msg_size\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_init.html0000664000372000037200000004560213255253327020112 0ustar00travistravis00000000000000 zmq_msg_init(3)

SYNOPSIS

int zmq_msg_init (zmq_msg_t *msg);

DESCRIPTION

The zmq_msg_init() function shall initialise the message object referenced by msg to represent an empty message. This function is most useful when called before receiving a message with zmq_msg_recv().

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.
Caution
The functions zmq_msg_init(), zmq_msg_init_data() and zmq_msg_init_size() are mutually exclusive. Never initialise the same zmq_msg_t twice.

RETURN VALUE

The zmq_msg_init() function always returns zero.

ERRORS

No errors are defined.

EXAMPLE

Receiving a message from a socket
zmq_msg_t msg;
rc = zmq_msg_init (&msg);
assert (rc == 0);
int nbytes = zmq_msg_recv (socket, &msg, 0);
assert (nbytes != -1);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_tipc.txt0000664000372000037200000000406013255253220017074 0ustar00travistravis00000000000000zmq_tipc(7) ========== NAME ---- zmq_tipc - 0MQ unicast transport using TIPC SYNOPSIS -------- TIPC is a cluster IPC protocol with a location transparent addressing scheme. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the TIPC transport, the transport is `tipc`, and the meaning of the 'address' part is defined below. Assigning a port name to a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When assigning a port name to a socket using _zmq_bind()_ with the 'tipc' transport, the 'endpoint' is defined in the form: {type, lower, upper} * Type is the numerical (u32) ID of your service. * Lower and Upper specify a range for your service. Publishing the same service with overlapping lower/upper ID's will cause connection requests to be distributed over these in a round-robin manner. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a socket to a peer address using _zmq_connect()_ with the 'tipc' transport, the 'endpoint' shall be interpreted as a service ID, followed by a comma and the instance ID. The instance ID must be within the lower/upper range of a published port name for the endpoint to be valid. EXAMPLES -------- .Assigning a local address to a socket ---- // Publish TIPC service ID 5555 rc = zmq_bind(socket, "tipc://{5555,0,0}"); assert (rc == 0); // Publish TIPC service ID 5555 with a service range of 0-100 rc = zmq_bind(socket, "tipc://{5555,0,100}"); assert (rc == 0); ---- .Connecting a socket ---- // Connect to service 5555 instance id 50 rc = zmq_connect(socket, "tipc://{5555,50}"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_tcp[7] linkzmq:zmq_pgm[7] linkzmq:zmq_ipc[7] linkzmq:zmq_inproc[7] linkzmq:zmq_vmci[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_null.70000664000372000037200000000326213255253400016441 0ustar00travistravis00000000000000'\" t .\" Title: zmq_null .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_NULL" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_null \- no security or confidentiality .SH "SYNOPSIS" .sp The NULL mechanism is defined by the ZMTP 3\&.0 specification: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:23\fR\m[]\&. This is the default security mechanism for ZeroMQ sockets\&. .SH "SEE ALSO" .sp \fBzmq_plain\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_send.30000664000372000037200000001356213255253356017300 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_send .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_SEND" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_send \- send a message part on a socket .SH "SYNOPSIS" .sp \fBint zmq_msg_send (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_send()\fR function is identical to \fBzmq_sendmsg\fR(3), which shall be deprecated in future versions\&. \fIzmq_msg_send()\fR is more consistent with other message manipulation functions\&. .sp The \fIzmq_msg_send()\fR function shall queue the message referenced by the \fImsg\fR argument to be sent to the socket referenced by the \fIsocket\fR argument\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the \fIsocket\fR, the \fIzmq_msg_send()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .PP \fBZMQ_SNDMORE\fR .RS 4 Specifies that the message being sent is a multi\-part message, and that further message parts are to follow\&. Refer to the section regarding multi\-part messages below for a detailed description\&. .RE .sp The \fIzmq_msg_t\fR structure passed to \fIzmq_msg_send()\fR is nullified during the call\&. If you want to send the same message to multiple sockets you have to copy it (e\&.g\&. using \fIzmq_msg_copy()\fR)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp A successful invocation of \fIzmq_msg_send()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&. You do not need to call \fIzmq_msg_close()\fR after a successful \fIzmq_msg_send()\fR\&. .sp .5v .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. Each message part is an independent \fIzmq_msg_t\fR in its own right\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that sends multi\-part messages must use the \fIZMQ_SNDMORE\fR flag when sending each message part except the final one\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_send()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and the message cannot be sent at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_msg_send()\fR operation is not supported by this socket type\&. .RE .PP \fBEINVAL\fR .RS 4 The sender tried to send multipart data, which the socket type does not allow\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_msg_send()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before the message was sent\&. .RE .PP \fBEFAULT\fR .RS 4 Invalid message\&. .RE .PP \fBEHOSTUNREACH\fR .RS 4 The message cannot be routed\&. .RE .SH "EXAMPLE" .PP \fBFilling in a message and sending it to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a new message, allocating 6 bytes for message content */ zmq_msg_t msg; int rc = zmq_msg_init_size (&msg, 6); assert (rc == 0); /* Fill in message content with \*(AqAAAAAA\*(Aq */ memset (zmq_msg_data (&msg), \*(AqA\*(Aq, 6); /* Send the message to the socket */ rc = zmq_msg_send (&msg, socket, 0); assert (rc == 6); .fi .if n \{\ .RE .\} .PP \fBSending a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf /* Send a multi\-part message consisting of three parts to socket */ rc = zmq_msg_send (&part1, socket, ZMQ_SNDMORE); rc = zmq_msg_send (&part2, socket, ZMQ_SNDMORE); /* Final part; no more parts to follow */ rc = zmq_msg_send (&part3, socket, 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_msg_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_set.30000664000372000037200000002031013255253352017133 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ctx_set .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CTX_SET" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_set \- set context options .SH "SYNOPSIS" .sp \fBint zmq_ctx_set (void \fR\fB\fI*context\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, int \fR\fB\fIoption_value\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_set()\fR function shall set the option specified by the \fIoption_name\fR argument to the value of the \fIoption_value\fR argument\&. .sp The \fIzmq_ctx_set()\fR function accepts the following options: .SS "ZMQ_BLOCKY: Fix blocky behavior" .sp By default the context will block, forever, on a zmq_ctx_term call\&. The assumption behind this behavior is that abrupt termination will cause message loss\&. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with \fIZMQ_LINGER\fR set to zero on all sockets\&. This setting is an easier way to get the same result\&. When \fIZMQ_BLOCKY\fR is set to false, all new sockets are given a linger timeout of zero\&. You must still close all sockets before calling zmq_ctx_term\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp true (old behavior) T} .TE .sp 1 .SS "ZMQ_IO_THREADS: Set number of I/O threads" .sp The \fIZMQ_IO_THREADS\fR argument specifies the size of the 0MQ thread pool to handle I/O operations\&. If your application is using only the \fIinproc\fR transport for messaging you may set this to zero, otherwise set it to at least one\&. This option only applies before creating any sockets on the context\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp 1 T} .TE .sp 1 .SS "ZMQ_THREAD_SCHED_POLICY: Set scheduling policy for I/O threads" .sp The \fIZMQ_THREAD_SCHED_POLICY\fR argument sets the scheduling policy for internal context\(cqs thread pool\&. This option is not available on windows\&. Supported values for this option can be found in sched\&.h file, or at \m[blue]\fBhttp://man7\&.org/linux/man\-pages/man2/sched_setscheduler\&.2\&.html\fR\m[]\&. This option only applies before creating any sockets on the context\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp \-1 T} .TE .sp 1 .SS "ZMQ_THREAD_PRIORITY: Set scheduling priority for I/O threads" .sp The \fIZMQ_THREAD_PRIORITY\fR argument sets scheduling priority for internal context\(cqs thread pool\&. This option is not available on windows\&. Supported values for this option depend on chosen scheduling policy\&. On Linux, when the scheduler policy is SCHED_OTHER, SCHED_IDLE or SCHED_BATCH, the OS scheduler will not use the thread priority but rather the thread "nice value"; in such cases the system call "nice" will be used to set the nice value to \-20 (max priority) instead of adjusting the thread priority (which must be zero for those scheduling policies)\&. Details can be found in sched\&.h file, or at \m[blue]\fBhttp://man7\&.org/linux/man\-pages/man2/sched_setscheduler\&.2\&.html\fR\m[]\&. This option only applies before creating any sockets on the context\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp \-1 T} .TE .sp 1 .SS "ZMQ_THREAD_AFFINITY_CPU_ADD: Add a CPU to list of affinity for I/O threads" .sp The \fIZMQ_THREAD_AFFINITY_CPU_ADD\fR argument adds a specific CPU to the affinity list for the internal context\(cqs thread pool\&. This option is only supported on Linux\&. This option only applies before creating any sockets on the context\&. The default affinity list is empty and means that no explicit CPU\-affinity will be set on internal context\(cqs threads\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp \-1 T} .TE .sp 1 .SS "ZMQ_THREAD_AFFINITY_CPU_REMOVE: Remove a CPU to list of affinity for I/O threads" .sp The \fIZMQ_THREAD_AFFINITY_CPU_REMOVE\fR argument removes a specific CPU to the affinity list for the internal context\(cqs thread pool\&. This option is only supported on Linux\&. This option only applies before creating any sockets on the context\&. The default affinity list is empty and means that no explicit CPU\-affinity will be set on internal context\(cqs threads\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp \-1 T} .TE .sp 1 .SS "ZMQ_THREAD_NAME_PREFIX: Set name prefix for I/O threads" .sp The \fIZMQ_THREAD_NAME_PREFIX\fR argument sets a numeric prefix to each thread created for the internal context\(cqs thread pool\&. This option is only supported on Linux\&. This option is useful to help debugging done via "top \-H" or "gdb"; in case multiple processes on the system are using ZeroMQ it is useful to provide through this context option an application\-specific prefix to distinguish ZeroMQ background threads that belong to different processes\&. This option only applies before creating any sockets on the context\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp \-1 T} .TE .sp 1 .SS "ZMQ_MAX_MSGSZ: Set maximum message size" .sp The \fIZMQ_MAX_MSGSZ\fR argument sets the maximum allowed size of a message sent in the context\&. You can query the maximal allowed value with \fBzmq_ctx_get\fR(3) using the \fIZMQ_MAX_MSGSZ\fR option\&. .TS tab(:); lt lt lt lt. T{ .sp Default value T}:T{ .sp INT_MAX T} T{ .sp Maximum value T}:T{ .sp INT_MAX T} .TE .sp 1 .SS "ZMQ_ZERO_COPY_RCV: Specify message decoding strategy" .sp The \fIZMQ_ZERO_COPY_RCV\fR argument specifies whether the message decoder should use a zero copy strategy when receiving messages\&. The zero copy strategy can lead to increased memory usage in some cases\&. This option allows you to use the older copying strategy\&. You can query the value of this option with \fBzmq_ctx_get\fR(3) using the \fIZMQ_ZERO_COPY_RECV\fR option\&. NOTE: in DRAFT state, not yet available in stable releases\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp 1 T} .TE .sp 1 .SS "ZMQ_MAX_SOCKETS: Set maximum number of sockets" .sp The \fIZMQ_MAX_SOCKETS\fR argument sets the maximum number of sockets allowed on the context\&. You can query the maximal allowed value with \fBzmq_ctx_get\fR(3) using the \fIZMQ_SOCKET_LIMIT\fR option\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp 1024 T} .TE .sp 1 .SS "ZMQ_IPV6: Set IPv6 option" .sp The \fIZMQ_IPV6\fR argument sets the IPv6 value for all sockets created in the context from this point onwards\&. A value of 1 means IPv6 is enabled, while 0 means the socket will use only IPv4\&. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&. .TS tab(:); lt lt. T{ .sp Default value T}:T{ .sp 0 T} .TE .sp 1 .SH "RETURN VALUE" .sp The \fIzmq_ctx_set()\fR function returns zero if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown\&. .RE .SH "EXAMPLE" .PP \fBSetting a limit on the number of sockets\fR. .sp .if n \{\ .RS 4 .\} .nf void *context = zmq_ctx_new (); zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256); int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS); assert (max_sockets == 256); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_ctx_get\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_set.txt0000664000372000037200000000164613255253220017605 0ustar00travistravis00000000000000zmq_msg_set(3) ============== NAME ---- zmq_msg_set - set message property SYNOPSIS -------- *int zmq_msg_set (zmq_msg_t '*message', int 'property', int 'value');* DESCRIPTION ----------- The _zmq_msg_set()_ function shall set the property specified by the 'property' argument to the value of the 'value' argument for the 0MQ message fragment pointed to by the 'message' argument. Currently the _zmq_msg_set()_ function does not support any property names. RETURN VALUE ------------ The _zmq_msg_set()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested property _property_ is unknown. SEE ALSO -------- linkzmq:zmq_msg_get[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_udp.html0000664000372000037200000005054713255253346017076 0ustar00travistravis00000000000000 zmq_udp(7)

SYNOPSIS

UDP is unreliable protocol transport of data over IP networks. UDP support both unicast and multicast communication.

DESCRIPTION

UDP transport can only be used with the ZMQ_RADIO and ZMQ_DISH socket types.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the UDP transport, the transport is udp. The meaning of the address part is defined below.

Binding a socket

With 'udp' we can only bind the 'ZMQ_DISH' socket type.
When binding a socket using _zmq_bind()_ with the 'udp'
transport the 'endpoint' shall be interpreted as an 'interface' followed by a
colon and the UDP port number to use.

An 'interface' may be specified by either of the following:

* The wild-card `*`, meaning all available interfaces.
* The primary IPv4 address assigned to the interface, in its numeric
  representation.
* Multicast address in its numeric representation the socket should join.

The UDP port number may be specified a numeric value, usually above 1024 on POSIX systems.

Connecting a socket

With udp we can only connect the ZMQ_RADIO socket type. When connecting a socket to a peer address using zmq_connect() with the udp transport, the endpoint shall be interpreted as a peer address followed by a colon and the UDP port number to use.

A peer address may be specified by either of the following:

  • The IPv4 or IPv6 address of the peer, in its numeric representation.

  • Multicast address in its numeric representation.

EXAMPLES

Binding a socket
//  Unicast - UDP port 5555 on all available interfaces
rc = zmq_bind(dish, "udp://*:5555");
assert (rc == 0);
//  Unicast - UDP port 5555 on the local loop-back interface
rc = zmq_bind(dish, "udp://127.0.0.1:5555");
assert (rc == 0);
//  Multicast - UDP port 5555 on a Multicast address
rc = zmq_bind(dish, "udp://239.0.0.1:5555");
assert (rc == 0);
Connecting a socket
//  Connecting using an Unicast IP address
rc = zmq_connect(radio, "udp://192.168.1.1:5555");
assert (rc == 0);
//  Connecting using a Multicast address"
rc = zmq_connect(socket, "udp://239.0.0.1:5555);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_gssapi.txt0000664000372000037200000000504613255253220017430 0ustar00travistravis00000000000000zmq_gssapi(7) ============ NAME ---- zmq_gssapi - secure authentication and confidentiality SYNOPSIS -------- The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks. GSSAPI itself is defined in IETF RFC-2743: . The ZeroMQ GSSAPI mechanism is defined by this document: . CLIENT AND SERVER ROLES ----------------------- A socket using GSSAPI can be either client or server, but not both. To become a GSSAPI server, the application sets the ZMQ_GSSAPI_SERVER option on the socket. To become a GSSAPI client, the application sets the ZMQ_GSSAPI_SERVICE_PRINCIPAL option to the name of the principal on the server to which it intends to connect. On client or server, the application may additionally set the ZMQ_GSSAPI_PRINCIPAL option to provide the socket with the name of the principal for whom GSSAPI credentials should be acquired. If this option is not set, default credentials are used. OPTIONAL ENCRYPTION ------------------- By default, the GSSAPI mechanism will encrypt all communications between client and server. If encryption is not desired (e.g. on private networks), the client and server applications can disable it by setting the ZMQ_GSSAPI_PLAINTEXT option. Both the client and server must set this option to the same value. PRINCIPAL NAMES --------------- Principal names specified with the ZMQ_GSSAPI_SERVICE_PRINCIPAL or ZMQ_GSSAPI_PRINCIPAL options are interpreted as "host based" name types by default. The ZMQ_GSSAPI_PRINCIPAL_NAMETYPE and ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE options may be used to change the name type to one of: *ZMQ_GSSAPI_NT_HOSTBASED*:: The name should be of the form "service" or "service@hostname", which will parse into a principal of "service/hostname" in the local realm. This is the default name type. *ZMQ_GSSAPI_NT_USER_NAME*:: The name should be a local username, which will parse into a single-component principal in the local realm. *ZMQ_GSSAPI_NT_KRB5_PRINCIPAL*:: The name is a principal name string. This name type only works with the krb5 GSSAPI mechanism. SEE ALSO -------- linkzmq:zmq_setsockopt[3] linkzmq:zmq_null[7] linkzmq:zmq_curve[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_close.txt0000664000372000037200000000256613255253220020121 0ustar00travistravis00000000000000zmq_msg_close(3) ================ NAME ---- zmq_msg_close - release 0MQ message SYNOPSIS -------- *int zmq_msg_close (zmq_msg_t '*msg');* DESCRIPTION ----------- The _zmq_msg_close()_ function shall inform the 0MQ infrastructure that any resources associated with the message object referenced by 'msg' are no longer required and may be released. Actual release of resources associated with the message object shall be postponed by 0MQ until all users of the message or underlying data buffer have indicated it is no longer required. Applications should ensure that _zmq_msg_close()_ is called once a message is no longer required, otherwise memory leaks may occur. Note that this is NOT necessary after a successful _zmq_msg_send()_. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. RETURN VALUE ------------ The _zmq_msg_close()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EFAULT*:: Invalid message. SEE ALSO -------- linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_size[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_send.txt0000664000372000037200000000623613255253220017075 0ustar00travistravis00000000000000zmq_send(3) =========== NAME ---- zmq_send - send a message part on a socket SYNOPSIS -------- *int zmq_send (void '*socket', void '*buf', size_t 'len', int 'flags');* DESCRIPTION ----------- The _zmq_send()_ function shall queue a message created from the buffer referenced by the 'buf' and 'len' arguments. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the 'socket', the _zmq_send()_ function shall fail with 'errno' set to EAGAIN. *ZMQ_SNDMORE*:: Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description. NOTE: A successful invocation of _zmq_send()_ does not indicate that the message has been transmitted to the network, only that it has been queued on the 'socket' and 0MQ has assumed responsibility for the message. Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag when sending each message part except the final one. RETURN VALUE ------------ The _zmq_send()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and the message cannot be sent at the moment. *ENOTSUP*:: The _zmq_send()_ operation is not supported by this socket type. *EINVAL*:: The sender tried to send multipart data, which the socket type does not allow. *EFSM*:: The _zmq_send()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before the message was sent. *EHOSTUNREACH*:: The message cannot be routed. EXAMPLE ------- .Sending a multi-part message ---- /* Send a multi-part message consisting of three parts to socket */ rc = zmq_send (socket, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (socket, "DEFGH", 5, ZMQ_SNDMORE); assert (rc == 5); /* Final part; no more parts to follow */ rc = zmq_send (socket, "JK", 2, 0); assert (rc == 2); ---- SEE ALSO -------- linkzmq:zmq_send_const[3] linkzmq:zmq_recv[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_atomic_counter_inc.html0000664000372000037200000004527013255253342022143 0ustar00travistravis00000000000000 zmq_atomic_counter_inc(3)

SYNOPSIS

int zmq_atomic_counter_inc (void *counter);

DESCRIPTION

The zmq_atomic_counter_inc function increments an atomic counter in a threadsafe fashion. This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_inc() function returns the old value of the counter, before incrementing.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_routing_id.html0000664000372000037200000004471613255253331021312 0ustar00travistravis00000000000000 zmq_msg_routing_id(3)

SYNOPSIS

uint32_t zmq_msg_routing_id (zmq_msg_t *message);

DESCRIPTION

The zmq_msg_routing_id() function returns the routing ID for the message, if any. The routing ID is set on all messages received from a ZMQ_SERVER socket. To send a message to a ZMQ_SERVER socket you must set the routing ID of a connected ZMQ_CLIENT peer. Routing IDs are transient.

RETURN VALUE

The zmq_msg_routing_id() function shall return zero if there is no routing ID, otherwise it shall return an unsigned 32-bit integer greater than zero.

EXAMPLE

Receiving a client message and routing ID
void *ctx = zmq_ctx_new ();
assert (ctx);

void *server = zmq_socket (ctx, ZMQ_SERVER);
assert (server);
int rc = zmq_bind (server, "tcp://127.0.0.1:8080");
assert (rc == 0);

zmq_msg_t message;
rc = zmq_msg_init (&message);
assert (rc == 0);

//  Receive a message from socket
rc = zmq_msg_recv (server, &message, 0);
assert (rc != -1);
uint32_t routing_id = zmq_msg_routing_id (&message);
assert (routing_id);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_inc.txt0000664000372000037200000000275513255253220022012 0ustar00travistravis00000000000000zmq_atomic_counter_inc(3) ========================= NAME ---- zmq_atomic_counter_inc - increment an atomic counter SYNOPSIS -------- *int zmq_atomic_counter_inc (void *counter);* DESCRIPTION ----------- The _zmq_atomic_counter_inc_ function increments an atomic counter in a threadsafe fashion. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_inc()_ function returns the old value of the counter, before incrementing. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_value[3] linkzmq:zmq_atomic_counter_destroy[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_more.txt0000664000372000037200000000271613255253220017753 0ustar00travistravis00000000000000zmq_msg_more(3) =============== NAME ---- zmq_msg_more - indicate if there are more message parts to receive SYNOPSIS -------- *int zmq_msg_more (zmq_msg_t '*message');* DESCRIPTION ----------- The _zmq_msg_more()_ function indicates whether this is part of a multi-part message, and there are further parts to receive. This method can safely be called after _zmq_msg_close()_. This method is identical to _zmq_msg_get()_ with an argument of ZMQ_MORE. RETURN VALUE ------------ The _zmq_msg_more()_ function shall return zero if this is the final part of a multi-part message, or the only part of a single-part message. It shall return 1 if there are further parts to receive. EXAMPLE ------- .Receiving a multi-part message ---- zmq_msg_t part; while (true) { // Create an empty 0MQ message to hold the message part int rc = zmq_msg_init (&part); assert (rc == 0); // Block until a message is available to be received from socket rc = zmq_msg_recv (socket, &part, 0); assert (rc != -1); if (zmq_msg_more (&part)) fprintf (stderr, "more\n"); else { fprintf (stderr, "end\n"); break; } zmq_msg_close (&part); } ---- SEE ALSO -------- linkzmq:zmq_msg_get[3] linkzmq:zmq_msg_set[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_copy.html0000664000372000037200000004676513255253330020126 0ustar00travistravis00000000000000 zmq_msg_copy(3)

SYNOPSIS

int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src);

DESCRIPTION

The zmq_msg_copy() function shall copy the message object referenced by src to the message object referenced by dest. The original content of dest, if any, shall be released. You must initialise dest before copying to it.

Caution
The implementation may choose not to physically copy the message content, rather to share the underlying buffer between src and dest. Avoid modifying message content after a message has been copied with zmq_msg_copy(), doing so can result in undefined behaviour. If what you need is an actual hard copy, allocate a new message using zmq_msg_init_size() and copy the message content using memcpy().
Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.

RETURN VALUE

The zmq_msg_copy() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EFAULT

Invalid message.

EXAMPLE

Copying a message
zmq_msg_t msg;
zmq_msg_init_size (&msg, 255);
memcpy (zmq_msg_data (&msg, "Hello, World", 12);
zmq_msg_t copy;
zmq_msg_init (&copy);
zmq_msg_copy (&copy, &msg);
...
zmq_msg_close (&copy);
zmq_msg_close (&msg);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_socket.30000664000372000037200000007543513255253365017000 0ustar00travistravis00000000000000'\" t .\" Title: zmq_socket .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SOCKET" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_socket \- create 0MQ socket .SH "SYNOPSIS" .sp \fBvoid *zmq_socket (void \fR\fB\fI*context\fR\fR\fB, int \fR\fB\fItype\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_socket()\fR function shall create a 0MQ socket within the specified \fIcontext\fR and return an opaque handle to the newly created socket\&. The \fItype\fR argument specifies the socket type, which determines the semantics of communication over the socket\&. .sp The newly created socket is initially unbound, and not associated with any endpoints\&. In order to establish a message flow a socket must first be connected to at least one endpoint with \fBzmq_connect\fR(3), or at least one endpoint must be created for accepting incoming connections with \fBzmq_bind\fR(3)\&. .PP \fBKey differences to conventional sockets\fR. Generally speaking, conventional sockets present a \fIsynchronous\fR interface to either connection\-oriented reliable byte streams (SOCK_STREAM), or connection\-less unreliable datagrams (SOCK_DGRAM)\&. In comparison, 0MQ sockets present an abstraction of an asynchronous \fImessage queue\fR, with the exact queueing semantics depending on the socket type in use\&. Where conventional sockets transfer streams of bytes or discrete datagrams, 0MQ sockets transfer discrete \fImessages\fR\&. .sp 0MQ sockets being \fIasynchronous\fR means that the timings of the physical connection setup and tear down, reconnect and effective delivery are transparent to the user and organized by 0MQ itself\&. Further, messages may be \fIqueued\fR in the event that a peer is unavailable to receive them\&. .sp Conventional sockets allow only strict one\-to\-one (two peers), many\-to\-one (many clients, one server), or in some cases one\-to\-many (multicast) relationships\&. With the exception of \fIZMQ_PAIR\fR, 0MQ sockets may be connected \fBto multiple endpoints\fR using \fIzmq_connect()\fR, while simultaneously accepting incoming connections \fBfrom multiple endpoints\fR bound to the socket using \fIzmq_bind()\fR, thus allowing many\-to\-many relationships\&. .PP \fBThread safety\fR. 0MQ has both thread safe socket type and \fInot\fR thread safe socket types\&. Applications MUST NOT use a \fInot\fR thread safe socket from multiple threads except after migrating a socket from one thread to another with a "full fence" memory barrier\&. .sp Following are the thread safe sockets: * ZMQ_CLIENT * ZMQ_SERVER * ZMQ_DISH * ZMQ_RADIO * ZMQ_SCATTER * ZMQ_GATHER .PP \fBSocket types\fR. The following sections present the socket types defined by 0MQ, grouped by the general \fImessaging pattern\fR which is built from related socket types\&. .SS "Client\-server pattern" .sp The client\-server pattern is used to allow a single \fIZMQ_SERVER\fR \fIserver\fR talk to one or more \fIZMQ_CLIENT\fR \fIclients\fR\&. The client always starts the conversation, after which either peer can send messages asynchronously, to the other\&. .sp The client\-server pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:41\fR\m[]\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_CLIENT\fR .RS 4 .sp A \fIZMQ_CLIENT\fR socket talks to a \fIZMQ_SERVER\fR socket\&. Either peer can connect, though the usual and recommended model is to bind the \fIZMQ_SERVER\fR and connect the \fIZMQ_CLIENT\fR\&. .sp If the \fIZMQ_CLIENT\fR socket has established a connection, \fBzmq_send\fR(3) will accept messages, queue them, and send them as rapidly as the network allows\&. The outgoing buffer limit is defined by the high water mark for the socket\&. If the outgoing buffer is full, or if there is no connected peer, \fBzmq_send\fR(3) will block, by default\&. The \fIZMQ_CLIENT\fR socket will not drop messages\&. .sp When a \fIZMQ_CLIENT\fR socket is connected to multiple \fIZMQ_SERVER\fR sockets, outgoing messages are distributed between connected peers on a round\-robin basis\&. Likewise, the \fIZMQ_CLIENT\fR socket receives messages fairly from each connected peer\&. This usage is sensible only for stateless protocols\&. .sp \fIZMQ_CLIENT\fR sockets are threadsafe and can be used from multiple threads at the same time\&. Note that replies from a \fIZMQ_SERVER\fR socket will go to the first client thread that calls \fBzmq_msg_recv\fR(3)\&. If you need to get replies back to the originating thread, use one \fIZMQ_CLIENT\fR socket per thread\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp \fIZMQ_CLIENT\fR sockets are threadsafe\&. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives\&. This limits them to single part data\&. The intention is to extend the API to allow scatter/gather of multi\-part data\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&1.\ \&Summary of ZMQ_CLIENT characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_SERVER\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Outgoing routing strategy T}:T{ .sp Round\-robin T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_SERVER\fR .RS 4 .sp A \fIZMQ_SERVER\fR socket talks to a set of \fIZMQ_CLIENT\fR sockets\&. A \fIZMQ_SERVER\fR socket can only reply to an incoming message: the \fIZMQ_CLIENT\fR peer must always initiate a conversation\&. .sp Each received message has a \fIrouting_id\fR that is a 32\-bit unsigned integer\&. The application can fetch this with \fBzmq_msg_routing_id\fR(3)\&. To send a message to a given \fIZMQ_CLIENT\fR peer the application must set the peer\(cqs \fIrouting_id\fR on the message, using \fBzmq_msg_set_routing_id\fR(3)\&. .sp If the \fIrouting_id\fR is not specified, or does not refer to a connected client peer, the send call will fail with EHOSTUNREACH\&. If the outgoing buffer for the client peer is full, the send call shall block, unless ZMQ_DONT_WAIT is used in the send, in which case it shall fail with EAGAIN\&. The \fIZMQ_SERVER\fR socket shall not drop messages in any case\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp \fIZMQ_SERVER\fR sockets are threadsafe\&. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives\&. This limits them to single part data\&. The intention is to extend the API to allow scatter/gather of multi\-part data\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&2.\ \&Summary of ZMQ_SERVER characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_CLIENT\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Outgoing routing strategy T}:T{ .sp See text T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Action in mute state T}:T{ .sp Return EAGAIN T} .TE .sp 1 .RE .SS "Radio\-dish pattern" .sp The radio\-dish pattern is used for one\-to\-many distribution of data from a single \fIpublisher\fR to multiple \fIsubscribers\fR in a fan out fashion\&. .sp Radio\-dish is using groups (vs Pub\-sub topics), Dish sockets can join a group and each message sent by Radio sockets belong to a group\&. .sp Groups are null terminated strings limited to 16 chars length (including null)\&. The intention is to increase the length to 40 chars (including null)\&. The encoding of groups shall be UTF8\&. .sp Groups are matched using exact matching (vs prefix matching of PubSub)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Radio\-dish is still in draft phase\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_RADIO\fR .RS 4 .sp A socket of type \fIZMQ_RADIO\fR is used by a \fIpublisher\fR to distribute data\&. Each message belong to a group, a group is specified with \fBzmq_msg_set_group\fR(3)\&. Messages are distributed to all members of a group\&. The \fBzmq_recv\fR(3) function is not implemented for this socket type\&. .sp When a \fIZMQ_RADIO\fR socket enters the \fImute\fR state due to having reached the high water mark for a \fIsubscriber\fR, then any messages that would be sent to the \fIsubscriber\fR in question shall instead be dropped until the mute state ends\&. The \fIzmq_send()\fR function shall never block for this socket type\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp \fIZMQ_RADIO\fR sockets are threadsafe\&. They do not accept the ZMQ_SNDMORE option on sends\&. This limits them to single part data\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&3.\ \&Summary of ZMQ_RADIO characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_DISH\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Send only T} T{ .sp Incoming routing strategy T}:T{ .sp N/A T} T{ .sp Outgoing routing strategy T}:T{ .sp Fan out T} T{ .sp Action in mute state T}:T{ .sp Drop T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_DISH\fR .RS 4 .sp A socket of type \fIZMQ_DISH\fR is used by a \fIsubscriber\fR to subscribe to groups distributed by a \fIradio\fR\&. Initially a \fIZMQ_DISH\fR socket is not subscribed to any groups, use \fBzmq_join\fR(3) to join a group\&. To get the group the message belong to call \fBzmq_msg_group\fR(3)\&. The \fIzmq_send()\fR function is not implemented for this socket type\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp \fIZMQ_DISH\fR sockets are threadsafe\&. They do not accept ZMQ_RCVMORE on receives\&. This limits them to single part data\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&4.\ \&Summary of ZMQ_DISH characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_RADIO\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Receive only T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Outgoing routing strategy T}:T{ .sp N/A T} .TE .sp 1 .RE .SS "Publish\-subscribe pattern" .sp The publish\-subscribe pattern is used for one\-to\-many distribution of data from a single \fIpublisher\fR to multiple \fIsubscribers\fR in a fan out fashion\&. .sp The publish\-subscribe pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:29\fR\m[]\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_PUB\fR .RS 4 .sp A socket of type \fIZMQ_PUB\fR is used by a \fIpublisher\fR to distribute data\&. Messages sent are distributed in a fan out fashion to all connected peers\&. The \fBzmq_recv\fR(3) function is not implemented for this socket type\&. .sp When a \fIZMQ_PUB\fR socket enters the \fImute\fR state due to having reached the high water mark for a \fIsubscriber\fR, then any messages that would be sent to the \fIsubscriber\fR in question shall instead be dropped until the mute state ends\&. The \fIzmq_send()\fR function shall never block for this socket type\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&5.\ \&Summary of ZMQ_PUB characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_SUB\fR, \fIZMQ_XSUB\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Send only T} T{ .sp Incoming routing strategy T}:T{ .sp N/A T} T{ .sp Outgoing routing strategy T}:T{ .sp Fan out T} T{ .sp Action in mute state T}:T{ .sp Drop T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_SUB\fR .RS 4 .sp A socket of type \fIZMQ_SUB\fR is used by a \fIsubscriber\fR to subscribe to data distributed by a \fIpublisher\fR\&. Initially a \fIZMQ_SUB\fR socket is not subscribed to any messages, use the \fIZMQ_SUBSCRIBE\fR option of \fBzmq_setsockopt\fR(3) to specify which messages to subscribe to\&. The \fIzmq_send()\fR function is not implemented for this socket type\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&6.\ \&Summary of ZMQ_SUB characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_PUB\fR, \fIZMQ_XPUB\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Receive only T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Outgoing routing strategy T}:T{ .sp N/A T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_XPUB\fR .RS 4 .sp Same as ZMQ_PUB except that you can receive subscriptions from the peers in form of incoming messages\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&. Messages without a sub/unsub prefix are also received, but have no effect on subscription status\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&7.\ \&Summary of ZMQ_XPUB characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_SUB\fR, \fIZMQ_XSUB\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Send messages, receive subscriptions T} T{ .sp Incoming routing strategy T}:T{ .sp N/A T} T{ .sp Outgoing routing strategy T}:T{ .sp Fan out T} T{ .sp Action in mute state T}:T{ .sp Drop T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_XSUB\fR .RS 4 .sp Same as ZMQ_SUB except that you subscribe by sending subscription messages to the socket\&. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body\&. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&8.\ \&Summary of ZMQ_XSUB characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_PUB\fR, \fIZMQ_XPUB\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Receive messages, send subscriptions T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Outgoing routing strategy T}:T{ .sp N/A T} T{ .sp Action in mute state T}:T{ .sp Drop T} .TE .sp 1 .RE .SS "Pipeline pattern" .sp The pipeline pattern is used for distributing data to \fInodes\fR arranged in a pipeline\&. Data always flows down the pipeline, and each stage of the pipeline is connected to at least one \fInode\fR\&. When a pipeline stage is connected to multiple \fInodes\fR data is round\-robined among all connected \fInodes\fR\&. .sp The pipeline pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:30\fR\m[]\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_PUSH\fR .RS 4 .sp A socket of type \fIZMQ_PUSH\fR is used by a pipeline \fInode\fR to send messages to downstream pipeline \fInodes\fR\&. Messages are round\-robined to all connected downstream \fInodes\fR\&. The \fIzmq_recv()\fR function is not implemented for this socket type\&. .sp When a \fIZMQ_PUSH\fR socket enters the \fImute\fR state due to having reached the high water mark for all downstream \fInodes\fR, or if there are no downstream \fInodes\fR at all, then any \fBzmq_send\fR(3) operations on the socket shall block until the mute state ends or at least one downstream \fInode\fR becomes available for sending; messages are not discarded\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&9.\ \&Summary of ZMQ_PUSH characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_PULL\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Send only T} T{ .sp Incoming routing strategy T}:T{ .sp N/A T} T{ .sp Outgoing routing strategy T}:T{ .sp Round\-robin T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_PULL\fR .RS 4 .sp A socket of type \fIZMQ_PULL\fR is used by a pipeline \fInode\fR to receive messages from upstream pipeline \fInodes\fR\&. Messages are fair\-queued from among all connected upstream \fInodes\fR\&. The \fIzmq_send()\fR function is not implemented for this socket type\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&10.\ \&Summary of ZMQ_PULL characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_PUSH\fR T} T{ .sp Direction T}:T{ .sp Unidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Receive only T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Outgoing routing strategy T}:T{ .sp N/A T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .SS "Exclusive pair pattern" .sp The exclusive pair pattern is used to connect a peer to precisely one other peer\&. This pattern is used for inter\-thread communication across the inproc transport\&. .sp The exclusive pair pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:31\fR\m[]\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_PAIR\fR .RS 4 .sp A socket of type \fIZMQ_PAIR\fR can only be connected to a single peer at any one time\&. No message routing or filtering is performed on messages sent over a \fIZMQ_PAIR\fR socket\&. .sp When a \fIZMQ_PAIR\fR socket enters the \fImute\fR state due to having reached the high water mark for the connected peer, or if no peer is connected, then any \fBzmq_send\fR(3) operations on the socket shall block until the peer becomes available for sending; messages are not discarded\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp \fIZMQ_PAIR\fR sockets are designed for inter\-thread communication across the \fBzmq_inproc\fR(7) transport and do not implement functionality such as auto\-reconnection\&. .sp .5v .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&11.\ \&Summary of ZMQ_PAIR characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_PAIR\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Incoming routing strategy T}:T{ .sp N/A T} T{ .sp Outgoing routing strategy T}:T{ .sp N/A T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .SS "Native Pattern" .sp The native pattern is used for communicating with TCP peers and allows asynchronous requests and replies in either direction\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_STREAM\fR .RS 4 .sp A socket of type \fIZMQ_STREAM\fR is used to send and receive TCP data from a non\-0MQ peer, when using the tcp:// transport\&. A \fIZMQ_STREAM\fR socket can act as client and/or server, sending and/or receiving TCP data asynchronously\&. .sp When receiving TCP data, a \fIZMQ_STREAM\fR socket shall prepend a message part containing the \fIrouting id\fR of the originating peer to the message before passing it to the application\&. Messages received are fair\-queued from among all connected peers\&. .sp When sending TCP data, a \fIZMQ_STREAM\fR socket shall remove the first part of the message and use it to determine the \fIrouting id\fR of the peer the message shall be routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error\&. .sp To open a connection to a server, use the zmq_connect call, and then fetch the socket routing id using the zmq_getsockopt call with the ZMQ_ROUTING_ID option\&. .sp To close a specific connection, send the routing id frame followed by a zero\-length message (see EXAMPLE section)\&. .sp When a connection is made, a zero\-length message will be received by the application\&. Similarly, when the peer disconnects (or the connection is lost), a zero\-length message will be received by the application\&. .sp You must send one routing id frame followed by one data frame\&. The ZMQ_SNDMORE flag is required for routing id frames but is ignored on data frames\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&12.\ \&Summary of ZMQ_STREAM characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp none\&. T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Outgoing routing strategy T}:T{ .sp See text T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Action in mute state T}:T{ .sp EAGAIN T} .TE .sp 1 .RE .SS "Request\-reply pattern" .sp The request\-reply pattern is used for sending requests from a ZMQ_REQ \fIclient\fR to one or more ZMQ_REP \fIservices\fR, and receiving subsequent replies to each request sent\&. .sp The request\-reply pattern is formally defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:28\fR\m[]\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_REQ\fR .RS 4 .sp A socket of type \fIZMQ_REQ\fR is used by a \fIclient\fR to send requests to and receive replies from a \fIservice\fR\&. This socket type allows only an alternating sequence of \fIzmq_send(request)\fR and subsequent \fIzmq_recv(reply)\fR calls\&. Each request sent is round\-robined among all \fIservices\fR, and each reply received is matched with the last issued request\&. .sp If no services are available, then any send operation on the socket shall block until at least one \fIservice\fR becomes available\&. The REQ socket shall not discard messages\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&13.\ \&Summary of ZMQ_REQ characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_REP\fR, \fIZMQ_ROUTER\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Send, Receive, Send, Receive, \&... T} T{ .sp Outgoing routing strategy T}:T{ .sp Round\-robin T} T{ .sp Incoming routing strategy T}:T{ .sp Last peer T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_REP\fR .RS 4 .sp A socket of type \fIZMQ_REP\fR is used by a \fIservice\fR to receive requests from and send replies to a \fIclient\fR\&. This socket type allows only an alternating sequence of \fIzmq_recv(request)\fR and subsequent \fIzmq_send(reply)\fR calls\&. Each request received is fair\-queued from among all \fIclients\fR, and each reply sent is routed to the \fIclient\fR that issued the last request\&. If the original requester does not exist any more the reply is silently discarded\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&14.\ \&Summary of ZMQ_REP characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_REQ\fR, \fIZMQ_DEALER\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Receive, Send, Receive, Send, \&... T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Outgoing routing strategy T}:T{ .sp Last peer T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_DEALER\fR .RS 4 .sp A socket of type \fIZMQ_DEALER\fR is an advanced pattern used for extending request/reply sockets\&. Each message sent is round\-robined among all connected peers, and each message received is fair\-queued from all connected peers\&. .sp When a \fIZMQ_DEALER\fR socket enters the \fImute\fR state due to having reached the high water mark for all peers, or if there are no peers at all, then any \fBzmq_send\fR(3) operations on the socket shall block until the mute state ends or at least one peer becomes available for sending; messages are not discarded\&. .sp When a \fIZMQ_DEALER\fR socket is connected to a \fIZMQ_REP\fR socket each message sent must consist of an empty message part, the \fIdelimiter\fR, followed by one or more \fIbody parts\fR\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&15.\ \&Summary of ZMQ_DEALER characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_ROUTER\fR, \fIZMQ_REP\fR, \fIZMQ_DEALER\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Outgoing routing strategy T}:T{ .sp Round\-robin T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Action in mute state T}:T{ .sp Block T} .TE .sp 1 .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBZMQ_ROUTER\fR .RS 4 .sp A socket of type \fIZMQ_ROUTER\fR is an advanced socket type used for extending request/reply sockets\&. When receiving messages a \fIZMQ_ROUTER\fR socket shall prepend a message part containing the \fIrouting id\fR of the originating peer to the message before passing it to the application\&. Messages received are fair\-queued from among all connected peers\&. When sending messages a \fIZMQ_ROUTER\fR socket shall remove the first part of the message and use it to determine the _routing id _ of the peer the message shall be routed to\&. If the peer does not exist anymore, or has never existed, the message shall be silently discarded\&. However, if \fIZMQ_ROUTER_MANDATORY\fR socket option is set to \fI1\fR, the socket shall fail with EHOSTUNREACH in both cases\&. .sp When a \fIZMQ_ROUTER\fR socket enters the \fImute\fR state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends\&. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped\&. If, \fIZMQ_ROUTER_MANDATORY\fR is set to \fI1\fR, the socket shall block or return EAGAIN in both cases\&. .sp When a \fIZMQ_ROUTER\fR socket has \fIZMQ_ROUTER_MANDATORY\fR flag set to \fI1\fR, the socket shall generate \fIZMQ_POLLIN\fR events upon reception of messages from one or more peers\&. Likewise, the socket shall generate \fIZMQ_POLLOUT\fR events when at least one message can be sent to one or more peers\&. .sp When a \fIZMQ_REQ\fR socket is connected to a \fIZMQ_ROUTER\fR socket, in addition to the \fIrouting id\fR of the originating peer each message received shall contain an empty \fIdelimiter\fR message part\&. Hence, the entire structure of each received message as seen by the application becomes: one or more \fIrouting id\fR parts, \fIdelimiter\fR part, one or more \fIbody parts\fR\&. When sending replies to a \fIZMQ_REQ\fR socket the application must include the \fIdelimiter\fR part\&. .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .B Table\ \&16.\ \&Summary of ZMQ_ROUTER characteristics .TS tab(:); lt lt lt lt lt lt lt lt lt lt lt lt. T{ .sp Compatible peer sockets T}:T{ .sp \fIZMQ_DEALER\fR, \fIZMQ_REQ\fR, \fIZMQ_ROUTER\fR T} T{ .sp Direction T}:T{ .sp Bidirectional T} T{ .sp Send/receive pattern T}:T{ .sp Unrestricted T} T{ .sp Outgoing routing strategy T}:T{ .sp See text T} T{ .sp Incoming routing strategy T}:T{ .sp Fair\-queued T} T{ .sp Action in mute state T}:T{ .sp Drop (see text) T} .TE .sp 1 .RE .SH "RETURN VALUE" .sp The \fIzmq_socket()\fR function shall return an opaque handle to the newly created socket if successful\&. Otherwise, it shall return NULL and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested socket \fItype\fR is invalid\&. .RE .PP \fBEFAULT\fR .RS 4 The provided \fIcontext\fR is invalid\&. .RE .PP \fBEMFILE\fR .RS 4 The limit on the total number of open 0MQ sockets has been reached\&. .RE .PP \fBETERM\fR .RS 4 The context specified was terminated\&. .RE .SH "EXAMPLE" .PP \fBCreating a simple HTTP server using ZMQ_STREAM\fR. .sp .if n \{\ .RS 4 .\} .nf void *ctx = zmq_ctx_new (); assert (ctx); /* Create ZMQ_STREAM socket */ void *socket = zmq_socket (ctx, ZMQ_STREAM); assert (socket); int rc = zmq_bind (socket, "tcp://*:8080"); assert (rc == 0); /* Data structure to hold the ZMQ_STREAM routing id */ uint8_t routing_id [256]; size_t routing_id_size = 256; /* Data structure to hold the ZMQ_STREAM received data */ uint8_t raw [256]; size_t raw_size = 256; while (1) { /* Get HTTP request; routing id frame and then request */ routing_id_size = zmq_recv (socket, routing_id, 256, 0); assert (routing_id_size > 0); do { raw_size = zmq_recv (socket, raw, 256, 0); assert (raw_size >= 0); } while (raw_size == 256); /* Prepares the response */ char http_response [] = "HTTP/1\&.0 200 OK\er\en" "Content\-Type: text/plain\er\en" "\er\en" "Hello, World!"; /* Sends the routing id frame followed by the response */ zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, http_response, strlen (http_response), 0); /* Closes the connection by sending the routing id frame followed by a zero response */ zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, 0, 0, 0); } zmq_close (socket); zmq_ctx_destroy (ctx); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_init\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_send\fR(3) \fBzmq_recv\fR(3) \fBzmq_inproc\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_copy.30000664000372000037200000000646213255253354017320 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_copy .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_COPY" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_copy \- copy content of a message to another message .SH "SYNOPSIS" .sp \fBint zmq_msg_copy (zmq_msg_t \fR\fB\fI*dest\fR\fR\fB, zmq_msg_t \fR\fB\fI*src\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_copy()\fR function shall copy the message object referenced by \fIsrc\fR to the message object referenced by \fIdest\fR\&. The original content of \fIdest\fR, if any, shall be released\&. You must initialise \fIdest\fR before copying to it\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The implementation may choose not to physically copy the message content, rather to share the underlying buffer between \fIsrc\fR and \fIdest\fR\&. Avoid modifying message content after a message has been copied with \fIzmq_msg_copy()\fR, doing so can result in undefined behaviour\&. If what you need is an actual hard copy, allocate a new message using \fIzmq_msg_init_size()\fR and copy the message content using \fImemcpy()\fR\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_copy()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEFAULT\fR .RS 4 Invalid message\&. .RE .SH "EXAMPLE" .PP \fBCopying a message\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_msg_t msg; zmq_msg_init_size (&msg, 255); memcpy (zmq_msg_data (&msg, "Hello, World", 12); zmq_msg_t copy; zmq_msg_init (©); zmq_msg_copy (©, &msg); \&.\&.\&. zmq_msg_close (©); zmq_msg_close (&msg); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_move\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_has.30000664000372000037200000000564713255253373016260 0ustar00travistravis00000000000000'\" t .\" Title: zmq_has .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_HAS" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_has \- check a ZMQ capability .SH "SYNOPSIS" .sp \fBint zmq_has (const char *capability);\fR .SH "DESCRIPTION" .sp The \fIzmq_has()\fR function shall report whether a specified capability is available in the library\&. This allows bindings and applications to probe a library directly, for transport and security options\&. .sp Capabilities shall be lowercase strings\&. The following capabilities are defined: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} ipc \- the library supports the ipc:// protocol .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} pgm \- the library supports the pgm:// protocol .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} tipc \- the library supports the tipc:// protocol .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} norm \- the library supports the norm:// protocol .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} curve \- the library supports the CURVE security mechanism .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} gssapi \- the library supports the GSSAPI security mechanism .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} draft \- the library is built with the draft api .RE .sp When this method is provided, the zmq\&.h header file will define ZMQ_HAS_CAPABILITIES\&. .SH "RETURN VALUE" .sp The \fIzmq_has()\fR function shall return 1 if the specified capability is provided\&. Otherwise it shall return 0\&. .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_recv.txt0000664000372000037200000000542713255253220017104 0ustar00travistravis00000000000000zmq_recv(3) =========== NAME ---- zmq_recv - receive a message part from a socket SYNOPSIS -------- *int zmq_recv (void '*socket', void '*buf', size_t 'len', int 'flags');* DESCRIPTION ----------- The _zmq_recv()_ function shall receive a message from the socket referenced by the 'socket' argument and store it in the buffer referenced by the 'buf' argument. Any bytes exceeding the length specified by the 'len' argument shall be truncated. If there are no messages available on the specified 'socket' the _zmq_recv()_ function shall block until the request can be satisfied. The 'flags' argument is a combination of the flags defined below: The 'buf' argument may be null if len is zero. *ZMQ_DONTWAIT*:: Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified 'socket', the _zmq_recv()_ function shall fail with 'errno' set to EAGAIN. Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that processes multi-part messages must use the _ZMQ_RCVMORE_ linkzmq:zmq_getsockopt[3] option after calling _zmq_recv()_ to determine if there are further parts to receive. RETURN VALUE ------------ The _zmq_recv()_ function shall return number of bytes in the message if successful. Note that the value can exceed the value of the 'len' parameter in case the message was truncated. If not successful the function shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and no messages are available at the moment. *ENOTSUP*:: The _zmq_recv()_ operation is not supported by this socket type. *EFSM*:: The _zmq_recv()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before a message was available. EXAMPLE ------- .Receiving a message from a socket ---- char buf [256]; nbytes = zmq_recv (socket, buf, 256, 0); assert (nbytes != -1); ---- SEE ALSO -------- linkzmq:zmq_send[3] linkzmq:zmq_getsockopt[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_size.html0000664000372000037200000004422213255253330020110 0ustar00travistravis00000000000000 zmq_msg_size(3)

SYNOPSIS

size_t zmq_msg_size (zmq_msg_t *msg);

DESCRIPTION

The zmq_msg_size() function shall return the size in bytes of the content of the message object referenced by msg.

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.

RETURN VALUE

Upon successful completion, zmq_msg_size() shall return the size of the message content in bytes.

ERRORS

No errors are defined.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_z85_decode.txt0000664000372000037200000000204213255253220020064 0ustar00travistravis00000000000000zmq_z85_decode(3) ================= NAME ---- zmq_z85_decode - decode a binary key from Z85 printable text SYNOPSIS -------- *uint8_t *zmq_z85_decode (uint8_t *dest, const char *string);* DESCRIPTION ----------- The _zmq_z85_decode()_ function shall decode 'string' into 'dest'. The length of 'string' shall be divisible by 5. 'dest' must be large enough for the decoded value (0.8 x strlen (string)). The encoding shall follow the ZMQ RFC 32 specification. RETURN VALUE ------------ The _zmq_z85_decode()_ function shall return 'dest' if successful, else it shall return NULL. EXAMPLE ------- .Decoding a CURVE key ---- const char decoded [] = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7"; uint8_t public_key [32]; zmq_z85_decode (public_key, decoded); ---- SEE ALSO -------- linkzmq:zmq_z85_decode[3] linkzmq:zmq_curve_keypair[3] linkzmq:zmq_curve_public[3] linkzmq:zmq_curve[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_init_size.30000664000372000037200000000571313255253353020340 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_init_size .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_INIT_SIZE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_init_size \- initialise 0MQ message of a specified size .SH "SYNOPSIS" .sp \fBint zmq_msg_init_size (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, size_t \fR\fB\fIsize\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_init_size()\fR function shall allocate any resources required to store a message \fIsize\fR bytes long and initialise the message object referenced by \fImsg\fR to represent the newly allocated message\&. .sp The implementation shall choose whether to store message content on the stack (small messages) or on the heap (large messages)\&. For performance reasons \fIzmq_msg_init_size()\fR shall not clear the message data\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The functions \fIzmq_msg_init()\fR, \fIzmq_msg_init_data()\fR and \fIzmq_msg_init_size()\fR are mutually exclusive\&. Never initialise the same \fIzmq_msg_t\fR twice\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_init_size()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBENOMEM\fR .RS 4 Insufficient storage space is available\&. .RE .SH "SEE ALSO" .sp \fBzmq_msg_init_data\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_atomic_counter_destroy.30000664000372000037200000000553013255253376022263 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_destroy .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_D" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_destroy \- destroy an atomic counter .SH "SYNOPSIS" .sp \fBvoid zmq_atomic_counter_destroy (void **counter_p);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_destroy\fR function destroys an atomic counter and nullifies its reference\&. Pass the address of an atomic counter (void **) rather than the counter itself\&. You must destroy all counters that you create, to avoid memory leakage\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_destroy()\fR function has no return value\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_new\fR(3) \fBzmq_atomic_counter_set\fR(3) \fBzmq_atomic_counter_inc\fR(3) \fBzmq_atomic_counter_dec\fR(3) \fBzmq_atomic_counter_value\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_plain.txt0000664000372000037200000000162213255253220017241 0ustar00travistravis00000000000000zmq_plain(7) ============ NAME ---- zmq_plain - clear-text authentication SYNOPSIS -------- The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality. It is intended for use on internal networks where security requirements are low. The PLAIN mechanism is defined by this document: . USAGE ----- To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket options. Which peer binds, and which connects, is not relevant. SEE ALSO -------- linkzmq:zmq_setsockopt[3] linkzmq:zmq_null[7] linkzmq:zmq_curve[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_errno.html0000664000372000037200000004447713255253335017436 0ustar00travistravis00000000000000 zmq_errno(3)

SYNOPSIS

int zmq_errno (void);

DESCRIPTION

The zmq_errno() function shall retrieve the value of the errno variable for the calling thread.

The zmq_errno() function is provided to assist users on non-POSIX systems who are experiencing issues with retrieving the correct value of errno directly. Specifically, users on Win32 systems whose application is using a different C run-time library from the C run-time library in use by ØMQ will need to use zmq_errno() for correct operation.

Important
Users not experiencing issues with retrieving the correct value of errno should not use this function and should instead access the errno variable directly.

RETURN VALUE

The zmq_errno() function shall return the value of the errno variable for the calling thread.

ERRORS

No errors are defined.

SEE ALSO

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_tcp.70000664000372000037200000001317013255253377016271 0ustar00travistravis00000000000000'\" t .\" Title: zmq_tcp .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_TCP" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_tcp \- 0MQ unicast transport using TCP .SH "SYNOPSIS" .sp TCP is an ubiquitous, reliable, unicast transport\&. When connecting distributed applications over a network with 0MQ, using the TCP transport will likely be your first choice\&. .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the TCP transport, the transport is tcp, and the meaning of the \fIaddress\fR part is defined below\&. .SS "Assigning a local address to a socket" .sp When assigning a local address to a socket using \fIzmq_bind()\fR with the \fItcp\fR transport, the \fIendpoint\fR shall be interpreted as an \fIinterface\fR followed by a colon and the TCP port number to use\&. .sp An \fIinterface\fR may be specified by either of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The wild\-card *, meaning all available interfaces\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The primary IPv4 or IPv6 address assigned to the interface, in its numeric representation\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The non\-portable interface name as defined by the operating system\&. .RE .sp The TCP port number may be specified by: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A numeric value, usually above 1024 on POSIX systems\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The wild\-card *, meaning a system\-assigned ephemeral port\&. .RE .sp When using ephemeral ports, the caller should retrieve the actual assigned port using the ZMQ_LAST_ENDPOINT socket option\&. See \fBzmq_getsockopt\fR(3) for details\&. .SS "Unbinding wild\-card address from a socket" .sp When wild\-card * \fIendpoint\fR was used in \fIzmq_bind()\fR, the caller should use real \fIendpoint\fR obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this \fIendpoint\fR from a socket using \fIzmq_unbind()\fR\&. .SS "Connecting a socket" .sp When connecting a socket to a peer address using \fIzmq_connect()\fR with the \fItcp\fR transport, the \fIendpoint\fR shall be interpreted as a \fIpeer address\fR followed by a colon and the TCP port number to use\&. You can optionally specify a \fIsource_endpoint\fR which will be used as the source address for your connection; tcp://\fIsource_endpoint\fR;\*(Aqendpoint\*(Aq, see the \fIinterface\fR description above for details\&. .sp A \fIpeer address\fR may be specified by either of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The DNS name of the peer\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The IPv4 or IPv6 address of the peer, in its numeric representation\&. .RE .sp Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is used by the TCP transport can be found at \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:15\fR\m[] .SH "EXAMPLES" .PP \fBAssigning a local address to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // TCP port 5555 on all available interfaces rc = zmq_bind(socket, "tcp://*:5555"); assert (rc == 0); // TCP port 5555 on the local loop\-back interface on all platforms rc = zmq_bind(socket, "tcp://127\&.0\&.0\&.1:5555"); assert (rc == 0); // TCP port 5555 on the first Ethernet network interface on Linux rc = zmq_bind(socket, "tcp://eth0:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connecting using an IP address rc = zmq_connect(socket, "tcp://192\&.168\&.1\&.1:5555"); assert (rc == 0); // Connecting using a DNS name rc = zmq_connect(socket, "tcp://server1:5555"); assert (rc == 0); // Connecting using a DNS name and bind to eth1 rc = zmq_connect(socket, "tcp://eth1:0;server1:5555"); assert (rc == 0); // Connecting using a IP address and bind to an IP address rc = zmq_connect(socket, "tcp://192\&.168\&.1\&.17:5555;192\&.168\&.1\&.1:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_pgm\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq_vmci\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_atomic_counter_value.html0000664000372000037200000004552313255253343022510 0ustar00travistravis00000000000000 zmq_atomic_counter_value(3)

SYNOPSIS

int zmq_atomic_counter_value (void *counter);

DESCRIPTION

The zmq_atomic_counter_value function returns the value of an atomic counter created by zmq_atomic_counter_new(). This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_value() function returns the value of the atomic counter. If counter does not point to an atomic counter created by zmq_atomic_counter_new(), the behaviour is undefined.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_ctx_new.html0000664000372000037200000004423113255253326017744 0ustar00travistravis00000000000000 zmq_ctx_new(3)

SYNOPSIS

void *zmq_ctx_new ();

DESCRIPTION

The zmq_ctx_new() function creates a new ØMQ context.

This function replaces the deprecated function zmq_init(3).

Thread safety

A ØMQ context is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller.

RETURN VALUE

The zmq_ctx_new() function shall return an opaque handle to the newly created context if successful. Otherwise it shall return NULL and set errno to one of the values defined below.

ERRORS

No error values are defined for this function.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_set_routing_id.30000664000372000037200000000443313255253360021355 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_set_routing_id .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_SET_ROUTING_" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_set_routing_id \- set routing ID property on message .SH "SYNOPSIS" .sp \fBint zmq_msg_set_routing_id (zmq_msg_t \fR\fB\fI*message\fR\fR\fB, uint32_t \fR\fB\fIrouting_id\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_set_routing_id()\fR function sets the \fIrouting_id\fR specified, on the the message pointed to by the \fImessage\fR argument\&. The \fIrouting_id\fR must be greater than zero\&. To get a valid routing ID, you must receive a message from a \fIZMQ_SERVER\fR socket, and use the libzmq:zmq_msg_routing_id method\&. Routing IDs are transient\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_set_routing_id()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The provided \fIrouting_id\fR is zero\&. .RE .SH "SEE ALSO" .sp \fBzmq_msg_routing_id\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_getsockopt.txt0000664000372000037200000010525513255253220020327 0ustar00travistravis00000000000000zmq_getsockopt(3) ================= NAME ---- zmq_getsockopt - get 0MQ socket options SYNOPSIS -------- *int zmq_getsockopt (void '*socket', int 'option_name', void '*option_value', size_t '*option_len');* DESCRIPTION ----------- The _zmq_getsockopt()_ function shall retrieve the value for the option specified by the 'option_name' argument for the 0MQ socket pointed to by the 'socket' argument, and store it in the buffer pointed to by the 'option_value' argument. The 'option_len' argument is the size in bytes of the buffer pointed to by 'option_value'; upon successful completion _zmq_getsockopt()_ shall modify the 'option_len' argument to indicate the actual size of the option value stored in the buffer. The following options can be retrieved with the _zmq_getsockopt()_ function: ZMQ_AFFINITY: Retrieve I/O thread affinity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_AFFINITY' option shall retrieve the I/O thread affinity for newly created connections on the specified 'socket'. Affinity determines which threads from the 0MQ I/O thread pool associated with the socket's _context_ shall handle newly created connections. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all 0MQ I/O threads in the thread pool. For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on. For example, a value of 3 specifies that subsequent connections on 'socket' shall be handled exclusively by I/O threads 1 and 2. See also linkzmq:zmq_init[3] for details on allocating the number of I/O threads for a specific _context_. [horizontal] Option value type:: uint64_t Option value unit:: N/A (bitmap) Default value:: 0 Applicable socket types:: N/A ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_BACKLOG' option shall retrieve the maximum length of the queue of outstanding peer connections for the specified 'socket'; this only applies to connection-oriented transports. For details refer to your operating system documentation for the 'listen' function. [horizontal] Option value type:: int Option value unit:: connections Default value:: 100 Applicable socket types:: all, only for connection-oriented transports ZMQ_BINDTODEVICE: Retrieve name of device the socket is bound to ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_BINDTODEVICE' option retrieves the name of the device this socket is bound to, eg. an interface or VRF. If a socket is bound to an interface, only packets received from that interface are processed by the socket. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table. NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP or UDP transports. ZMQ_CONNECT_TIMEOUT: Retrieve connect() timeout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieves how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (disabled) Applicable socket types:: all, when using TCP transports. ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieves the current long term public key for the socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: null Applicable socket types:: all, when using TCP transport ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieves the current long term secret key for the socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: null Applicable socket types:: all, when using TCP transport ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieves the current server key for the client socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41-byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: null Applicable socket types:: all, when using TCP transport ZMQ_EVENTS: Retrieve socket event state ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_EVENTS' option shall retrieve the event state for the specified 'socket'. The returned value is a bit mask constructed by OR'ing a combination of the following event flags: *ZMQ_POLLIN*:: Indicates that at least one message may be received from the specified socket without blocking. *ZMQ_POLLOUT*:: Indicates that at least one message may be sent to the specified socket without blocking. The combination of a file descriptor returned by the 'ZMQ_FD' option being ready for reading but no actual events returned by a subsequent retrieval of the 'ZMQ_EVENTS' option is valid; applications should simply ignore this case and restart their polling operation/event loop. [horizontal] Option value type:: int Option value unit:: N/A (flags) Default value:: N/A Applicable socket types:: all ZMQ_FD: Retrieve file descriptor associated with the socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_FD' option shall retrieve the file descriptor associated with the specified 'socket'. The returned file descriptor can be used to integrate the socket into an existing event loop; the 0MQ library shall signal any pending events on the socket in an _edge-triggered_ fashion by making the file descriptor become ready for reading. NOTE: The ability to read from the returned file descriptor does not necessarily indicate that messages are available to be read from, or can be written to, the underlying socket; applications must retrieve the actual event state with a subsequent retrieval of the 'ZMQ_EVENTS' option. NOTE: The returned file descriptor is also used internally by the 'zmq_send' and 'zmq_recv' functions. As the descriptor is edge triggered, applications must update the state of 'ZMQ_EVENTS' after each invocation of 'zmq_send' or 'zmq_recv'.To be more explicit: after calling 'zmq_send' the socket may become readable (and vice versa) without triggering a read event on the file descriptor. CAUTION: The returned file descriptor is intended for use with a 'poll' or similar system call only. Applications must never attempt to read or write data to it directly, neither should they try to close it. [horizontal] Option value type:: int on POSIX systems, SOCKET on Windows Option value unit:: N/A Default value:: N/A Applicable socket types:: all ZMQ_GSSAPI_PLAINTEXT: Retrieve GSSAPI plaintext or encrypted status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the 'ZMQ_GSSAPI_PLAINTEXT' option, if any, previously set on the socket. A value of '1' means that communications will be plaintext. A value of '0' means communications will be encrypted. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 (false) Applicable socket types:: all, when using TCP or IPC transports ZMQ_GSSAPI_PRINCIPAL: Retrieve the name of the GSSAPI principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_GSSAPI_PRINCIPAL' option shall retrieve the principal name set for the GSSAPI security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: null string Applicable socket types:: all, when using TCP or IPC transports ZMQ_GSSAPI_SERVER: Retrieve current GSSAPI server role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the 'ZMQ_GSSAPI_SERVER' option, if any, previously set on the socket. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 (false) Applicable socket types:: all, when using TCP or IPC transports ZMQ_GSSAPI_SERVICE_PRINCIPAL: Retrieve the name of the GSSAPI service principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_GSSAPI_SERVICE_PRINCIPAL' option shall retrieve the principal name of the GSSAPI server to which a GSSAPI client socket intends to connect. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: null string Applicable socket types:: all, when using TCP or IPC transports ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the 'ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE' option, if any, previously set on the socket. A value of 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with 'ZMQ_GSSAPI_SERVICE_PRINCIPAL' is interpreted as a host based name. A value of 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism). NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: int Option value unit:: 0, 1, 2 Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED) Applicable socket types:: all, when using TCP or IPC transports ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the 'ZMQ_GSSAPI_PRINCIPAL_NAMETYPE' option, if any, previously set on the socket. A value of 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with 'ZMQ_GSSAPI_PRINCIPAL' is interpreted as a host based name. A value of 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism). NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: int Option value unit:: 0, 1, 2 Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED) Applicable socket types:: all, when using TCP or IPC transports ZMQ_HANDSHAKE_IVL: Retrieve maximum handshake interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_HANDSHAKE_IVL' option shall retrieve the maximum handshake interval for the specified 'socket'. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection-oriented transports. If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 30000 Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports ZMQ_IDENTITY: Retrieve socket identity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This option name is now deprecated. Use ZMQ_ROUTING_ID instead. ZMQ_IDENTITY remains as an alias for now. ZMQ_IMMEDIATE: Retrieve attach-on-connect value ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the state of the attach on connect value. If set to `1`, will delay the attachment of a pipe on connect until the underlying connection has completed. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 0 (false) Applicable socket types:: all, primarily when using TCP/IPC transports. ZMQ_INVERT_MATCHING: Retrieve inverted filtering status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the value of the 'ZMQ_INVERT_MATCHING' option. A value of `1` means the socket uses inverted prefix matching. On 'PUB' and 'XPUB' sockets, this causes messages to be sent to all connected sockets 'except' those subscribed to a prefix that matches the message. On 'SUB' sockets, this causes only incoming messages that do 'not' match any of the socket's subscriptions to be received by the user. Whenever 'ZMQ_INVERT_MATCHING' is set to 1 on a 'PUB' socket, all 'SUB' sockets connecting to it must also have the option set to 1. Failure to do so will have the 'SUB' sockets reject everything the 'PUB' socket sends them. 'XSUB' sockets do not need to do this because they do not filter incoming messages. [horizontal] Option value type:: int Option value unit:: 0,1 Default value:: 0 Applicable socket types:: ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the IPv4-only option for the socket. This option is deprecated. Please use the ZMQ_IPV6 option. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 1 (true) Applicable socket types:: all, when using TCP transports. ZMQ_IPV6: Retrieve IPv6 socket status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the IPv6 option for the socket. A value of `1` means IPv6 is enabled on the socket, while `0` means the socket will use only IPv4. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 0 (false) Applicable socket types:: all, when using TCP transports. ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_LAST_ENDPOINT' option shall retrieve the last endpoint bound for TCP and IPC transports. The returned value will be a string in the form of a ZMQ DSN. Note that if the TCP host is INADDR_ANY, indicated by a *, then the returned address will be 0.0.0.0 (for IPv4). [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: NULL Applicable socket types:: all, when binding TCP or IPC transports ZMQ_LINGER: Retrieve linger period for socket shutdown ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_LINGER' option shall retrieve the linger period for the specified 'socket'. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with linkzmq:zmq_close[3], and further affects the termination of the socket's context with linkzmq:zmq_ctx_term[3]. The following outlines the different behaviours: * The default value of '-1' specifies an infinite linger period. Pending messages shall not be discarded after a call to _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_ shall block until all pending messages have been sent to a peer. * The value of '0' specifies no linger period. Pending messages shall be discarded immediately when the socket is closed with _zmq_close()_. * Positive values specify an upper bound for the linger period in milliseconds. Pending messages shall not be discarded after a call to _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_ shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The option shall retrieve limit for the inbound messages. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means 'no limit'. [horizontal] Option value type:: int64_t Option value unit:: bytes Default value:: -1 Applicable socket types:: all ZMQ_MECHANISM: Retrieve current security mechanism ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MECHANISM' option shall retrieve the current security mechanism for the socket. [horizontal] Option value type:: int Option value unit:: ZMQ_NULL, ZMQ_PLAIN, ZMQ_CURVE, or ZMQ_GSSAPI Default value:: ZMQ_NULL Applicable socket types:: all, when using TCP or IPC transports ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The option shall retrieve time-to-live used for outbound multicast packets. The default of 1 means that the multicast packets don't leave the local network. [horizontal] Option value type:: int Option value unit:: network hops Default value:: 1 Applicable socket types:: all, when using multicast transports ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MULTICAST_MAXTPDU' option shall retrieve the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required. [horizontal] Option value type:: int Option value unit:: bytes Default value:: 1500 Applicable socket types:: all, when using multicast transports ZMQ_PLAIN_PASSWORD: Retrieve current password ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_PLAIN_PASSWORD' option shall retrieve the last password set for the PLAIN security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: null string Applicable socket types:: all, when using TCP or IPC transports ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Returns the 'ZMQ_PLAIN_SERVER' option, if any, previously set on the socket. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: int Applicable socket types:: all, when using TCP or IPC transports ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_PLAIN_USERNAME' option shall retrieve the last username set for the PLAIN security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: null string Applicable socket types:: all, when using TCP or IPC transports ZMQ_USE_FD: Retrieve the pre-allocated socket file descriptor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_USE_FD' option shall retrieve the pre-allocated file descriptor that has been assigned to a ZMQ socket, if any. -1 shall be returned if a pre-allocated file descriptor was not set for the socket. [horizontal] Option value type:: int Option value unit:: file descriptor Default value:: -1 Applicable socket types:: all bound sockets, when using IPC or TCP transport ZMQ_RATE: Retrieve multicast data rate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RATE' option shall retrieve the maximum send or receive data rate for multicast transports using the specified 'socket'. [horizontal] Option value type:: int Option value unit:: kilobits per second Default value:: 100 Applicable socket types:: all, when using multicast transports ZMQ_RCVBUF: Retrieve kernel receive buffer size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RCVBUF' option shall retrieve the underlying kernel receive buffer size for the specified 'socket'. For details refer to your operating system documentation for the 'SO_RCVBUF' socket option. [horizontal] Option value type:: int Option value unit:: bytes Default value:: 8192 Applicable socket types:: all ZMQ_RCVHWM: Retrieve high water mark for inbound messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RCVHWM' option shall return the high water mark for inbound messages on the specified 'socket'. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified 'socket' is communicating with. A value of zero means no limit. If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in linkzmq:zmq_socket[3] for details on the exact action taken for each socket type. [horizontal] Option value type:: int Option value unit:: messages Default value:: 1000 Applicable socket types:: all ZMQ_RCVMORE: More message data parts to follow ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RCVMORE' option shall return True (1) if the message part last received from the 'socket' was a data part with more parts to follow. If there are no data parts to follow, this option shall return False (0). Refer to linkzmq:zmq_send[3] and linkzmq:zmq_recv[3] for a detailed description of multi-part messages. [horizontal] Option value type:: int Option value unit:: boolean Default value:: N/A Applicable socket types:: all ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the timeout for recv operation on the socket. If the value is `0`, _zmq_recv(3)_ will return immediately, with a EAGAIN error if there is no message to receive. If the value is `-1`, it will block until a message is available. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_RECONNECT_IVL: Retrieve reconnection interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECONNECT_IVL' option shall retrieve the initial reconnection interval for the specified 'socket'. The reconnection interval is the period 0MQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection. NOTE: The reconnection interval may be randomized by 0MQ to prevent reconnection storms in topologies with a large number of peers per socket. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 100 Applicable socket types:: all, only for connection-oriented transports ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECONNECT_IVL_MAX' option shall retrieve the maximum reconnection interval for the specified 'socket'. This is the maximum period 0MQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential backoff strategy. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL. NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (only use ZMQ_RECONNECT_IVL) Applicable socket types:: all, only for connection-oriented transport ZMQ_RECOVERY_IVL: Get multicast recovery interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECOVERY_IVL' option shall retrieve the recovery interval for multicast transports using the specified 'socket'. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 10000 Applicable socket types:: all, when using multicast transports ZMQ_ROUTING_ID: Retrieve socket routing id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ROUTING_ID' option shall retrieve the routing id of the specified 'socket'. Routing ids are used only by the request/reply pattern. Specifically, it can be used in tandem with ROUTER socket to route messages to the peer with a specific routing id. A routing id must be at least one byte and at most 255 bytes long. Identities starting with a zero byte are reserved for use by the 0MQ infrastructure. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: NULL Applicable socket types:: ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER. ZMQ_SNDBUF: Retrieve kernel transmit buffer size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SNDBUF' option shall retrieve the underlying kernel transmit buffer size for the specified 'socket'. For details refer to your operating system documentation for the 'SO_SNDBUF' socket option. [horizontal] Option value type:: int Option value unit:: bytes Default value:: 8192 Applicable socket types:: all ZMQ_SNDHWM: Retrieves high water mark for outbound messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SNDHWM' option shall return the high water mark for outbound messages on the specified 'socket'. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified 'socket' is communicating with. A value of zero means no limit. If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in linkzmq:zmq_socket[3] for details on the exact action taken for each socket type. [horizontal] Option value type:: int Option value unit:: messages Default value:: 1000 Applicable socket types:: all ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the timeout for send operation on the socket. If the value is `0`, _zmq_send(3)_ will return immediately, with a EAGAIN error if the message cannot be sent. If the value is `-1`, it will block until the message is sent. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_SOCKS_PROXY: Retrieve SOCKS5 proxy address ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SOCKS_PROXY' option shall retrieve the SOCKS5 proxy address in string format. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: NULL-terminated character string Option value unit:: N/A Default value:: null string Applicable socket types:: all, when using TCP transports ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'SO_KEEPALIVE' socket option(where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,0,1 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPCNT' socket option(where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPIDLE'(or 'TCP_KEEPALIVE' on some OS) socket option (where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPINTVL' socket option(where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_MAXRT: Retrieve Max TCP Retransmit Timeout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On OSes where it is supported, retrieves how long before an unacknowledged TCP retransmit times out. The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_THREAD_SAFE: Retrieve socket thread safety ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_SAFE' option shall retrieve a boolean value indicating whether or not the socket is threadsafe. Currently 'ZMQ_CLIENT' and 'ZMQ_SERVER' sockets are threadsafe. [horizontal] Option value type:: boolean Applicable socket types:: all ZMQ_TOS: Retrieve the Type-of-Service socket override status ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Retrieve the IP_TOS option for the socket. [horizontal] Option value type:: int Option value unit:: >0 Default value:: 0 Applicable socket types:: all, only for connection-oriented transports ZMQ_TYPE: Retrieve socket type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_TYPE' option shall retrieve the socket type for the specified 'socket'. The socket type is specified at socket creation time and cannot be modified afterwards. [horizontal] Option value type:: int Option value unit:: N/A Default value:: N/A Applicable socket types:: all ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ZAP_DOMAIN' option shall retrieve the last ZAP domain set for the socket. The returned value shall be a NULL-terminated string and MAY be empty. An empty string means that ZAP authentication is disabled. The returned size SHALL include the terminating null byte. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_ZAP_ENFORCE_DOMAIN: Retrieve ZAP domain handling mode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ZAP_ENFORCE_DOMAIN' option shall retrieve the flag that determines whether a ZAP domain is strictly required or not. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: all, when using ZAP ZMQ_VMCI_BUFFER_SIZE: Retrieve buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_SIZE` option shall retrieve the size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 65546 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_BUFFER_MIN_SIZE: Retrieve min buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_MIN_SIZE` option shall retrieve the min size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 128 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_BUFFER_MAX_SIZE: Retrieve max buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_MAX_SIZE` option shall retrieve the max size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 262144 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_CONNECT_TIMEOUT: Retrieve connection timeout of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_CONNECT_TIMEOUT` option shall retrieve connection timeout for the socket. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 Applicable socket types:: all, when using VMCI transport RETURN VALUE ------------ The _zmq_getsockopt()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested option _option_name_ is unknown, or the requested _option_len_ or _option_value_ is invalid, or the size of the buffer pointed to by _option_value_, as specified by _option_len_, is insufficient for storing the option value. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal. EXAMPLE ------- .Retrieving the high water mark for outgoing messages ---- /* Retrieve high water mark into sndhwm */ int sndhwm; size_t sndhwm_size = sizeof (sndhwm); rc = zmq_getsockopt (socket, ZMQ_SNDHWM, &sndhwm, &sndhwm_size); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_setsockopt[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_unbind.txt0000664000372000037200000000451113255253220017415 0ustar00travistravis00000000000000zmq_unbind(3) ============== NAME ---- zmq_unbind - Stop accepting connections on a socket SYNOPSIS -------- int zmq_unbind (void '*socket', const char '*endpoint'); DESCRIPTION ----------- The _zmq_unbind()_ function shall unbind a socket specified by the 'socket' argument from the endpoint specified by the 'endpoint' argument. The 'endpoint' argument is as described in linkzmq:zmq_bind[3] Unbinding wild-card address from a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When wild-card `*` 'endpoint' (described in linkzmq:zmq_tcp[7], linkzmq:zmq_ipc[7] and linkzmq:zmq_vmci[7]) was used in _zmq_bind()_, the caller should use real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this 'endpoint' from a socket. RETURN VALUE ------------ The _zmq_unbind()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The endpoint supplied is invalid. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *ENOENT*:: The endpoint supplied was not previously bound. EXAMPLES -------- .Unbind a subscriber socket from a TCP transport ---- /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_bind (socket, "tcp://127.0.0.1:5555"); assert (rc == 0); /* Disconnect from the previously connected endpoint */ rc = zmq_unbind (socket, "tcp://127.0.0.1:5555"); assert (rc == 0); ---- .Unbind wild-card `*` binded socket ---- /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Bind it to the system-assigned ephemeral port using a TCP transport */ rc = zmq_bind (socket, "tcp://127.0.0.1:*"); assert (rc == 0); /* Obtain real endpoint */ const size_t buf_size = 32; char buf[buf_size]; rc = zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, buf, (size_t *)&buf_size); assert (rc == 0); /* Unbind socket by real endpoint */ rc = zmq_unbind (socket, buf); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_z85_encode.txt0000664000372000037200000000242113255253220020077 0ustar00travistravis00000000000000zmq_z85_encode(3) ================= NAME ---- zmq_z85_encode - encode a binary key as Z85 printable text SYNOPSIS -------- *char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);* DESCRIPTION ----------- The _zmq_z85_encode()_ function shall encode the binary block specified by 'data' and 'size' into a string in 'dest'. The size of the binary block must be divisible by 4. The 'dest' must have sufficient space for size * 1.25 plus 1 for a null terminator. A 32-byte CURVE key is encoded as 40 ASCII characters plus a null terminator. The encoding shall follow the ZMQ RFC 32 specification. RETURN VALUE ------------ The _zmq_z85_encode()_ function shall return 'dest' if successful, else it shall return NULL. EXAMPLE ------- .Encoding a CURVE key ---- #include uint8_t public_key [32]; uint8_t secret_key [32]; int rc = crypto_box_keypair (public_key, secret_key); assert (rc == 0); char encoded [41]; zmq_z85_encode (encoded, public_key, 32); puts (encoded); ---- SEE ALSO -------- linkzmq:zmq_z85_decode[3] linkzmq:zmq_curve_keypair[3] linkzmq:zmq_curve_public[3] linkzmq:zmq_curve[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ipc.html0000664000372000037200000005410513255253344017051 0ustar00travistravis00000000000000 zmq_ipc(7)

SYNOPSIS

The inter-process transport passes messages between local processes using a system-dependent IPC mechanism.

Note
The inter-process transport is currently only implemented on operating systems that provide UNIX domain sockets.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the inter-process transport, the transport is ipc, and the meaning of the address part is defined below.

Binding a socket

When binding a socket to a local address using zmq_bind() with the ipc transport, the endpoint shall be interpreted as an arbitrary string identifying the pathname to create. The pathname must be unique within the operating system namespace used by the ipc implementation, and must fulfill any restrictions placed by the operating system on the format and length of a pathname.

When the address is wild-card *, zmq_bind() shall generate a unique temporary pathname. The caller should retrieve this pathname using the ZMQ_LAST_ENDPOINT socket option. See zmq_getsockopt(3) for details.

Note
any existing binding to the same endpoint shall be overridden. That is, if a second process binds to an endpoint already bound by a process, this will succeed and the first process will lose its binding. In this behaviour, the ipc transport is not consistent with the tcp or inproc transports.
Note
the endpoint pathname must be writable by the process. When the endpoint starts with /, e.g., ipc:///pathname, this will be an absolute pathname. If the endpoint specifies a directory that does not exist, the bind shall fail.
Note
on Linux only, when the endpoint pathname starts with @, the abstract namespace shall be used. The abstract namespace is independent of the filesystem and if a process attempts to bind an endpoint already bound by a process, it will fail. See unix(7) for details.
Note
IPC pathnames have a maximum size that depends on the operating system. On Linux, the maximum is 113 characters including the "ipc://" prefix (107 characters for the real path name).

Unbinding wild-card address from a socket

When wild-card * endpoint was used in zmq_bind(), the caller should use real endpoint obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this endpoint from a socket using zmq_unbind().

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the ipc transport, the endpoint shall be interpreted as an arbitrary string identifying the pathname to connect to. The pathname must have been previously created within the operating system namespace by assigning it to a socket with zmq_bind().

EXAMPLES

Assigning a local address to a socket
//  Assign the pathname "/tmp/feeds/0"
rc = zmq_bind(socket, "ipc:///tmp/feeds/0");
assert (rc == 0);
Connecting a socket
//  Connect to the pathname "/tmp/feeds/0"
rc = zmq_connect(socket, "ipc:///tmp/feeds/0");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_z85_encode.30000664000372000037200000000502513255253371017434 0ustar00travistravis00000000000000'\" t .\" Title: zmq_z85_encode .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_Z85_ENCODE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_z85_encode \- encode a binary key as Z85 printable text .SH "SYNOPSIS" .sp \fBchar *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);\fR .SH "DESCRIPTION" .sp The \fIzmq_z85_encode()\fR function shall encode the binary block specified by \fIdata\fR and \fIsize\fR into a string in \fIdest\fR\&. The size of the binary block must be divisible by 4\&. The \fIdest\fR must have sufficient space for size * 1\&.25 plus 1 for a null terminator\&. A 32\-byte CURVE key is encoded as 40 ASCII characters plus a null terminator\&. .sp The encoding shall follow the ZMQ RFC 32 specification\&. .SH "RETURN VALUE" .sp The \fIzmq_z85_encode()\fR function shall return \fIdest\fR if successful, else it shall return NULL\&. .SH "EXAMPLE" .PP \fBEncoding a CURVE key\fR. .sp .if n \{\ .RS 4 .\} .nf #include uint8_t public_key [32]; uint8_t secret_key [32]; int rc = crypto_box_keypair (public_key, secret_key); assert (rc == 0); char encoded [41]; zmq_z85_encode (encoded, public_key, 32); puts (encoded); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_z85_decode\fR(3) \fBzmq_curve_keypair\fR(3) \fBzmq_curve_public\fR(3) \fBzmq_curve\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/Makefile.in0000664000372000037200000005077513255253274016601 0ustar00travistravis00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_MAN_TRUE@am__append_1 = $(MAN1) $(MAN3) $(MAN7) @INSTALL_MAN_TRUE@am__append_2 = $(MAN_DOC) @BUILD_DOC_TRUE@am__append_3 = $(MAN_TXT:%.txt=%.html) @BUILD_DOC_TRUE@am__append_4 = $(MAN_HTML) @BUILD_DOC_TRUE@am__append_5 = $(MAN_HTML) subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/platform.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man3dir = $(mandir)/man3 am__installdirs = "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)" man7dir = $(mandir)/man7 NROFF = nroff MANS = $(dist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ ASCIIDOC = @ASCIIDOC@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLANG_FORMAT = @CLANG_FORMAT@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@ LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@ LIBZMQ_VMCI_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ LIBZMQ_VMCI_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTVER = @LTVER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ VALGRIND_HAVE_TOOL_drd = @VALGRIND_HAVE_TOOL_drd@ VALGRIND_HAVE_TOOL_exp_sgcheck = @VALGRIND_HAVE_TOOL_exp_sgcheck@ VALGRIND_HAVE_TOOL_helgrind = @VALGRIND_HAVE_TOOL_helgrind@ VALGRIND_HAVE_TOOL_memcheck = @VALGRIND_HAVE_TOOL_memcheck@ VERSION = @VERSION@ WITH_CLANG_FORMAT = @WITH_CLANG_FORMAT@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gssapi_krb5_CFLAGS = @gssapi_krb5_CFLAGS@ gssapi_krb5_LIBS = @gssapi_krb5_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libzmq_have_asciidoc = @libzmq_have_asciidoc@ libzmq_have_xmlto = @libzmq_have_xmlto@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ norm_CFLAGS = @norm_CFLAGS@ norm_LIBS = @norm_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pgm_CFLAGS = @pgm_CFLAGS@ pgm_LIBS = @pgm_LIBS@ pkg_config_defines = @pkg_config_defines@ pkg_config_libs_private = @pkg_config_libs_private@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # # documentation # MAN3 = zmq_bind.3 zmq_unbind.3 zmq_connect.3 zmq_disconnect.3 zmq_close.3 \ zmq_ctx_new.3 zmq_ctx_term.3 zmq_ctx_get.3 zmq_ctx_set.3 zmq_ctx_shutdown.3 \ zmq_msg_init.3 zmq_msg_init_data.3 zmq_msg_init_size.3 \ zmq_msg_move.3 zmq_msg_copy.3 zmq_msg_size.3 zmq_msg_data.3 zmq_msg_close.3 \ zmq_msg_send.3 zmq_msg_recv.3 \ zmq_msg_routing_id.3 zmq_msg_set_routing_id.3 \ zmq_send.3 zmq_recv.3 zmq_send_const.3 \ zmq_msg_get.3 zmq_msg_set.3 zmq_msg_more.3 zmq_msg_gets.3 \ zmq_getsockopt.3 zmq_setsockopt.3 \ zmq_socket.3 zmq_socket_monitor.3 zmq_poll.3 \ zmq_errno.3 zmq_strerror.3 zmq_version.3 \ zmq_sendmsg.3 zmq_recvmsg.3 \ zmq_proxy.3 zmq_proxy_steerable.3 \ zmq_z85_encode.3 zmq_z85_decode.3 zmq_curve_keypair.3 zmq_curve_public.3 \ zmq_has.3 \ zmq_atomic_counter_new.3 zmq_atomic_counter_set.3 \ zmq_atomic_counter_inc.3 zmq_atomic_counter_dec.3 \ zmq_atomic_counter_value.3 zmq_atomic_counter_destroy.3 MAN7 = zmq.7 zmq_tcp.7 zmq_pgm.7 zmq_inproc.7 zmq_ipc.7 \ zmq_null.7 zmq_plain.7 zmq_curve.7 zmq_tipc.7 zmq_vmci.7 zmq_udp.7 \ zmq_gssapi.7 MAN_DOC = $(am__append_1) MAN_TXT = $(MAN3:%.3=%.txt) $(MAN7:%.7=%.txt) MAN_HTML = $(am__append_3) MAINTAINERCLEANFILES = $(am__append_2) $(am__append_5) EXTRA_DIST = asciidoc.conf $(MAN_TXT) $(am__append_4) @INSTALL_MAN_TRUE@dist_man_MANS = $(MAN_DOC) @BUILD_DOC_TRUE@SUFFIXES = .html .txt .xml .3 .7 all: all-am .SUFFIXES: .SUFFIXES: .html .txt .xml .3 .7 .1 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man3dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.3[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ done; } uninstall-man3: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) install-man7: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man7dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man3 install-man7 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man3 uninstall-man7 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am dist-hook distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man3 install-man7 install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-man uninstall-man3 uninstall-man7 @BUILD_DOC_TRUE@.txt.html: @BUILD_DOC_TRUE@ asciidoc -d manpage -b xhtml11 -f $(srcdir)/asciidoc.conf \ @BUILD_DOC_TRUE@ -azmq_version=@PACKAGE_VERSION@ -o$@ $< @BUILD_DOC_TRUE@.txt.xml: @BUILD_DOC_TRUE@ asciidoc -d manpage -b docbook -f $(srcdir)/asciidoc.conf \ @BUILD_DOC_TRUE@ -azmq_version=@PACKAGE_VERSION@ -o$@ $< @BUILD_DOC_TRUE@.xml.1: @BUILD_DOC_TRUE@ xmlto man $< @BUILD_DOC_TRUE@.xml.3: @BUILD_DOC_TRUE@ xmlto man $< @BUILD_DOC_TRUE@.xml.7: @BUILD_DOC_TRUE@ xmlto man $< dist-hook : $(MAN_DOC) $(MAN_HTML) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: zeromq-4.2.5/doc/zmq_proxy.txt0000664000372000037200000000603713255253220017324 0ustar00travistravis00000000000000zmq_proxy(3) ============ NAME ---- zmq_proxy - start built-in 0MQ proxy SYNOPSIS -------- *int zmq_proxy (const void '*frontend', const void '*backend', const void '*capture');* DESCRIPTION ----------- The _zmq_proxy()_ function starts the built-in 0MQ proxy in the current application thread. The proxy connects a frontend socket to a backend socket. Conceptually, data flows from frontend to backend. Depending on the socket types, replies may flow in the opposite direction. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between frontend and backend. Before calling _zmq_proxy()_ you must set any socket options, and connect or bind both frontend and backend sockets. The two conventional proxy models are: _zmq_proxy()_ runs in the current thread and returns only if/when the current context is closed. If the capture socket is not NULL, the proxy shall send all messages, received on both frontend and backend, to the capture socket. The capture socket should be a 'ZMQ_PUB', 'ZMQ_DEALER', 'ZMQ_PUSH', or 'ZMQ_PAIR' socket. Refer to linkzmq:zmq_socket[3] for a description of the available socket types. EXAMPLE USAGE ------------- Shared Queue ~~~~~~~~~~~~ When the frontend is a ZMQ_ROUTER socket, and the backend is a ZMQ_DEALER socket, the proxy shall act as a shared queue that collects requests from a set of clients, and distributes these fairly among a set of services. Requests shall be fair-queued from frontend connections and distributed evenly across backend connections. Replies shall automatically return to the client that made the original request. Forwarder ~~~~~~~~~ When the frontend is a ZMQ_XSUB socket, and the backend is a ZMQ_XPUB socket, the proxy shall act as a message forwarder that collects messages from a set of publishers and forwards these to a set of subscribers. This may be used to bridge networks transports, e.g. read on tcp:// and forward on pgm://. Streamer ~~~~~~~~ When the frontend is a ZMQ_PULL socket, and the backend is a ZMQ_PUSH socket, the proxy shall collect tasks from a set of clients and forwards these to a set of workers using the pipeline pattern. RETURN VALUE ------------ The _zmq_proxy()_ function always returns `-1` and 'errno' set to *ETERM* or *EINTR* (the 0MQ 'context' associated with either of the specified sockets was terminated). EXAMPLE ------- .Creating a shared queue proxy ---- // Create frontend and backend sockets void *frontend = zmq_socket (context, ZMQ_ROUTER); assert (backend); void *backend = zmq_socket (context, ZMQ_DEALER); assert (frontend); // Bind both sockets to TCP ports assert (zmq_bind (frontend, "tcp://*:5555") == 0); assert (zmq_bind (backend, "tcp://*:5556") == 0); // Start the queue proxy, which runs until ETERM zmq_proxy (frontend, backend, NULL); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_init_size.html0000664000372000037200000004600313255253330021132 0ustar00travistravis00000000000000 zmq_msg_init_size(3)

SYNOPSIS

int zmq_msg_init_size (zmq_msg_t *msg, size_t size);

DESCRIPTION

The zmq_msg_init_size() function shall allocate any resources required to store a message size bytes long and initialise the message object referenced by msg to represent the newly allocated message.

The implementation shall choose whether to store message content on the stack (small messages) or on the heap (large messages). For performance reasons zmq_msg_init_size() shall not clear the message data.

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.
Caution
The functions zmq_msg_init(), zmq_msg_init_data() and zmq_msg_init_size() are mutually exclusive. Never initialise the same zmq_msg_t twice.

RETURN VALUE

The zmq_msg_init_size() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

ENOMEM

Insufficient storage space is available.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_init_data.txt0000664000372000037200000000422013255253220020735 0ustar00travistravis00000000000000zmq_msg_init_data(3) ==================== NAME ---- zmq_msg_init_data - initialise 0MQ message from a supplied buffer SYNOPSIS -------- *typedef void (zmq_free_fn) (void '*data', void '*hint');* *int zmq_msg_init_data (zmq_msg_t '*msg', void '*data', size_t 'size', zmq_free_fn '*ffn', void '*hint');* DESCRIPTION ----------- The _zmq_msg_init_data()_ function shall initialise the message object referenced by 'msg' to represent the content referenced by the buffer located at address 'data', 'size' bytes long. No copy of 'data' shall be performed and 0MQ shall take ownership of the supplied buffer. If provided, the deallocation function 'ffn' shall be called once the data buffer is no longer required by 0MQ, with the 'data' and 'hint' arguments supplied to _zmq_msg_init_data()_. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. CAUTION: The deallocation function 'ffn' needs to be thread-safe, since it will be called from an arbitrary thread. CAUTION: If the deallocation function is not provided, the allocated memory will not be freed, and this may cause a memory leak. CAUTION: The functions _zmq_msg_init()_, _zmq_msg_init_data()_ and _zmq_msg_init_size()_ are mutually exclusive. Never initialise the same 'zmq_msg_t' twice. RETURN VALUE ------------ The _zmq_msg_init_data()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ENOMEM*:: Insufficient storage space is available. EXAMPLE ------- .Initialising a message from a supplied buffer ---- void my_free (void *data, void *hint) { free (data); } /* ... */ void *data = malloc (6); assert (data); memcpy (data, "ABCDEF", 6); zmq_msg_t msg; rc = zmq_msg_init_data (&msg, data, 6, my_free, NULL); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_close[3] linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_size[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_size.txt0000664000372000037200000000161613255253220017761 0ustar00travistravis00000000000000zmq_msg_size(3) =============== NAME ---- zmq_msg_size - retrieve message content size in bytes SYNOPSIS -------- *size_t zmq_msg_size (zmq_msg_t '*msg');* DESCRIPTION ----------- The _zmq_msg_size()_ function shall return the size in bytes of the content of the message object referenced by 'msg'. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. RETURN VALUE ------------ Upon successful completion, _zmq_msg_size()_ shall return the size of the message content in bytes. ERRORS ------ No errors are defined. SEE ALSO -------- linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_pgm.70000664000372000037200000001720013255253377016264 0ustar00travistravis00000000000000'\" t .\" Title: zmq_pgm .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_PGM" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_pgm \- 0MQ reliable multicast transport using PGM .SH "SYNOPSIS" .sp PGM (Pragmatic General Multicast) is a protocol for reliable multicast transport of data over IP networks\&. .SH "DESCRIPTION" .sp 0MQ implements two variants of PGM, the standard protocol where PGM datagrams are layered directly on top of IP datagrams as defined by RFC 3208 (the \fIpgm\fR transport) and "Encapsulated PGM" or EPGM where PGM datagrams are encapsulated inside UDP datagrams (the \fIepgm\fR transport)\&. .sp The \fIpgm\fR and \fIepgm\fR transports can only be used with the \fIZMQ_PUB\fR and \fIZMQ_SUB\fR socket types\&. .sp Further, PGM sockets are rate limited by default\&. For details, refer to the \fIZMQ_RATE\fR, and \fIZMQ_RECOVERY_IVL\fR options documented in \fBzmq_setsockopt\fR(3)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The \fIpgm\fR transport implementation requires access to raw IP sockets\&. Additional privileges may be required on some operating systems for this operation\&. Applications not requiring direct interoperability with other PGM implementations are encouraged to use the \fIepgm\fR transport instead which does not require any special privileges\&. .sp .5v .RE .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the PGM transport, the transport is pgm, and for the EPGM protocol the transport is epgm\&. The meaning of the \fIaddress\fR part is defined below\&. .SS "Connecting a socket" .sp When connecting a socket to a peer address using \fIzmq_connect()\fR with the \fIpgm\fR or \fIepgm\fR transport, the \fIendpoint\fR shall be interpreted as an \fIinterface\fR followed by a semicolon, followed by a \fImulticast address\fR, followed by a colon and a port number\&. .sp An \fIinterface\fR may be specified by either of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The interface name as defined by the operating system\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The primary IPv4 address assigned to the interface, in its numeric representation\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Interface names are not standardised in any way and should be assumed to be arbitrary and platform dependent\&. On Win32 platforms no short interface names exist, thus only the primary IPv4 address may be used to specify an \fIinterface\fR\&. The \fIinterface\fR part can be omitted, in that case the default one will be selected\&. .sp .5v .RE .sp A \fImulticast address\fR is specified by an IPv4 multicast address in its numeric representation\&. .SH "WIRE FORMAT" .sp Consecutive PGM datagrams are interpreted by 0MQ as a single continuous stream of data where 0MQ messages are not necessarily aligned with PGM datagram boundaries and a single 0MQ message may span several PGM datagrams\&. This stream of data consists of 0MQ messages encapsulated in \fIframes\fR as described in \fBzmq_tcp\fR(7)\&. .SS "PGM datagram payload" .sp The following ABNF grammar represents the payload of a single PGM datagram as used by 0MQ: .sp .if n \{\ .RS 4 .\} .nf datagram = (offset data) offset = 2OCTET data = *OCTET .fi .if n \{\ .RE .\} .sp In order for late joining consumers to be able to identify message boundaries, each PGM datagram payload starts with a 16\-bit unsigned integer in network byte order specifying either the offset of the first message \fIframe\fR in the datagram or containing the value 0xFFFF if the datagram contains solely an intermediate part of a larger message\&. .sp Note that offset specifies where the first message begins rather than the first message part\&. Thus, if there are trailing message parts at the beginning of the packet the offset ignores them and points to first initial message part in the packet\&. .sp The following diagram illustrates the layout of a single PGM datagram payload: .sp .if n \{\ .RS 4 .\} .nf +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | offset (16 bits) | data | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .fi .if n \{\ .RE .\} .sp The following diagram further illustrates how three example 0MQ frames are laid out in consecutive PGM datagram payloads: .sp .if n \{\ .RS 4 .\} .nf First datagram payload +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | Frame offset | Frame 1 | Frame 2, part 1 | | 0x0000 | (Message 1) | (Message 2, part 1) | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ Second datagram payload +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | Frame offset | Frame 2, part 2 | | 0xFFFF | (Message 2, part 2) | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ Third datagram payload +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-+ | Frame offset | Frame 2, final 8 bytes | Frame 3 | | 0x0008 | (Message 2, final 8 bytes) | (Message 3) | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-+ .fi .if n \{\ .RE .\} .SH "EXAMPLE" .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connecting to the multicast address 239\&.192\&.1\&.1, port 5555, // using the first Ethernet network interface on Linux // and the Encapsulated PGM protocol rc = zmq_connect(socket, "epgm://eth0;239\&.192\&.1\&.1:5555"); assert (rc == 0); // Connecting to the multicast address 239\&.192\&.1\&.1, port 5555, // using the network interface with the address 192\&.168\&.1\&.1 // and the standard PGM protocol rc = zmq_connect(socket, "pgm://192\&.168\&.1\&.1;239\&.192\&.1\&.1:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_connect\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_tcp\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq_vmci\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_send.txt0000664000372000037200000001014113255253220017731 0ustar00travistravis00000000000000zmq_msg_send(3) =============== NAME ---- zmq_msg_send - send a message part on a socket SYNOPSIS -------- *int zmq_msg_send (zmq_msg_t '*msg', void '*socket', int 'flags');* DESCRIPTION ----------- The _zmq_msg_send()_ function is identical to linkzmq:zmq_sendmsg[3], which shall be deprecated in future versions. _zmq_msg_send()_ is more consistent with other message manipulation functions. The _zmq_msg_send()_ function shall queue the message referenced by the 'msg' argument to be sent to the socket referenced by the 'socket' argument. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the 'socket', the _zmq_msg_send()_ function shall fail with 'errno' set to EAGAIN. *ZMQ_SNDMORE*:: Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description. The _zmq_msg_t_ structure passed to _zmq_msg_send()_ is nullified during the call. If you want to send the same message to multiple sockets you have to copy it (e.g. using _zmq_msg_copy()_). NOTE: A successful invocation of _zmq_msg_send()_ does not indicate that the message has been transmitted to the network, only that it has been queued on the 'socket' and 0MQ has assumed responsibility for the message. You do not need to call _zmq_msg_close()_ after a successful _zmq_msg_send()_. Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. Each message part is an independent 'zmq_msg_t' in its own right. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag when sending each message part except the final one. RETURN VALUE ------------ The _zmq_msg_send()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and the message cannot be sent at the moment. *ENOTSUP*:: The _zmq_msg_send()_ operation is not supported by this socket type. *EINVAL*:: The sender tried to send multipart data, which the socket type does not allow. *EFSM*:: The _zmq_msg_send()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before the message was sent. *EFAULT*:: Invalid message. *EHOSTUNREACH*:: The message cannot be routed. EXAMPLE ------- .Filling in a message and sending it to a socket ---- /* Create a new message, allocating 6 bytes for message content */ zmq_msg_t msg; int rc = zmq_msg_init_size (&msg, 6); assert (rc == 0); /* Fill in message content with 'AAAAAA' */ memset (zmq_msg_data (&msg), 'A', 6); /* Send the message to the socket */ rc = zmq_msg_send (&msg, socket, 0); assert (rc == 6); ---- .Sending a multi-part message ---- /* Send a multi-part message consisting of three parts to socket */ rc = zmq_msg_send (&part1, socket, ZMQ_SNDMORE); rc = zmq_msg_send (&part2, socket, ZMQ_SNDMORE); /* Final part; no more parts to follow */ rc = zmq_msg_send (&part3, socket, 0); ---- SEE ALSO -------- linkzmq:zmq_recv[3] linkzmq:zmq_send[3] linkzmq:zmq_msg_recv[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_gssapi.70000664000372000037200000000745513255253402016767 0ustar00travistravis00000000000000'\" t .\" Title: zmq_gssapi .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_GSSAPI" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_gssapi \- secure authentication and confidentiality .SH "SYNOPSIS" .sp The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI)\&. The GSSAPI mechanism can be used on both public and private networks\&. GSSAPI itself is defined in IETF RFC\-2743: \m[blue]\fBhttp://tools\&.ietf\&.org/html/rfc2743\fR\m[]\&. The ZeroMQ GSSAPI mechanism is defined by this document: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:38\fR\m[]\&. .SH "CLIENT AND SERVER ROLES" .sp A socket using GSSAPI can be either client or server, but not both\&. .sp To become a GSSAPI server, the application sets the ZMQ_GSSAPI_SERVER option on the socket\&. .sp To become a GSSAPI client, the application sets the ZMQ_GSSAPI_SERVICE_PRINCIPAL option to the name of the principal on the server to which it intends to connect\&. .sp On client or server, the application may additionally set the ZMQ_GSSAPI_PRINCIPAL option to provide the socket with the name of the principal for whom GSSAPI credentials should be acquired\&. If this option is not set, default credentials are used\&. .SH "OPTIONAL ENCRYPTION" .sp By default, the GSSAPI mechanism will encrypt all communications between client and server\&. If encryption is not desired (e\&.g\&. on private networks), the client and server applications can disable it by setting the ZMQ_GSSAPI_PLAINTEXT option\&. Both the client and server must set this option to the same value\&. .SH "PRINCIPAL NAMES" .sp Principal names specified with the ZMQ_GSSAPI_SERVICE_PRINCIPAL or ZMQ_GSSAPI_PRINCIPAL options are interpreted as "host based" name types by default\&. The ZMQ_GSSAPI_PRINCIPAL_NAMETYPE and ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE options may be used to change the name type to one of: .PP \fBZMQ_GSSAPI_NT_HOSTBASED\fR .RS 4 The name should be of the form "service" or "service@hostname", which will parse into a principal of "service/hostname" in the local realm\&. This is the default name type\&. .RE .PP \fBZMQ_GSSAPI_NT_USER_NAME\fR .RS 4 The name should be a local username, which will parse into a single\-component principal in the local realm\&. .RE .PP \fBZMQ_GSSAPI_NT_KRB5_PRINCIPAL\fR .RS 4 The name is a principal name string\&. This name type only works with the krb5 GSSAPI mechanism\&. .RE .SH "SEE ALSO" .sp \fBzmq_setsockopt\fR(3) \fBzmq_null\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_z85_decode.html0000664000372000037200000004433613255253341020231 0ustar00travistravis00000000000000 zmq_z85_decode(3)

SYNOPSIS

uint8_t *zmq_z85_decode (uint8_t *dest, const char *string);

DESCRIPTION

The zmq_z85_decode() function shall decode string into dest. The length of string shall be divisible by 5. dest must be large enough for the decoded value (0.8 x strlen (string)).

The encoding shall follow the ZMQ RFC 32 specification.

RETURN VALUE

The zmq_z85_decode() function shall return dest if successful, else it shall return NULL.

EXAMPLE

Decoding a CURVE key
const char decoded [] = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7";
uint8_t public_key [32];
zmq_z85_decode (public_key, decoded);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_send.30000664000372000037200000001147313255253360016424 0ustar00travistravis00000000000000'\" t .\" Title: zmq_send .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SEND" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_send \- send a message part on a socket .SH "SYNOPSIS" .sp \fBint zmq_send (void \fR\fB\fI*socket\fR\fR\fB, void \fR\fB\fI*buf\fR\fR\fB, size_t \fR\fB\fIlen\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_send()\fR function shall queue a message created from the buffer referenced by the \fIbuf\fR and \fIlen\fR arguments\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the \fIsocket\fR, the \fIzmq_send()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .PP \fBZMQ_SNDMORE\fR .RS 4 Specifies that the message being sent is a multi\-part message, and that further message parts are to follow\&. Refer to the section regarding multi\-part messages below for a detailed description\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp A successful invocation of \fIzmq_send()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&. .sp .5v .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that sends multi\-part messages must use the \fIZMQ_SNDMORE\fR flag when sending each message part except the final one\&. .SH "RETURN VALUE" .sp The \fIzmq_send()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and the message cannot be sent at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_send()\fR operation is not supported by this socket type\&. .RE .PP \fBEINVAL\fR .RS 4 The sender tried to send multipart data, which the socket type does not allow\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_send()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before the message was sent\&. .RE .PP \fBEHOSTUNREACH\fR .RS 4 The message cannot be routed\&. .RE .SH "EXAMPLE" .PP \fBSending a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf /* Send a multi\-part message consisting of three parts to socket */ rc = zmq_send (socket, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (socket, "DEFGH", 5, ZMQ_SNDMORE); assert (rc == 5); /* Final part; no more parts to follow */ rc = zmq_send (socket, "JK", 2, 0); assert (rc == 2); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_send_const\fR(3) \fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_proxy.30000664000372000037200000001057413255253371016657 0ustar00travistravis00000000000000'\" t .\" Title: zmq_proxy .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_PROXY" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_proxy \- start built\-in 0MQ proxy .SH "SYNOPSIS" .sp \fBint zmq_proxy (const void \fR\fB\fI*frontend\fR\fR\fB, const void \fR\fB\fI*backend\fR\fR\fB, const void \fR\fB\fI*capture\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_proxy()\fR function starts the built\-in 0MQ proxy in the current application thread\&. .sp The proxy connects a frontend socket to a backend socket\&. Conceptually, data flows from frontend to backend\&. Depending on the socket types, replies may flow in the opposite direction\&. The direction is conceptual only; the proxy is fully symmetric and there is no technical difference between frontend and backend\&. .sp Before calling \fIzmq_proxy()\fR you must set any socket options, and connect or bind both frontend and backend sockets\&. The two conventional proxy models are: .sp \fIzmq_proxy()\fR runs in the current thread and returns only if/when the current context is closed\&. .sp If the capture socket is not NULL, the proxy shall send all messages, received on both frontend and backend, to the capture socket\&. The capture socket should be a \fIZMQ_PUB\fR, \fIZMQ_DEALER\fR, \fIZMQ_PUSH\fR, or \fIZMQ_PAIR\fR socket\&. .sp Refer to \fBzmq_socket\fR(3) for a description of the available socket types\&. .SH "EXAMPLE USAGE" .SS "Shared Queue" .sp When the frontend is a ZMQ_ROUTER socket, and the backend is a ZMQ_DEALER socket, the proxy shall act as a shared queue that collects requests from a set of clients, and distributes these fairly among a set of services\&. Requests shall be fair\-queued from frontend connections and distributed evenly across backend connections\&. Replies shall automatically return to the client that made the original request\&. .SS "Forwarder" .sp When the frontend is a ZMQ_XSUB socket, and the backend is a ZMQ_XPUB socket, the proxy shall act as a message forwarder that collects messages from a set of publishers and forwards these to a set of subscribers\&. This may be used to bridge networks transports, e\&.g\&. read on tcp:// and forward on pgm://\&. .SS "Streamer" .sp When the frontend is a ZMQ_PULL socket, and the backend is a ZMQ_PUSH socket, the proxy shall collect tasks from a set of clients and forwards these to a set of workers using the pipeline pattern\&. .SH "RETURN VALUE" .sp The \fIzmq_proxy()\fR function always returns \-1 and \fIerrno\fR set to \fBETERM\fR or \fBEINTR\fR (the 0MQ \fIcontext\fR associated with either of the specified sockets was terminated)\&. .SH "EXAMPLE" .PP \fBCreating a shared queue proxy\fR. .sp .if n \{\ .RS 4 .\} .nf // Create frontend and backend sockets void *frontend = zmq_socket (context, ZMQ_ROUTER); assert (backend); void *backend = zmq_socket (context, ZMQ_DEALER); assert (frontend); // Bind both sockets to TCP ports assert (zmq_bind (frontend, "tcp://*:5555") == 0); assert (zmq_bind (backend, "tcp://*:5556") == 0); // Start the queue proxy, which runs until ETERM zmq_proxy (frontend, backend, NULL); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_recvmsg.html0000664000372000037200000005377213255253340017751 0ustar00travistravis00000000000000 zmq_recvmsg(3)

SYNOPSIS

int zmq_recvmsg (void *socket, zmq_msg_t *msg, int flags);

DESCRIPTION

The zmq_recvmsg() function shall receive a message part from the socket referenced by the socket argument and store it in the message referenced by the msg argument. Any content previously stored in msg shall be properly deallocated. If there are no message parts available on the specified socket the zmq_recvmsg() function shall block until the request can be satisfied. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified socket, the zmq_recvmsg() function shall fail with errno set to EAGAIN.

Note
this API method is deprecated in favor of zmq_msg_recv(3).

Multi-part messages

A ØMQ message is composed of 1 or more message parts. Each message part is an independent zmq_msg_t in its own right. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that processes multi-part messages must use the ZMQ_RCVMORE zmq_getsockopt(3) option after calling zmq_recvmsg() to determine if there are further parts to receive.

RETURN VALUE

The zmq_recvmsg() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and no messages are available at the moment.

ENOTSUP

The zmq_recvmsg() operation is not supported by this socket type.

EFSM

The zmq_recvmsg() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before a message was available.

EFAULT

The message passed to the function was invalid.

EXAMPLE

Receiving a message from a socket
/* Create an empty 0MQ message */
zmq_msg_t msg;
int rc = zmq_msg_init (&msg);
assert (rc == 0);
/* Block until a message is available to be received from socket */
rc = zmq_recvmsg (socket, &msg, 0);
assert (rc != -1);
/* Release message */
zmq_msg_close (&msg);
Receiving a multi-part message
int more;
size_t more_size = sizeof (more);
do {
    /* Create an empty 0MQ message to hold the message part */
    zmq_msg_t part;
    int rc = zmq_msg_init (&part);
    assert (rc == 0);
    /* Block until a message is available to be received from socket */
    rc = zmq_recvmsg (socket, &part, 0);
    assert (rc != -1);
    /* Determine if more message parts are to follow */
    rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size);
    assert (rc == 0);
    zmq_msg_close (&part);
} while (more);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_init_data.html0000664000372000037200000005046613255253330021101 0ustar00travistravis00000000000000 zmq_msg_init_data(3)

SYNOPSIS

typedef void (zmq_free_fn) (void *data, void *hint);

int zmq_msg_init_data (zmq_msg_t *msg, void *data, size_t size, zmq_free_fn *ffn, void *hint);

DESCRIPTION

The zmq_msg_init_data() function shall initialise the message object referenced by msg to represent the content referenced by the buffer located at address data, size bytes long. No copy of data shall be performed and ØMQ shall take ownership of the supplied buffer.

If provided, the deallocation function ffn shall be called once the data buffer is no longer required by ØMQ, with the data and hint arguments supplied to zmq_msg_init_data().

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.
Caution
The deallocation function ffn needs to be thread-safe, since it will be called from an arbitrary thread.
Caution
If the deallocation function is not provided, the allocated memory will not be freed, and this may cause a memory leak.
Caution
The functions zmq_msg_init(), zmq_msg_init_data() and zmq_msg_init_size() are mutually exclusive. Never initialise the same zmq_msg_t twice.

RETURN VALUE

The zmq_msg_init_data() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

ENOMEM

Insufficient storage space is available.

EXAMPLE

Initialising a message from a supplied buffer
void my_free (void *data, void *hint)
{
    free (data);
}

    /*  ...  */

void *data = malloc (6);
assert (data);
memcpy (data, "ABCDEF", 6);
zmq_msg_t msg;
rc = zmq_msg_init_data (&msg, data, 6, my_free, NULL);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_value.30000664000372000037200000000554113255253375021707 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_value .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_V" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_value \- return value of atomic counter .SH "SYNOPSIS" .sp \fBint zmq_atomic_counter_value (void *counter);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_value\fR function returns the value of an atomic counter created by \fIzmq_atomic_counter_new()\fR\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_value()\fR function returns the value of the atomic counter\&. If \fIcounter\fR does not point to an atomic counter created by \fIzmq_atomic_counter_new()\fR, the behaviour is undefined\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_new\fR(3) \fBzmq_atomic_counter_set\fR(3) \fBzmq_atomic_counter_inc\fR(3) \fBzmq_atomic_counter_dec\fR(3) \fBzmq_atomic_counter_destroy\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_socket.html0000664000372000037200000016266013255253336017575 0ustar00travistravis00000000000000 zmq_socket(3)

SYNOPSIS

void *zmq_socket (void *context, int type);

DESCRIPTION

The zmq_socket() function shall create a ØMQ socket within the specified context and return an opaque handle to the newly created socket. The type argument specifies the socket type, which determines the semantics of communication over the socket.

The newly created socket is initially unbound, and not associated with any endpoints. In order to establish a message flow a socket must first be connected to at least one endpoint with zmq_connect(3), or at least one endpoint must be created for accepting incoming connections with zmq_bind(3).

Key differences to conventional sockets

Generally speaking, conventional sockets present a synchronous interface to either connection-oriented reliable byte streams (SOCK_STREAM), or connection-less unreliable datagrams (SOCK_DGRAM). In comparison, ØMQ sockets present an abstraction of an asynchronous message queue, with the exact queueing semantics depending on the socket type in use. Where conventional sockets transfer streams of bytes or discrete datagrams, ØMQ sockets transfer discrete messages.

ØMQ sockets being asynchronous means that the timings of the physical connection setup and tear down, reconnect and effective delivery are transparent to the user and organized by ØMQ itself. Further, messages may be queued in the event that a peer is unavailable to receive them.

Conventional sockets allow only strict one-to-one (two peers), many-to-one (many clients, one server), or in some cases one-to-many (multicast) relationships. With the exception of ZMQ_PAIR, ØMQ sockets may be connected to multiple endpoints using zmq_connect(), while simultaneously accepting incoming connections from multiple endpoints bound to the socket using zmq_bind(), thus allowing many-to-many relationships.

Thread safety

ØMQ has both thread safe socket type and not thread safe socket types. Applications MUST NOT use a not thread safe socket from multiple threads except after migrating a socket from one thread to another with a "full fence" memory barrier.

Following are the thread safe sockets: * ZMQ_CLIENT * ZMQ_SERVER * ZMQ_DISH * ZMQ_RADIO * ZMQ_SCATTER * ZMQ_GATHER

Socket types

The following sections present the socket types defined by ØMQ, grouped by the general messaging pattern which is built from related socket types.

Client-server pattern

The client-server pattern is used to allow a single ZMQ_SERVER server talk to one or more ZMQ_CLIENT clients. The client always starts the conversation, after which either peer can send messages asynchronously, to the other.

The client-server pattern is formally defined by http://rfc.zeromq.org/spec:41.

ZMQ_CLIENT

A ZMQ_CLIENT socket talks to a ZMQ_SERVER socket. Either peer can connect, though the usual and recommended model is to bind the ZMQ_SERVER and connect the ZMQ_CLIENT.

If the ZMQ_CLIENT socket has established a connection, zmq_send(3) will accept messages, queue them, and send them as rapidly as the network allows. The outgoing buffer limit is defined by the high water mark for the socket. If the outgoing buffer is full, or if there is no connected peer, zmq_send(3) will block, by default. The ZMQ_CLIENT socket will not drop messages.

When a ZMQ_CLIENT socket is connected to multiple ZMQ_SERVER sockets, outgoing messages are distributed between connected peers on a round-robin basis. Likewise, the ZMQ_CLIENT socket receives messages fairly from each connected peer. This usage is sensible only for stateless protocols.

ZMQ_CLIENT sockets are threadsafe and can be used from multiple threads at the same time. Note that replies from a ZMQ_SERVER socket will go to the first client thread that calls zmq_msg_recv(3). If you need to get replies back to the originating thread, use one ZMQ_CLIENT socket per thread.

Note
ZMQ_CLIENT sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives. This limits them to single part data. The intention is to extend the API to allow scatter/gather of multi-part data.
Summary of ZMQ_CLIENT characteristics
Compatible peer sockets

ZMQ_SERVER

Direction

Bidirectional

Send/receive pattern

Unrestricted

Outgoing routing strategy

Round-robin

Incoming routing strategy

Fair-queued

Action in mute state

Block

ZMQ_SERVER

A ZMQ_SERVER socket talks to a set of ZMQ_CLIENT sockets. A ZMQ_SERVER socket can only reply to an incoming message: the ZMQ_CLIENT peer must always initiate a conversation.

Each received message has a routing_id that is a 32-bit unsigned integer. The application can fetch this with zmq_msg_routing_id(3). To send a message to a given ZMQ_CLIENT peer the application must set the peer’s routing_id on the message, using zmq_msg_set_routing_id(3).

If the routing_id is not specified, or does not refer to a connected client peer, the send call will fail with EHOSTUNREACH. If the outgoing buffer for the client peer is full, the send call shall block, unless ZMQ_DONT_WAIT is used in the send, in which case it shall fail with EAGAIN. The ZMQ_SERVER socket shall not drop messages in any case.

Note
ZMQ_SERVER sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives. This limits them to single part data. The intention is to extend the API to allow scatter/gather of multi-part data.
Summary of ZMQ_SERVER characteristics
Compatible peer sockets

ZMQ_CLIENT

Direction

Bidirectional

Send/receive pattern

Unrestricted

Outgoing routing strategy

See text

Incoming routing strategy

Fair-queued

Action in mute state

Return EAGAIN

Radio-dish pattern

The radio-dish pattern is used for one-to-many distribution of data from a single publisher to multiple subscribers in a fan out fashion.

Radio-dish is using groups (vs Pub-sub topics), Dish sockets can join a group and each message sent by Radio sockets belong to a group.

Groups are null terminated strings limited to 16 chars length (including null). The intention is to increase the length to 40 chars (including null). The encoding of groups shall be UTF8.

Groups are matched using exact matching (vs prefix matching of PubSub).

Note
Radio-dish is still in draft phase.

ZMQ_RADIO

A socket of type ZMQ_RADIO is used by a publisher to distribute data. Each message belong to a group, a group is specified with zmq_msg_set_group(3). Messages are distributed to all members of a group. The zmq_recv(3) function is not implemented for this socket type.

When a ZMQ_RADIO socket enters the mute state due to having reached the high water mark for a subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the mute state ends. The zmq_send() function shall never block for this socket type.

Note
ZMQ_RADIO sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends. This limits them to single part data.
Summary of ZMQ_RADIO characteristics
Compatible peer sockets

ZMQ_DISH

Direction

Unidirectional

Send/receive pattern

Send only

Incoming routing strategy

N/A

Outgoing routing strategy

Fan out

Action in mute state

Drop

ZMQ_DISH

A socket of type ZMQ_DISH is used by a subscriber to subscribe to groups distributed by a radio. Initially a ZMQ_DISH socket is not subscribed to any groups, use zmq_join(3) to join a group. To get the group the message belong to call zmq_msg_group(3). The zmq_send() function is not implemented for this socket type.

Note
ZMQ_DISH sockets are threadsafe. They do not accept ZMQ_RCVMORE on receives. This limits them to single part data.
Summary of ZMQ_DISH characteristics
Compatible peer sockets

ZMQ_RADIO

Direction

Unidirectional

Send/receive pattern

Receive only

Incoming routing strategy

Fair-queued

Outgoing routing strategy

N/A

Publish-subscribe pattern

The publish-subscribe pattern is used for one-to-many distribution of data from a single publisher to multiple subscribers in a fan out fashion.

The publish-subscribe pattern is formally defined by http://rfc.zeromq.org/spec:29.

ZMQ_PUB

A socket of type ZMQ_PUB is used by a publisher to distribute data. Messages sent are distributed in a fan out fashion to all connected peers. The zmq_recv(3) function is not implemented for this socket type.

When a ZMQ_PUB socket enters the mute state due to having reached the high water mark for a subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the mute state ends. The zmq_send() function shall never block for this socket type.

Summary of ZMQ_PUB characteristics
Compatible peer sockets

ZMQ_SUB, ZMQ_XSUB

Direction

Unidirectional

Send/receive pattern

Send only

Incoming routing strategy

N/A

Outgoing routing strategy

Fan out

Action in mute state

Drop

ZMQ_SUB

A socket of type ZMQ_SUB is used by a subscriber to subscribe to data distributed by a publisher. Initially a ZMQ_SUB socket is not subscribed to any messages, use the ZMQ_SUBSCRIBE option of zmq_setsockopt(3) to specify which messages to subscribe to. The zmq_send() function is not implemented for this socket type.

Summary of ZMQ_SUB characteristics
Compatible peer sockets

ZMQ_PUB, ZMQ_XPUB

Direction

Unidirectional

Send/receive pattern

Receive only

Incoming routing strategy

Fair-queued

Outgoing routing strategy

N/A

ZMQ_XPUB

Same as ZMQ_PUB except that you can receive subscriptions from the peers in form of incoming messages. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix are also received, but have no effect on subscription status.

Summary of ZMQ_XPUB characteristics
Compatible peer sockets

ZMQ_SUB, ZMQ_XSUB

Direction

Unidirectional

Send/receive pattern

Send messages, receive subscriptions

Incoming routing strategy

N/A

Outgoing routing strategy

Fan out

Action in mute state

Drop

ZMQ_XSUB

Same as ZMQ_SUB except that you subscribe by sending subscription messages to the socket. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status.

Summary of ZMQ_XSUB characteristics
Compatible peer sockets

ZMQ_PUB, ZMQ_XPUB

Direction

Unidirectional

Send/receive pattern

Receive messages, send subscriptions

Incoming routing strategy

Fair-queued

Outgoing routing strategy

N/A

Action in mute state

Drop

Pipeline pattern

The pipeline pattern is used for distributing data to nodes arranged in a pipeline. Data always flows down the pipeline, and each stage of the pipeline is connected to at least one node. When a pipeline stage is connected to multiple nodes data is round-robined among all connected nodes.

The pipeline pattern is formally defined by http://rfc.zeromq.org/spec:30.

ZMQ_PUSH

A socket of type ZMQ_PUSH is used by a pipeline node to send messages to downstream pipeline nodes. Messages are round-robined to all connected downstream nodes. The zmq_recv() function is not implemented for this socket type.

When a ZMQ_PUSH socket enters the mute state due to having reached the high water mark for all downstream nodes, or if there are no downstream nodes at all, then any zmq_send(3) operations on the socket shall block until the mute state ends or at least one downstream node becomes available for sending; messages are not discarded.

Summary of ZMQ_PUSH characteristics
Compatible peer sockets

ZMQ_PULL

Direction

Unidirectional

Send/receive pattern

Send only

Incoming routing strategy

N/A

Outgoing routing strategy

Round-robin

Action in mute state

Block

ZMQ_PULL

A socket of type ZMQ_PULL is used by a pipeline node to receive messages from upstream pipeline nodes. Messages are fair-queued from among all connected upstream nodes. The zmq_send() function is not implemented for this socket type.

Summary of ZMQ_PULL characteristics
Compatible peer sockets

ZMQ_PUSH

Direction

Unidirectional

Send/receive pattern

Receive only

Incoming routing strategy

Fair-queued

Outgoing routing strategy

N/A

Action in mute state

Block

Exclusive pair pattern

The exclusive pair pattern is used to connect a peer to precisely one other peer. This pattern is used for inter-thread communication across the inproc transport.

The exclusive pair pattern is formally defined by http://rfc.zeromq.org/spec:31.

ZMQ_PAIR

A socket of type ZMQ_PAIR can only be connected to a single peer at any one time. No message routing or filtering is performed on messages sent over a ZMQ_PAIR socket.

When a ZMQ_PAIR socket enters the mute state due to having reached the high water mark for the connected peer, or if no peer is connected, then any zmq_send(3) operations on the socket shall block until the peer becomes available for sending; messages are not discarded.

Note
ZMQ_PAIR sockets are designed for inter-thread communication across the zmq_inproc(7) transport and do not implement functionality such as auto-reconnection.
Summary of ZMQ_PAIR characteristics
Compatible peer sockets

ZMQ_PAIR

Direction

Bidirectional

Send/receive pattern

Unrestricted

Incoming routing strategy

N/A

Outgoing routing strategy

N/A

Action in mute state

Block

Native Pattern

The native pattern is used for communicating with TCP peers and allows asynchronous requests and replies in either direction.

ZMQ_STREAM

A socket of type ZMQ_STREAM is used to send and receive TCP data from a non-ØMQ peer, when using the tcp:// transport. A ZMQ_STREAM socket can act as client and/or server, sending and/or receiving TCP data asynchronously.

When receiving TCP data, a ZMQ_STREAM socket shall prepend a message part containing the routing id of the originating peer to the message before passing it to the application. Messages received are fair-queued from among all connected peers.

When sending TCP data, a ZMQ_STREAM socket shall remove the first part of the message and use it to determine the routing id of the peer the message shall be routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error.

To open a connection to a server, use the zmq_connect call, and then fetch the socket routing id using the zmq_getsockopt call with the ZMQ_ROUTING_ID option.

To close a specific connection, send the routing id frame followed by a zero-length message (see EXAMPLE section).

When a connection is made, a zero-length message will be received by the application. Similarly, when the peer disconnects (or the connection is lost), a zero-length message will be received by the application.

You must send one routing id frame followed by one data frame. The ZMQ_SNDMORE flag is required for routing id frames but is ignored on data frames.

Summary of ZMQ_STREAM characteristics
Compatible peer sockets

none.

Direction

Bidirectional

Send/receive pattern

Unrestricted

Outgoing routing strategy

See text

Incoming routing strategy

Fair-queued

Action in mute state

EAGAIN

Request-reply pattern

The request-reply pattern is used for sending requests from a ZMQ_REQ client to one or more ZMQ_REP services, and receiving subsequent replies to each request sent.

The request-reply pattern is formally defined by http://rfc.zeromq.org/spec:28.

ZMQ_REQ

A socket of type ZMQ_REQ is used by a client to send requests to and receive replies from a service. This socket type allows only an alternating sequence of zmq_send(request) and subsequent zmq_recv(reply) calls. Each request sent is round-robined among all services, and each reply received is matched with the last issued request.

If no services are available, then any send operation on the socket shall block until at least one service becomes available. The REQ socket shall not discard messages.

Summary of ZMQ_REQ characteristics
Compatible peer sockets

ZMQ_REP, ZMQ_ROUTER

Direction

Bidirectional

Send/receive pattern

Send, Receive, Send, Receive, …

Outgoing routing strategy

Round-robin

Incoming routing strategy

Last peer

Action in mute state

Block

ZMQ_REP

A socket of type ZMQ_REP is used by a service to receive requests from and send replies to a client. This socket type allows only an alternating sequence of zmq_recv(request) and subsequent zmq_send(reply) calls. Each request received is fair-queued from among all clients, and each reply sent is routed to the client that issued the last request. If the original requester does not exist any more the reply is silently discarded.

Summary of ZMQ_REP characteristics
Compatible peer sockets

ZMQ_REQ, ZMQ_DEALER

Direction

Bidirectional

Send/receive pattern

Receive, Send, Receive, Send, …

Incoming routing strategy

Fair-queued

Outgoing routing strategy

Last peer

ZMQ_DEALER

A socket of type ZMQ_DEALER is an advanced pattern used for extending request/reply sockets. Each message sent is round-robined among all connected peers, and each message received is fair-queued from all connected peers.

When a ZMQ_DEALER socket enters the mute state due to having reached the high water mark for all peers, or if there are no peers at all, then any zmq_send(3) operations on the socket shall block until the mute state ends or at least one peer becomes available for sending; messages are not discarded.

When a ZMQ_DEALER socket is connected to a ZMQ_REP socket each message sent must consist of an empty message part, the delimiter, followed by one or more body parts.

Summary of ZMQ_DEALER characteristics
Compatible peer sockets

ZMQ_ROUTER, ZMQ_REP, ZMQ_DEALER

Direction

Bidirectional

Send/receive pattern

Unrestricted

Outgoing routing strategy

Round-robin

Incoming routing strategy

Fair-queued

Action in mute state

Block

ZMQ_ROUTER

A socket of type ZMQ_ROUTER is an advanced socket type used for extending request/reply sockets. When receiving messages a ZMQ_ROUTER socket shall prepend a message part containing the routing id of the originating peer to the message before passing it to the application. Messages received are fair-queued from among all connected peers. When sending messages a ZMQ_ROUTER socket shall remove the first part of the message and use it to determine the _routing id _ of the peer the message shall be routed to. If the peer does not exist anymore, or has never existed, the message shall be silently discarded. However, if ZMQ_ROUTER_MANDATORY socket option is set to 1, the socket shall fail with EHOSTUNREACH in both cases.

When a ZMQ_ROUTER socket enters the mute state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped. If, ZMQ_ROUTER_MANDATORY is set to 1, the socket shall block or return EAGAIN in both cases.

When a ZMQ_ROUTER socket has ZMQ_ROUTER_MANDATORY flag set to 1, the socket shall generate ZMQ_POLLIN events upon reception of messages from one or more peers. Likewise, the socket shall generate ZMQ_POLLOUT events when at least one message can be sent to one or more peers.

When a ZMQ_REQ socket is connected to a ZMQ_ROUTER socket, in addition to the routing id of the originating peer each message received shall contain an empty delimiter message part. Hence, the entire structure of each received message as seen by the application becomes: one or more routing id parts, delimiter part, one or more body parts. When sending replies to a ZMQ_REQ socket the application must include the delimiter part.

Summary of ZMQ_ROUTER characteristics
Compatible peer sockets

ZMQ_DEALER, ZMQ_REQ, ZMQ_ROUTER

Direction

Bidirectional

Send/receive pattern

Unrestricted

Outgoing routing strategy

See text

Incoming routing strategy

Fair-queued

Action in mute state

Drop (see text)

RETURN VALUE

The zmq_socket() function shall return an opaque handle to the newly created socket if successful. Otherwise, it shall return NULL and set errno to one of the values defined below.

ERRORS

EINVAL

The requested socket type is invalid.

EFAULT

The provided context is invalid.

EMFILE

The limit on the total number of open ØMQ sockets has been reached.

ETERM

The context specified was terminated.

EXAMPLE

Creating a simple HTTP server using ZMQ_STREAM
void *ctx = zmq_ctx_new ();
assert (ctx);
/* Create ZMQ_STREAM socket */
void *socket = zmq_socket (ctx, ZMQ_STREAM);
assert (socket);
int rc = zmq_bind (socket, "tcp://*:8080");
assert (rc == 0);
/* Data structure to hold the ZMQ_STREAM routing id */
uint8_t routing_id [256];
size_t routing_id_size = 256;
/* Data structure to hold the ZMQ_STREAM received data */
uint8_t raw [256];
size_t raw_size = 256;
while (1) {
        /*  Get HTTP request; routing id frame and then request */
        routing_id_size = zmq_recv (socket, routing_id, 256, 0);
        assert (routing_id_size > 0);
        do {
                raw_size = zmq_recv (socket, raw, 256, 0);
                assert (raw_size >= 0);
        } while (raw_size == 256);
        /* Prepares the response */
        char http_response [] =
                "HTTP/1.0 200 OK\r\n"
                "Content-Type: text/plain\r\n"
                "\r\n"
                "Hello, World!";
        /* Sends the routing id frame followed by the response */
        zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE);
        zmq_send (socket, http_response, strlen (http_response), 0);
        /* Closes the connection by sending the routing id frame followed by a zero response */
        zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE);
        zmq_send (socket, 0, 0, 0);
}
zmq_close (socket);
zmq_ctx_destroy (ctx);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_send.html0000664000372000037200000005547613255253331020105 0ustar00travistravis00000000000000 zmq_msg_send(3)

SYNOPSIS

int zmq_msg_send (zmq_msg_t *msg, void *socket, int flags);

DESCRIPTION

The zmq_msg_send() function is identical to zmq_sendmsg(3), which shall be deprecated in future versions. zmq_msg_send() is more consistent with other message manipulation functions.

The zmq_msg_send() function shall queue the message referenced by the msg argument to be sent to the socket referenced by the socket argument. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the socket, the zmq_msg_send() function shall fail with errno set to EAGAIN.

ZMQ_SNDMORE

Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description.

The zmq_msg_t structure passed to zmq_msg_send() is nullified during the call. If you want to send the same message to multiple sockets you have to copy it (e.g. using zmq_msg_copy()).

Note
A successful invocation of zmq_msg_send() does not indicate that the message has been transmitted to the network, only that it has been queued on the socket and ØMQ has assumed responsibility for the message. You do not need to call zmq_msg_close() after a successful zmq_msg_send().

Multi-part messages

A ØMQ message is composed of 1 or more message parts. Each message part is an independent zmq_msg_t in its own right. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that sends multi-part messages must use the ZMQ_SNDMORE flag when sending each message part except the final one.

RETURN VALUE

The zmq_msg_send() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and the message cannot be sent at the moment.

ENOTSUP

The zmq_msg_send() operation is not supported by this socket type.

EINVAL

The sender tried to send multipart data, which the socket type does not allow.

EFSM

The zmq_msg_send() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before the message was sent.

EFAULT

Invalid message.

EHOSTUNREACH

The message cannot be routed.

EXAMPLE

Filling in a message and sending it to a socket
/* Create a new message, allocating 6 bytes for message content */
zmq_msg_t msg;
int rc = zmq_msg_init_size (&msg, 6);
assert (rc == 0);
/* Fill in message content with 'AAAAAA' */
memset (zmq_msg_data (&msg), 'A', 6);
/* Send the message to the socket */
rc = zmq_msg_send (&msg, socket, 0);
assert (rc == 6);
Sending a multi-part message
/* Send a multi-part message consisting of three parts to socket */
rc = zmq_msg_send (&part1, socket, ZMQ_SNDMORE);
rc = zmq_msg_send (&part2, socket, ZMQ_SNDMORE);
/* Final part; no more parts to follow */
rc = zmq_msg_send (&part3, socket, 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_set.30000664000372000037200000000541413255253374021364 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_set .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_S" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_set \- set atomic counter to new value .SH "SYNOPSIS" .sp \fBvoid zmq_atomic_counter_set (void *counter, int value);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_set\fR function sets the counter to a new value, in a threadsafe fashion\&. The largest value that is guaranteed to work across all platforms is 2^31\-1\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_set()\fR function has no return value\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_new\fR(3) \fBzmq_atomic_counter_inc\fR(3) \fBzmq_atomic_counter_dec\fR(3) \fBzmq_atomic_counter_value\fR(3) \fBzmq_atomic_counter_destroy\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_shutdown.30000664000372000037200000000467413255253352020232 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ctx_shutdown .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CTX_SHUTDOWN" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_shutdown \- shutdown a 0MQ context .SH "SYNOPSIS" .sp \fBint zmq_ctx_shutdown (void \fR\fB\fI*context\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_shutdown()\fR function shall shutdown the 0MQ context \fIcontext\fR\&. .sp Context shutdown will cause any blocking operations currently in progress on sockets open within \fIcontext\fR to return immediately with an error code of ETERM\&. With the exception of \fIzmq_close()\fR, any further operations on sockets open within \fIcontext\fR shall fail with an error code of ETERM\&. .sp This function is optional, client code is still required to call the \fBzmq_ctx_term\fR(3) function to free all resources allocated by zeromq\&. .SH "RETURN VALUE" .sp The \fIzmq_ctx_shutdown()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEFAULT\fR .RS 4 The provided \fIcontext\fR was invalid\&. .RE .SH "SEE ALSO" .sp \fBzmq\fR(7) \fBzmq_init\fR(3) \fBzmq_ctx_term\fR(3) \fBzmq_close\fR(3) \fBzmq_setsockopt\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_strerror.30000664000372000037200000000452513255253367017364 0ustar00travistravis00000000000000'\" t .\" Title: zmq_strerror .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_STRERROR" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_strerror \- get 0MQ error message string .SH "SYNOPSIS" .sp \fBconst char *zmq_strerror (int \fR\fB\fIerrnum\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_strerror()\fR function shall return a pointer to an error message string corresponding to the error number specified by the \fIerrnum\fR argument\&. As 0MQ defines additional error numbers over and above those defined by the operating system, applications should use \fIzmq_strerror()\fR in preference to the standard \fIstrerror()\fR function\&. .SH "RETURN VALUE" .sp The \fIzmq_strerror()\fR function shall return a pointer to an error message string\&. .SH "ERRORS" .sp No errors are defined\&. .SH "EXAMPLE" .PP \fBDisplaying an error message when a 0MQ context cannot be initialised\fR. .sp .if n \{\ .RS 4 .\} .nf void *ctx = zmq_init (1, 1, 0); if (!ctx) { printf ("Error occurred during zmq_init(): %s\en", zmq_strerror (errno)); abort (); } .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_gets.html0000664000372000037200000005005713255253333020106 0ustar00travistravis00000000000000 zmq_msg_gets(3)

SYNOPSIS

const char *zmq_msg_gets (zmq_msg_t *message, const char *property);

DESCRIPTION

The zmq_msg_gets() function shall return the string value for the metadata property specified by the property argument for the message pointed to by the message argument. Both the property argument and the value shall be NULL-terminated UTF8-encoded strings.

Metadata is defined on a per-connection basis during the ZeroMQ connection handshake as specified in <rfc.zeromq.org/spec:37>. Applications can set metadata properties using zmq_setsockopt(3) option ZMQ_METADATA. Application metadata properties must be prefixed with X-.

In addition to application metadata, the following ZMTP properties can be retrieved with the zmq_msg_gets() function:

Socket-Type
Routing-Id

Note: Identity is a deprecated alias for Routing-Id.

Additionally, when available for the underlying transport, the Peer-Address property will return the IP address of the remote endpoint as returned by getnameinfo(2).

The names of these properties are also defined in zmq.h as ZMQ_MSG_PROPERTY_SOCKET_TYPE ZMQ_MSG_PROPERTY_ROUTING_ID, and ZMQ_MSG_PROPERTY_PEER_ADDRESS. Currently, these definitions are only available as a DRAFT API.

Other properties may be defined based on the underlying security mechanism, see ZAP authenticated connection sample below.

RETURN VALUE

The zmq_msg_gets() function shall return the string value for the property if successful. Otherwise it shall return NULL and set errno to one of the values defined below. The caller shall not modify or free the returned value, which shall be owned by the message. The encoding of the property and value shall be UTF8.

ERRORS

EINVAL

The requested property is unknown.

EXAMPLE

Getting the ZAP authenticated user id for a message:
zmq_msg_t msg;
zmq_msg_init (&msg);
rc = zmq_msg_recv (&msg, dealer, 0);
assert (rc != -1);
const char *user_id = zmq_msg_gets (&msg, ZMQ_MSG_PROPERTY_USER_ID);
zmq_msg_close (&msg);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_new.txt0000664000372000037200000000316313255253220022024 0ustar00travistravis00000000000000zmq_atomic_counter_new(3) ========================= NAME ---- zmq_atomic_counter_new - create a new atomic counter SYNOPSIS -------- *void *zmq_atomic_counter_new (void);* DESCRIPTION ----------- The _zmq_atomic_counter_new_ function creates a new atomic counter. You can use this in multithreaded applications to do, for example, reference counting of shared objects. The atomic counter is at least 32 bits large. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_new()_ function returns the new atomic counter if successful. Otherwise it returns NULL. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_value[3] linkzmq:zmq_atomic_counter_destroy[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq.txt0000664000372000037200000001754613255253220016072 0ustar00travistravis00000000000000zmq(7) ====== NAME ---- zmq - 0MQ lightweight messaging kernel SYNOPSIS -------- *#include * *cc* ['flags'] 'files' *-lzmq* ['libraries'] DESCRIPTION ----------- The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised _messaging middleware_ products. 0MQ sockets provide an abstraction of asynchronous _message queues_, multiple _messaging patterns_, message filtering (_subscriptions_), seamless access to multiple _transport protocols_ and more. This documentation presents an overview of 0MQ concepts, describes how 0MQ abstracts standard sockets and provides a reference manual for the functions provided by the 0MQ library. Context ~~~~~~~ The 0MQ 'context' keeps the list of sockets and manages the async I/O thread and internal queries. Before using any 0MQ library functions you must create a 0MQ 'context'. When you exit your application you must destroy the 'context'. These functions let you work with 'contexts': Create a new 0MQ context:: linkzmq:zmq_ctx_new[3] Work with context properties:: linkzmq:zmq_ctx_set[3] linkzmq:zmq_ctx_get[3] Destroy a 0MQ context:: linkzmq:zmq_ctx_shutdown[3] linkzmq:zmq_ctx_term[3] Thread safety ^^^^^^^^^^^^^ A 0MQ 'context' is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller. Individual 0MQ 'sockets' are _not_ thread safe except in the case where full memory barriers are issued when migrating a socket from one thread to another. In practice this means applications can create a socket in one thread with _zmq_socket()_ and then pass it to a _newly created_ thread as part of thread initialisation, for example via a structure passed as an argument to _pthread_create()_. Multiple contexts ^^^^^^^^^^^^^^^^^ Multiple 'contexts' may coexist within a single application. Thus, an application can use 0MQ directly and at the same time make use of any number of additional libraries or components which themselves make use of 0MQ as long as the above guidelines regarding thread safety are adhered to. Messages ~~~~~~~~ A 0MQ message is a discrete unit of data passed between applications or components of the same application. 0MQ messages have no internal structure and from the point of view of 0MQ itself they are considered to be opaque binary data. The following functions are provided to work with messages: Initialise a message:: linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] Sending and receiving a message:: linkzmq:zmq_msg_send[3] linkzmq:zmq_msg_recv[3] Release a message:: linkzmq:zmq_msg_close[3] Access message content:: linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_size[3] linkzmq:zmq_msg_more[3] Work with message properties:: linkzmq:zmq_msg_gets[3] linkzmq:zmq_msg_get[3] linkzmq:zmq_msg_set[3] Message manipulation:: linkzmq:zmq_msg_copy[3] linkzmq:zmq_msg_move[3] Sockets ~~~~~~~ 0MQ sockets present an abstraction of an asynchronous _message queue_, with the exact queueing semantics depending on the socket type in use. See linkzmq:zmq_socket[3] for the socket types provided. The following functions are provided to work with sockets: Creating a socket:: linkzmq:zmq_socket[3] Closing a socket:: linkzmq:zmq_close[3] Manipulating socket options:: linkzmq:zmq_getsockopt[3] linkzmq:zmq_setsockopt[3] Establishing a message flow:: linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] Sending and receiving messages:: linkzmq:zmq_msg_send[3] linkzmq:zmq_msg_recv[3] linkzmq:zmq_send[3] linkzmq:zmq_recv[3] linkzmq:zmq_send_const[3] Monitoring socket events:: linkzmq:zmq_socket_monitor[3] .Input/output multiplexing 0MQ provides a mechanism for applications to multiplex input/output events over a set containing both 0MQ sockets and standard sockets. This mechanism mirrors the standard _poll()_ system call, and is described in detail in linkzmq:zmq_poll[3]. Transports ~~~~~~~~~~ A 0MQ socket can use multiple different underlying transport mechanisms. Each transport mechanism is suited to a particular purpose and has its own advantages and drawbacks. The following transport mechanisms are provided: Unicast transport using TCP:: linkzmq:zmq_tcp[7] Reliable multicast transport using PGM:: linkzmq:zmq_pgm[7] Local inter-process communication transport:: linkzmq:zmq_ipc[7] Local in-process (inter-thread) communication transport:: linkzmq:zmq_inproc[7] Virtual Machine Communications Interface (VMC) transport:: linkzmq:zmq_vmci[7] Unreliable unicast and multicast using UDP:: linkzmq:zmq_udp[7] Proxies ~~~~~~~ 0MQ provides 'proxies' to create fanout and fan-in topologies. A proxy connects a 'frontend' socket to a 'backend' socket and switches all messages between the two sockets, opaquely. A proxy may optionally capture all traffic to a third socket. To start a proxy in an application thread, use linkzmq:zmq_proxy[3]. Security ~~~~~~~~ A 0MQ socket can select a security mechanism. Both peers must use the same security mechanism. The following security mechanisms are provided for IPC and TCP connections: Null security:: linkzmq:zmq_null[7] Plain-text authentication using username and password:: linkzmq:zmq_plain[7] Elliptic curve authentication and encryption:: linkzmq:zmq_curve[7] Generate a CURVE keypair in armored text format:: linkzmq:zmq_curve_keypair[3] Derive a CURVE public key from a secret key: linkzmq:zmq_curve_public[3] Converting keys to/from armoured text strings:: linkzmq:zmq_z85_decode[3] linkzmq:zmq_z85_encode[3] ERROR HANDLING -------------- The 0MQ library functions handle errors using the standard conventions found on POSIX systems. Generally, this means that upon failure a 0MQ library function shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the 'errno' variable. On non-POSIX systems some users may experience issues with retrieving the correct value of the 'errno' variable. The _zmq_errno()_ function is provided to assist in these cases; for details refer to linkzmq:zmq_errno[3]. The _zmq_strerror()_ function is provided to translate 0MQ-specific error codes into error message strings; for details refer to linkzmq:zmq_strerror[3]. UTILITY ------- The following utility functions are provided: Working with atomic counters:: linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_dec[3] linkzmq:zmq_atomic_counter_value[3] linkzmq:zmq_atomic_counter_destroy[3] MISCELLANEOUS ------------- The following miscellaneous functions are provided: Report 0MQ library version:: linkzmq:zmq_version[3] LANGUAGE BINDINGS ----------------- The 0MQ library provides interfaces suitable for calling from programs in any language; this documentation documents those interfaces as they would be used by C programmers. The intent is that programmers using 0MQ from other languages shall refer to this documentation alongside any documentation provided by the vendor of their language binding. Language bindings ($$C++$$, Python, PHP, Ruby, Java and more) are provided by members of the 0MQ community and pointers can be found on the 0MQ website. AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . RESOURCES --------- Main web site: Report bugs to the 0MQ development mailing list: COPYING ------- Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files `COPYING` and `COPYING.LESSER` included with the 0MQ distribution. zeromq-4.2.5/doc/zmq_bind.txt0000664000372000037200000000633113255253220017054 0ustar00travistravis00000000000000zmq_bind(3) =========== NAME ---- zmq_bind - accept incoming connections on a socket SYNOPSIS -------- *int zmq_bind (void '*socket', const char '*endpoint');* DESCRIPTION ----------- The _zmq_bind()_ function binds the 'socket' to a local 'endpoint' and then accepts incoming connections on that endpoint. The 'endpoint' is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to bind to. 0MQ provides the the following transports: 'tcp':: unicast transport using TCP, see linkzmq:zmq_tcp[7] 'ipc':: local inter-process communication transport, see linkzmq:zmq_ipc[7] 'inproc':: local in-process (inter-thread) communication transport, see linkzmq:zmq_inproc[7] 'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7] 'vmci':: virtual machine communications interface (VMCI), see linkzmq:zmq_vmci[7] Every 0MQ socket type except 'ZMQ_PAIR' supports one-to-many and many-to-one semantics. The precise semantics depend on the socket type and are defined in linkzmq:zmq_socket[3]. The 'ipc', 'tcp' and 'vmci' transports accept wildcard addresses: see linkzmq:zmq_ipc[7], linkzmq:zmq_tcp[7] and linkzmq:zmq_vmci[7] for details. NOTE: the address syntax may be different for _zmq_bind()_ and _zmq_connect()_ especially for the 'tcp', 'pgm' and 'epgm' transports. NOTE: following a _zmq_bind()_, the socket enters a 'mute' state unless or until at least one incoming or outgoing connection is made, at which point the socket enters a 'ready' state. In the mute state, the socket blocks or drops messages according to the socket type, as defined in linkzmq:zmq_socket[3]. By contrast, following a libzmq:zmq_connect[3], the socket enters the 'ready' state. RETURN VALUE ------------ The _zmq_bind()_ function returns zero if successful. Otherwise it returns `-1` and sets 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The endpoint supplied is invalid. *EPROTONOSUPPORT*:: The requested 'transport' protocol is not supported. *ENOCOMPATPROTO*:: The requested 'transport' protocol is not compatible with the socket type. *EADDRINUSE*:: The requested 'address' is already in use. *EADDRNOTAVAIL*:: The requested 'address' was not local. *ENODEV*:: The requested 'address' specifies a nonexistent interface. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EMTHREAD*:: No I/O thread is available to accomplish the task. EXAMPLE ------- .Binding a publisher socket to an in-process and a TCP transport ---- /* Create a ZMQ_PUB socket */ void *socket = zmq_socket (context, ZMQ_PUB); assert (socket); /* Bind it to a in-process transport with the address 'my_publisher' */ int rc = zmq_bind (socket, "inproc://my_publisher"); assert (rc == 0); /* Bind it to a TCP transport on port 5555 of the 'eth0' interface */ rc = zmq_bind (socket, "tcp://eth0:5555"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_connect[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_connect.txt0000664000372000037200000000651513255253220017575 0ustar00travistravis00000000000000zmq_connect(3) ============== NAME ---- zmq_connect - create outgoing connection from socket SYNOPSIS -------- *int zmq_connect (void '*socket', const char '*endpoint');* DESCRIPTION ----------- The _zmq_connect()_ function connects the 'socket' to an 'endpoint' and then accepts incoming connections on that endpoint. The 'endpoint' is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. 0MQ provides the the following transports: 'tcp':: unicast transport using TCP, see linkzmq:zmq_tcp[7] 'ipc':: local inter-process communication transport, see linkzmq:zmq_ipc[7] 'inproc':: local in-process (inter-thread) communication transport, see linkzmq:zmq_inproc[7] 'pgm', 'epgm':: reliable multicast transport using PGM, see linkzmq:zmq_pgm[7] 'vmci':: virtual machine communications interface (VMCI), see linkzmq:zmq_vmci[7] Every 0MQ socket type except 'ZMQ_PAIR' supports one-to-many and many-to-one semantics. The precise semantics depend on the socket type and are defined in linkzmq:zmq_socket[3]. NOTE: for most transports and socket types the connection is not performed immediately but as needed by 0MQ. Thus a successful call to _zmq_connect()_ does not mean that the connection was or could actually be established. Because of this, for most transports and socket types the order in which a 'server' socket is bound and a 'client' socket is connected to it does not matter. The _ZMQ_PAIR_ sockets are an exception, as they do not automatically reconnect to endpoints. NOTE: following a _zmq_connect()_, for socket types except for ZMQ_ROUTER, the socket enters its normal 'ready' state. By contrast, following a _zmq_bind()_ alone, the socket enters a 'mute' state in which the socket blocks or drops messages according to the socket type, as defined in linkzmq:zmq_socket[3]. A ZMQ_ROUTER socket enters its normal 'ready' state for a specific peer only when handshaking is complete for that peer, which may take an arbitrary time. RETURN VALUE ------------ The _zmq_connect()_ function returns zero if successful. Otherwise it returns `-1` and sets 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The endpoint supplied is invalid. *EPROTONOSUPPORT*:: The requested 'transport' protocol is not supported. *ENOCOMPATPROTO*:: The requested 'transport' protocol is not compatible with the socket type. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EMTHREAD*:: No I/O thread is available to accomplish the task. EXAMPLE ------- .Connecting a subscriber socket to an in-process and a TCP transport ---- /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to an in-process transport with the address 'my_publisher' */ int rc = zmq_connect (socket, "inproc://my_publisher"); assert (rc == 0); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_connect (socket, "tcp://server001:5555"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_more.30000664000372000037200000000532313255253362017302 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_more .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_MORE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_more \- indicate if there are more message parts to receive .SH "SYNOPSIS" .sp \fBint zmq_msg_more (zmq_msg_t \fR\fB\fI*message\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_more()\fR function indicates whether this is part of a multi\-part message, and there are further parts to receive\&. This method can safely be called after \fIzmq_msg_close()\fR\&. This method is identical to \fIzmq_msg_get()\fR with an argument of ZMQ_MORE\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_more()\fR function shall return zero if this is the final part of a multi\-part message, or the only part of a single\-part message\&. It shall return 1 if there are further parts to receive\&. .SH "EXAMPLE" .PP \fBReceiving a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_msg_t part; while (true) { // Create an empty 0MQ message to hold the message part int rc = zmq_msg_init (&part); assert (rc == 0); // Block until a message is available to be received from socket rc = zmq_msg_recv (socket, &part, 0); assert (rc != \-1); if (zmq_msg_more (&part)) fprintf (stderr, "more\en"); else { fprintf (stderr, "end\en"); break; } zmq_msg_close (&part); } .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_get\fR(3) \fBzmq_msg_set\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_set_routing_id.html0000664000372000037200000004422513255253332022161 0ustar00travistravis00000000000000 zmq_msg_set_routing_id(3)

SYNOPSIS

int zmq_msg_set_routing_id (zmq_msg_t *message, uint32_t routing_id);

DESCRIPTION

The zmq_msg_set_routing_id() function sets the routing_id specified, on the the message pointed to by the message argument. The routing_id must be greater than zero. To get a valid routing ID, you must receive a message from a ZMQ_SERVER socket, and use the libzmq:zmq_msg_routing_id method. Routing IDs are transient.

RETURN VALUE

The zmq_msg_set_routing_id() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The provided routing_id is zero.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_new.html0000664000372000037200000004547713255253341022173 0ustar00travistravis00000000000000 zmq_atomic_counter_new(3)

SYNOPSIS

void *zmq_atomic_counter_new (void);

DESCRIPTION

The zmq_atomic_counter_new function creates a new atomic counter. You can use this in multithreaded applications to do, for example, reference counting of shared objects. The atomic counter is at least 32 bits large. This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_new() function returns the new atomic counter if successful. Otherwise it returns NULL.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_close.html0000664000372000037200000004541113255253331020245 0ustar00travistravis00000000000000 zmq_msg_close(3)

SYNOPSIS

int zmq_msg_close (zmq_msg_t *msg);

DESCRIPTION

The zmq_msg_close() function shall inform the ØMQ infrastructure that any resources associated with the message object referenced by msg are no longer required and may be released. Actual release of resources associated with the message object shall be postponed by ØMQ until all users of the message or underlying data buffer have indicated it is no longer required.

Applications should ensure that zmq_msg_close() is called once a message is no longer required, otherwise memory leaks may occur. Note that this is NOT necessary after a successful zmq_msg_send().

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.

RETURN VALUE

The zmq_msg_close() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EFAULT

Invalid message.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_ctx_term.txt0000664000372000037200000000345113255253220017765 0ustar00travistravis00000000000000zmq_ctx_term(3) =============== NAME ---- zmq_ctx_term - terminate a 0MQ context SYNOPSIS -------- *int zmq_ctx_term (void '*context');* DESCRIPTION ----------- The _zmq_ctx_term()_ function shall destroy the 0MQ context 'context'. Context termination is performed in the following steps: 1. Any blocking operations currently in progress on sockets open within 'context' shall return immediately with an error code of ETERM. With the exception of _zmq_close()_, any further operations on sockets open within 'context' shall fail with an error code of ETERM. 2. After interrupting all blocking calls, _zmq_ctx_term()_ shall _block_ until the following conditions are satisfied: * All sockets open within 'context' have been closed with _zmq_close()_. * For each socket within 'context', all messages sent by the application with _zmq_send()_ have either been physically transferred to a network peer, or the socket's linger period set with the _ZMQ_LINGER_ socket option has expired. For further details regarding socket linger behaviour refer to the _ZMQ_LINGER_ option in linkzmq:zmq_setsockopt[3]. This function replaces the deprecated functions linkzmq:zmq_term[3] and linkzmq:zmq_ctx_destroy[3]. RETURN VALUE ------------ The _zmq_ctx_term()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EFAULT*:: The provided 'context' was invalid. *EINTR*:: Termination was interrupted by a signal. It can be restarted if needed. SEE ALSO -------- linkzmq:zmq[7] linkzmq:zmq_init[3] linkzmq:zmq_close[3] linkzmq:zmq_setsockopt[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_atomic_counter_new.30000664000372000037200000000553213255253373021362 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_new .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_N" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_new \- create a new atomic counter .SH "SYNOPSIS" .sp \fBvoid *zmq_atomic_counter_new (void);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_new\fR function creates a new atomic counter\&. You can use this in multithreaded applications to do, for example, reference counting of shared objects\&. The atomic counter is at least 32 bits large\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_new()\fR function returns the new atomic counter if successful\&. Otherwise it returns NULL\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_set\fR(3) \fBzmq_atomic_counter_inc\fR(3) \fBzmq_atomic_counter_dec\fR(3) \fBzmq_atomic_counter_value\fR(3) \fBzmq_atomic_counter_destroy\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_set.html0000664000372000037200000004410213255253333017731 0ustar00travistravis00000000000000 zmq_msg_set(3)

SYNOPSIS

int zmq_msg_set (zmq_msg_t *message, int property, int value);

DESCRIPTION

The zmq_msg_set() function shall set the property specified by the property argument to the value of the value argument for the ØMQ message fragment pointed to by the message argument.

Currently the zmq_msg_set() function does not support any property names.

RETURN VALUE

The zmq_msg_set() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested property property is unknown.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_recv.30000664000372000037200000001042613255253360016427 0ustar00travistravis00000000000000'\" t .\" Title: zmq_recv .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_RECV" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_recv \- receive a message part from a socket .SH "SYNOPSIS" .sp \fBint zmq_recv (void \fR\fB\fI*socket\fR\fR\fB, void \fR\fB\fI*buf\fR\fR\fB, size_t \fR\fB\fIlen\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_recv()\fR function shall receive a message from the socket referenced by the \fIsocket\fR argument and store it in the buffer referenced by the \fIbuf\fR argument\&. Any bytes exceeding the length specified by the \fIlen\fR argument shall be truncated\&. If there are no messages available on the specified \fIsocket\fR the \fIzmq_recv()\fR function shall block until the request can be satisfied\&. The \fIflags\fR argument is a combination of the flags defined below: The \fIbuf\fR argument may be null if len is zero\&. .PP \fBZMQ_DONTWAIT\fR .RS 4 Specifies that the operation should be performed in non\-blocking mode\&. If there are no messages available on the specified \fIsocket\fR, the \fIzmq_recv()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that processes multi\-part messages must use the \fIZMQ_RCVMORE\fR \fBzmq_getsockopt\fR(3) option after calling \fIzmq_recv()\fR to determine if there are further parts to receive\&. .SH "RETURN VALUE" .sp The \fIzmq_recv()\fR function shall return number of bytes in the message if successful\&. Note that the value can exceed the value of the \fIlen\fR parameter in case the message was truncated\&. If not successful the function shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and no messages are available at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_recv()\fR operation is not supported by this socket type\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_recv()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before a message was available\&. .RE .SH "EXAMPLE" .PP \fBReceiving a message from a socket\fR. .sp .if n \{\ .RS 4 .\} .nf char buf [256]; nbytes = zmq_recv (socket, buf, 256, 0); assert (nbytes != \-1); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq.html0000664000372000037200000007337613255253344016231 0ustar00travistravis00000000000000 zmq(7)

SYNOPSIS

#include <zmq.h>

cc [flags] files -lzmq [libraries]

DESCRIPTION

The ØMQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised messaging middleware products. ØMQ sockets provide an abstraction of asynchronous message queues, multiple messaging patterns, message filtering (subscriptions), seamless access to multiple transport protocols and more.

This documentation presents an overview of ØMQ concepts, describes how ØMQ abstracts standard sockets and provides a reference manual for the functions provided by the ØMQ library.

Context

The ØMQ context keeps the list of sockets and manages the async I/O thread and internal queries.

Before using any ØMQ library functions you must create a ØMQ context. When you exit your application you must destroy the context. These functions let you work with contexts:

Create a new ØMQ context

zmq_ctx_new(3)

Work with context properties

zmq_ctx_set(3) zmq_ctx_get(3)

Destroy a ØMQ context

zmq_ctx_shutdown(3) zmq_ctx_term(3)

Thread safety

A ØMQ context is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller.

Individual ØMQ sockets are not thread safe except in the case where full memory barriers are issued when migrating a socket from one thread to another. In practice this means applications can create a socket in one thread with zmq_socket() and then pass it to a newly created thread as part of thread initialisation, for example via a structure passed as an argument to pthread_create().

Multiple contexts

Multiple contexts may coexist within a single application. Thus, an application can use ØMQ directly and at the same time make use of any number of additional libraries or components which themselves make use of ØMQ as long as the above guidelines regarding thread safety are adhered to.

Messages

A ØMQ message is a discrete unit of data passed between applications or components of the same application. ØMQ messages have no internal structure and from the point of view of ØMQ itself they are considered to be opaque binary data.

The following functions are provided to work with messages:

Initialise a message

zmq_msg_init(3) zmq_msg_init_size(3) zmq_msg_init_data(3)

Sending and receiving a message

zmq_msg_send(3) zmq_msg_recv(3)

Release a message

zmq_msg_close(3)

Access message content

zmq_msg_data(3) zmq_msg_size(3) zmq_msg_more(3)

Work with message properties

zmq_msg_gets(3) zmq_msg_get(3) zmq_msg_set(3)

Message manipulation

zmq_msg_copy(3) zmq_msg_move(3)

Sockets

ØMQ sockets present an abstraction of an asynchronous message queue, with the exact queueing semantics depending on the socket type in use. See zmq_socket(3) for the socket types provided.

The following functions are provided to work with sockets:

Creating a socket

zmq_socket(3)

Closing a socket

zmq_close(3)

Manipulating socket options

zmq_getsockopt(3) zmq_setsockopt(3)

Establishing a message flow

zmq_bind(3) zmq_connect(3)

Sending and receiving messages

zmq_msg_send(3) zmq_msg_recv(3) zmq_send(3) zmq_recv(3) zmq_send_const(3)

Monitoring socket events

zmq_socket_monitor(3)

Input/output multiplexing

ØMQ provides a mechanism for applications to multiplex input/output events over a set containing both ØMQ sockets and standard sockets. This mechanism mirrors the standard poll() system call, and is described in detail in zmq_poll(3).

Transports

A ØMQ socket can use multiple different underlying transport mechanisms. Each transport mechanism is suited to a particular purpose and has its own advantages and drawbacks.

The following transport mechanisms are provided:

Unicast transport using TCP

zmq_tcp(7)

Reliable multicast transport using PGM

zmq_pgm(7)

Local inter-process communication transport

zmq_ipc(7)

Local in-process (inter-thread) communication transport

zmq_inproc(7)

Virtual Machine Communications Interface (VMC) transport

zmq_vmci(7)

Unreliable unicast and multicast using UDP

zmq_udp(7)

Proxies

ØMQ provides proxies to create fanout and fan-in topologies. A proxy connects a frontend socket to a backend socket and switches all messages between the two sockets, opaquely. A proxy may optionally capture all traffic to a third socket. To start a proxy in an application thread, use zmq_proxy(3).

Security

A ØMQ socket can select a security mechanism. Both peers must use the same security mechanism.

The following security mechanisms are provided for IPC and TCP connections:

Null security

zmq_null(7)

Plain-text authentication using username and password

zmq_plain(7)

Elliptic curve authentication and encryption

zmq_curve(7)

Generate a CURVE keypair in armored text format

zmq_curve_keypair(3)

Derive a CURVE public key from a secret key: zmq_curve_public(3)

Converting keys to/from armoured text strings

zmq_z85_decode(3) zmq_z85_encode(3)

ERROR HANDLING

The ØMQ library functions handle errors using the standard conventions found on POSIX systems. Generally, this means that upon failure a ØMQ library function shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the errno variable.

On non-POSIX systems some users may experience issues with retrieving the correct value of the errno variable. The zmq_errno() function is provided to assist in these cases; for details refer to zmq_errno(3).

The zmq_strerror() function is provided to translate ØMQ-specific error codes into error message strings; for details refer to zmq_strerror(3).

MISCELLANEOUS

The following miscellaneous functions are provided:

Report ØMQ library version

zmq_version(3)

LANGUAGE BINDINGS

The ØMQ library provides interfaces suitable for calling from programs in any language; this documentation documents those interfaces as they would be used by C programmers. The intent is that programmers using ØMQ from other languages shall refer to this documentation alongside any documentation provided by the vendor of their language binding.

Language bindings (C++, Python, PHP, Ruby, Java and more) are provided by members of the ØMQ community and pointers can be found on the ØMQ website.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.

RESOURCES

Main web site: http://www.zeromq.org/

Report bugs to the ØMQ development mailing list: <zeromq-dev@lists.zeromq.org>

COPYING

Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL). For details see the files COPYING and COPYING.LESSER included with the ØMQ distribution.


zeromq-4.2.5/doc/zmq_msg_recv.30000664000372000037200000001243513255253356017304 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_recv .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_RECV" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_recv \- receive a message part from a socket .SH "SYNOPSIS" .sp \fBint zmq_msg_recv (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_recv()\fR function is identical to \fBzmq_recvmsg\fR(3), which shall be deprecated in future versions\&. \fIzmq_msg_recv()\fR is more consistent with other message manipulation functions\&. .sp The \fIzmq_msg_recv()\fR function shall receive a message part from the socket referenced by the \fIsocket\fR argument and store it in the message referenced by the \fImsg\fR argument\&. Any content previously stored in \fImsg\fR shall be properly deallocated\&. If there are no message parts available on the specified \fIsocket\fR the \fIzmq_msg_recv()\fR function shall block until the request can be satisfied\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 Specifies that the operation should be performed in non\-blocking mode\&. If there are no messages available on the specified \fIsocket\fR, the \fIzmq_msg_recv()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. Each message part is an independent \fIzmq_msg_t\fR in its own right\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that processes multi\-part messages must use the \fIZMQ_RCVMORE\fR \fBzmq_getsockopt\fR(3) option after calling \fIzmq_msg_recv()\fR to determine if there are further parts to receive\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_recv()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and no messages are available at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_msg_recv()\fR operation is not supported by this socket type\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_msg_recv()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before a message was available\&. .RE .PP \fBEFAULT\fR .RS 4 The message passed to the function was invalid\&. .RE .SH "EXAMPLE" .PP \fBReceiving a message from a socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create an empty 0MQ message */ zmq_msg_t msg; int rc = zmq_msg_init (&msg); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_msg_recv (&msg, socket, 0); assert (rc != \-1); /* Release message */ zmq_msg_close (&msg); .fi .if n \{\ .RE .\} .PP \fBReceiving a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf int more; size_t more_size = sizeof (more); do { /* Create an empty 0MQ message to hold the message part */ zmq_msg_t part; int rc = zmq_msg_init (&part); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_msg_recv (&part, socket, 0); assert (rc != \-1); /* Determine if more message parts are to follow */ rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); zmq_msg_close (&part); } while (more); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_msg_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_term.html0000664000372000037200000004666213255253327020135 0ustar00travistravis00000000000000 zmq_ctx_term(3)

SYNOPSIS

int zmq_ctx_term (void *context);

DESCRIPTION

The zmq_ctx_term() function shall destroy the ØMQ context context.

Context termination is performed in the following steps:

  1. Any blocking operations currently in progress on sockets open within context shall return immediately with an error code of ETERM. With the exception of zmq_close(), any further operations on sockets open within context shall fail with an error code of ETERM.

  2. After interrupting all blocking calls, zmq_ctx_term() shall block until the following conditions are satisfied:

    • All sockets open within context have been closed with zmq_close().

    • For each socket within context, all messages sent by the application with zmq_send() have either been physically transferred to a network peer, or the socket’s linger period set with the ZMQ_LINGER socket option has expired.

For further details regarding socket linger behaviour refer to the ZMQ_LINGER option in zmq_setsockopt(3).

This function replaces the deprecated functions zmq_term(3) and zmq_ctx_destroy(3).

RETURN VALUE

The zmq_ctx_term() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EFAULT

The provided context was invalid.

EINTR

Termination was interrupted by a signal. It can be restarted if needed.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_errno.txt0000664000372000037200000000220413255253220017260 0ustar00travistravis00000000000000zmq_errno(3) ============ NAME ---- zmq_errno - retrieve value of errno for the calling thread SYNOPSIS -------- *int zmq_errno (void);* DESCRIPTION ----------- The _zmq_errno()_ function shall retrieve the value of the 'errno' variable for the calling thread. The _zmq_errno()_ function is provided to assist users on non-POSIX systems who are experiencing issues with retrieving the correct value of 'errno' directly. Specifically, users on Win32 systems whose application is using a different C run-time library from the C run-time library in use by 0MQ will need to use _zmq_errno()_ for correct operation. IMPORTANT: Users not experiencing issues with retrieving the correct value of 'errno' should not use this function and should instead access the 'errno' variable directly. RETURN VALUE ------------ The _zmq_errno()_ function shall return the value of the 'errno' variable for the calling thread. ERRORS ------ No errors are defined. SEE ALSO -------- linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_getsockopt.30000664000372000037200000012224013255253365017655 0ustar00travistravis00000000000000'\" t .\" Title: zmq_getsockopt .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_GETSOCKOPT" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_getsockopt \- get 0MQ socket options .SH "SYNOPSIS" .sp \fBint zmq_getsockopt (void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fI*option_len\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_getsockopt()\fR function shall retrieve the value for the option specified by the \fIoption_name\fR argument for the 0MQ socket pointed to by the \fIsocket\fR argument, and store it in the buffer pointed to by the \fIoption_value\fR argument\&. The \fIoption_len\fR argument is the size in bytes of the buffer pointed to by \fIoption_value\fR; upon successful completion \fIzmq_getsockopt()\fR shall modify the \fIoption_len\fR argument to indicate the actual size of the option value stored in the buffer\&. .sp The following options can be retrieved with the \fIzmq_getsockopt()\fR function: .SS "ZMQ_AFFINITY: Retrieve I/O thread affinity" .sp The \fIZMQ_AFFINITY\fR option shall retrieve the I/O thread affinity for newly created connections on the specified \fIsocket\fR\&. .sp Affinity determines which threads from the 0MQ I/O thread pool associated with the socket\(cqs \fIcontext\fR shall handle newly created connections\&. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all 0MQ I/O threads in the thread pool\&. For non\-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on\&. For example, a value of 3 specifies that subsequent connections on \fIsocket\fR shall be handled exclusively by I/O threads 1 and 2\&. .sp See also \fBzmq_init\fR(3) for details on allocating the number of I/O threads for a specific \fIcontext\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp N/A (bitmap) T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp N/A T} .TE .sp 1 .SS "ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections" .sp The \fIZMQ_BACKLOG\fR option shall retrieve the maximum length of the queue of outstanding peer connections for the specified \fIsocket\fR; this only applies to connection\-oriented transports\&. For details refer to your operating system documentation for the \fIlisten\fR function\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp connections T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_BINDTODEVICE: Retrieve name of device the socket is bound to" .sp The \fIZMQ_BINDTODEVICE\fR option retrieves the name of the device this socket is bound to, eg\&. an interface or VRF\&. If a socket is bound to an interface, only packets received from that interface are processed by the socket\&. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or UDP transports\&. T} .TE .sp 1 .SS "ZMQ_CONNECT_TIMEOUT: Retrieve connect() timeout" .sp Retrieves how long to wait before timing\-out a connect() system call\&. The connect() system call normally takes a long time before it returns a time out error\&. Setting this option allows the library to time out the call at an earlier interval\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (disabled) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key" .sp Retrieves the current long term public key for the socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format\&. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40\-char key value and one null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp null T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key" .sp Retrieves the current long term secret key for the socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format\&. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40\-char key value and one null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp null T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key" .sp Retrieves the current server key for the client socket\&. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41\-byte buffer, to retrieve the key in a printable Z85 format\&. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40\-char key value and one null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp null T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_EVENTS: Retrieve socket event state" .sp The \fIZMQ_EVENTS\fR option shall retrieve the event state for the specified \fIsocket\fR\&. The returned value is a bit mask constructed by OR\(cqing a combination of the following event flags: .PP \fBZMQ_POLLIN\fR .RS 4 Indicates that at least one message may be received from the specified socket without blocking\&. .RE .PP \fBZMQ_POLLOUT\fR .RS 4 Indicates that at least one message may be sent to the specified socket without blocking\&. .RE .sp The combination of a file descriptor returned by the \fIZMQ_FD\fR option being ready for reading but no actual events returned by a subsequent retrieval of the \fIZMQ_EVENTS\fR option is valid; applications should simply ignore this case and restart their polling operation/event loop\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp N/A (flags) T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_FD: Retrieve file descriptor associated with the socket" .sp The \fIZMQ_FD\fR option shall retrieve the file descriptor associated with the specified \fIsocket\fR\&. The returned file descriptor can be used to integrate the socket into an existing event loop; the 0MQ library shall signal any pending events on the socket in an \fIedge\-triggered\fR fashion by making the file descriptor become ready for reading\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The ability to read from the returned file descriptor does not necessarily indicate that messages are available to be read from, or can be written to, the underlying socket; applications must retrieve the actual event state with a subsequent retrieval of the \fIZMQ_EVENTS\fR option\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The returned file descriptor is also used internally by the \fIzmq_send\fR and \fIzmq_recv\fR functions\&. As the descriptor is edge triggered, applications must update the state of \fIZMQ_EVENTS\fR after each invocation of \fIzmq_send\fR or \fIzmq_recv\fR\&.To be more explicit: after calling \fIzmq_send\fR the socket may become readable (and vice versa) without triggering a read event on the file descriptor\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The returned file descriptor is intended for use with a \fIpoll\fR or similar system call only\&. Applications must never attempt to read or write data to it directly, neither should they try to close it\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int on POSIX systems, SOCKET on Windows T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_GSSAPI_PLAINTEXT: Retrieve GSSAPI plaintext or encrypted status" .sp Returns the \fIZMQ_GSSAPI_PLAINTEXT\fR option, if any, previously set on the socket\&. A value of \fI1\fR means that communications will be plaintext\&. A value of \fI0\fR means communications will be encrypted\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_GSSAPI_PRINCIPAL: Retrieve the name of the GSSAPI principal" .sp The \fIZMQ_GSSAPI_PRINCIPAL\fR option shall retrieve the principal name set for the GSSAPI security mechanism\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp null string T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVER: Retrieve current GSSAPI server role" .sp Returns the \fIZMQ_GSSAPI_SERVER\fR option, if any, previously set on the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVICE_PRINCIPAL: Retrieve the name of the GSSAPI service principal" .sp The \fIZMQ_GSSAPI_SERVICE_PRINCIPAL\fR option shall retrieve the principal name of the GSSAPI server to which a GSSAPI client socket intends to connect\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp null string T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal" .sp Returns the \fIZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE\fR option, if any, previously set on the socket\&. A value of \fIZMQ_GSSAPI_NT_HOSTBASED\fR (0) means the name specified with \fIZMQ_GSSAPI_SERVICE_PRINCIPAL\fR is interpreted as a host based name\&. A value of \fIZMQ_GSSAPI_NT_USER_NAME\fR (1) means it is interpreted as a local user name\&. A value of \fIZMQ_GSSAPI_NT_KRB5_PRINCIPAL\fR (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1, 2 T} T{ .sp Default value T}:T{ .sp 0 (ZMQ_GSSAPI_NT_HOSTBASED) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal" .sp Returns the \fIZMQ_GSSAPI_PRINCIPAL_NAMETYPE\fR option, if any, previously set on the socket\&. A value of \fIZMQ_GSSAPI_NT_HOSTBASED\fR (0) means the name specified with \fIZMQ_GSSAPI_PRINCIPAL\fR is interpreted as a host based name\&. A value of \fIZMQ_GSSAPI_NT_USER_NAME\fR (1) means it is interpreted as a local user name\&. A value of \fIZMQ_GSSAPI_NT_KRB5_PRINCIPAL\fR (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1, 2 T} T{ .sp Default value T}:T{ .sp 0 (ZMQ_GSSAPI_NT_HOSTBASED) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_HANDSHAKE_IVL: Retrieve maximum handshake interval" .sp The \fIZMQ_HANDSHAKE_IVL\fR option shall retrieve the maximum handshake interval for the specified \fIsocket\fR\&. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection\-oriented transports\&. If handshaking does not complete within the configured time, the connection shall be closed\&. The value 0 means no handshake time limit\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 30000 T} T{ .sp Applicable socket types T}:T{ .sp all but ZMQ_STREAM, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_IDENTITY: Retrieve socket identity" .sp This option name is now deprecated\&. Use ZMQ_ROUTING_ID instead\&. ZMQ_IDENTITY remains as an alias for now\&. .SS "ZMQ_IMMEDIATE: Retrieve attach\-on\-connect value" .sp Retrieve the state of the attach on connect value\&. If set to 1, will delay the attachment of a pipe on connect until the underlying connection has completed\&. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, primarily when using TCP/IPC transports\&. T} .TE .sp 1 .SS "ZMQ_INVERT_MATCHING: Retrieve inverted filtering status" .sp Returns the value of the \fIZMQ_INVERT_MATCHING\fR option\&. A value of 1 means the socket uses inverted prefix matching\&. .sp On \fIPUB\fR and \fIXPUB\fR sockets, this causes messages to be sent to all connected sockets \fIexcept\fR those subscribed to a prefix that matches the message\&. On \fISUB\fR sockets, this causes only incoming messages that do \fInot\fR match any of the socket\(cqs subscriptions to be received by the user\&. .sp Whenever \fIZMQ_INVERT_MATCHING\fR is set to 1 on a \fIPUB\fR socket, all \fISUB\fR sockets connecting to it must also have the option set to 1\&. Failure to do so will have the \fISUB\fR sockets reject everything the \fIPUB\fR socket sends them\&. \fIXSUB\fR sockets do not need to do this because they do not filter incoming messages\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0,1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB T} .TE .sp 1 .SS "ZMQ_IPV4ONLY: Retrieve IPv4\-only socket override status" .sp Retrieve the IPv4\-only option for the socket\&. This option is deprecated\&. Please use the ZMQ_IPV6 option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 1 (true) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_IPV6: Retrieve IPv6 socket status" .sp Retrieve the IPv6 option for the socket\&. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4\&. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set" .sp The \fIZMQ_LAST_ENDPOINT\fR option shall retrieve the last endpoint bound for TCP and IPC transports\&. The returned value will be a string in the form of a ZMQ DSN\&. Note that if the TCP host is INADDR_ANY, indicated by a *, then the returned address will be 0\&.0\&.0\&.0 (for IPv4)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp all, when binding TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_LINGER: Retrieve linger period for socket shutdown" .sp The \fIZMQ_LINGER\fR option shall retrieve the linger period for the specified \fIsocket\fR\&. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with \fBzmq_close\fR(3), and further affects the termination of the socket\(cqs context with \fBzmq_ctx_term\fR(3)\&. The following outlines the different behaviours: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The default value of \fI\-1\fR specifies an infinite linger period\&. Pending messages shall not be discarded after a call to \fIzmq_close()\fR; attempting to terminate the socket\(cqs context with \fIzmq_ctx_term()\fR shall block until all pending messages have been sent to a peer\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The value of \fI0\fR specifies no linger period\&. Pending messages shall be discarded immediately when the socket is closed with \fIzmq_close()\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Positive values specify an upper bound for the linger period in milliseconds\&. Pending messages shall not be discarded after a call to \fIzmq_close()\fR; attempting to terminate the socket\(cqs context with \fIzmq_ctx_term()\fR shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ Option value type T}:T{ int T} T{ Option value unit T}:T{ milliseconds T} T{ Default value T}:T{ \-1 (infinite) T} T{ Applicable socket types T}:T{ all T} .TE .sp 1 .RE .SS "ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size" .sp The option shall retrieve limit for the inbound messages\&. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected\&. Value of \-1 means \fIno limit\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_MECHANISM: Retrieve current security mechanism" .sp The \fIZMQ_MECHANISM\fR option shall retrieve the current security mechanism for the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp ZMQ_NULL, ZMQ_PLAIN, ZMQ_CURVE, or ZMQ_GSSAPI T} T{ .sp Default value T}:T{ .sp ZMQ_NULL T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets" .sp The option shall retrieve time\-to\-live used for outbound multicast packets\&. The default of 1 means that the multicast packets don\(cqt leave the local network\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp network hops T} T{ .sp Default value T}:T{ .sp 1 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets" .sp The \fIZMQ_MULTICAST_MAXTPDU\fR option shall retrieve the maximum transport data unit size used for outbound multicast packets\&. .sp This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 1500 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_PLAIN_PASSWORD: Retrieve current password" .sp The \fIZMQ_PLAIN_PASSWORD\fR option shall retrieve the last password set for the PLAIN security mechanism\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp null string T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role" .sp Returns the \fIZMQ_PLAIN_SERVER\fR option, if any, previously set on the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp int T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username" .sp The \fIZMQ_PLAIN_USERNAME\fR option shall retrieve the last username set for the PLAIN security mechanism\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp null string T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transports T} .TE .sp 1 .SS "ZMQ_USE_FD: Retrieve the pre\-allocated socket file descriptor" .sp The \fIZMQ_USE_FD\fR option shall retrieve the pre\-allocated file descriptor that has been assigned to a ZMQ socket, if any\&. \-1 shall be returned if a pre\-allocated file descriptor was not set for the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp file descriptor T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all bound sockets, when using IPC or TCP transport T} .TE .sp 1 .SS "ZMQ_RATE: Retrieve multicast data rate" .sp The \fIZMQ_RATE\fR option shall retrieve the maximum send or receive data rate for multicast transports using the specified \fIsocket\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp kilobits per second T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_RCVBUF: Retrieve kernel receive buffer size" .sp The \fIZMQ_RCVBUF\fR option shall retrieve the underlying kernel receive buffer size for the specified \fIsocket\fR\&. For details refer to your operating system documentation for the \fISO_RCVBUF\fR socket option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 8192 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RCVHWM: Retrieve high water mark for inbound messages" .sp The \fIZMQ_RCVHWM\fR option shall return the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&. .sp If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp messages T} T{ .sp Default value T}:T{ .sp 1000 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RCVMORE: More message data parts to follow" .sp The \fIZMQ_RCVMORE\fR option shall return True (1) if the message part last received from the \fIsocket\fR was a data part with more parts to follow\&. If there are no data parts to follow, this option shall return False (0)\&. .sp Refer to \fBzmq_send\fR(3) and \fBzmq_recv\fR(3) for a detailed description of multi\-part messages\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN" .sp Retrieve the timeout for recv operation on the socket\&. If the value is 0, \fIzmq_recv(3)\fR will return immediately, with a EAGAIN error if there is no message to receive\&. If the value is \-1, it will block until a message is available\&. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 (infinite) T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RECONNECT_IVL: Retrieve reconnection interval" .sp The \fIZMQ_RECONNECT_IVL\fR option shall retrieve the initial reconnection interval for the specified \fIsocket\fR\&. The reconnection interval is the period 0MQ shall wait between attempts to reconnect disconnected peers when using connection\-oriented transports\&. The value \-1 means no reconnection\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The reconnection interval may be randomized by 0MQ to prevent reconnection storms in topologies with a large number of peers per socket\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval" .sp The \fIZMQ_RECONNECT_IVL_MAX\fR option shall retrieve the maximum reconnection interval for the specified \fIsocket\fR\&. This is the maximum period 0MQ shall wait between attempts to reconnect\&. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached\&. This allows for exponential backoff strategy\&. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Values less than ZMQ_RECONNECT_IVL will be ignored\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (only use ZMQ_RECONNECT_IVL) T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transport T} .TE .sp 1 .SS "ZMQ_RECOVERY_IVL: Get multicast recovery interval" .sp The \fIZMQ_RECOVERY_IVL\fR option shall retrieve the recovery interval for multicast transports using the specified \fIsocket\fR\&. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 10000 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_ROUTING_ID: Retrieve socket routing id" .sp The \fIZMQ_ROUTING_ID\fR option shall retrieve the routing id of the specified \fIsocket\fR\&. Routing ids are used only by the request/reply pattern\&. Specifically, it can be used in tandem with ROUTER socket to route messages to the peer with a specific routing id\&. .sp A routing id must be at least one byte and at most 255 bytes long\&. Identities starting with a zero byte are reserved for use by the 0MQ infrastructure\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER\&. T} .TE .sp 1 .SS "ZMQ_SNDBUF: Retrieve kernel transmit buffer size" .sp The \fIZMQ_SNDBUF\fR option shall retrieve the underlying kernel transmit buffer size for the specified \fIsocket\fR\&. For details refer to your operating system documentation for the \fISO_SNDBUF\fR socket option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 8192 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SNDHWM: Retrieves high water mark for outbound messages" .sp The \fIZMQ_SNDHWM\fR option shall return the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&. .sp If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp messages T} T{ .sp Default value T}:T{ .sp 1000 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN" .sp Retrieve the timeout for send operation on the socket\&. If the value is 0, \fIzmq_send(3)\fR will return immediately, with a EAGAIN error if the message cannot be sent\&. If the value is \-1, it will block until the message is sent\&. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 (infinite) T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SOCKS_PROXY: Retrieve SOCKS5 proxy address" .sp The \fIZMQ_SOCKS_PROXY\fR option shall retrieve the SOCKS5 proxy address in string format\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp NULL\-terminated character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp null string T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option" .sp Override \fISO_KEEPALIVE\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,0,1 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option" .sp Override \fITCP_KEEPCNT\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS)" .sp Override \fITCP_KEEPIDLE\fR(or \fITCP_KEEPALIVE\fR on some OS) socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option" .sp Override \fITCP_KEEPINTVL\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_MAXRT: Retrieve Max TCP Retransmit Timeout" .sp On OSes where it is supported, retrieves how long before an unacknowledged TCP retransmit times out\&. The system normally attempts many TCP retransmits following an exponential backoff strategy\&. This means that after a network outage, it may take a long time before the session can be re\-established\&. Setting this option allows the timeout to happen at a shorter interval\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_THREAD_SAFE: Retrieve socket thread safety" .sp The \fIZMQ_THREAD_SAFE\fR option shall retrieve a boolean value indicating whether or not the socket is threadsafe\&. Currently \fIZMQ_CLIENT\fR and \fIZMQ_SERVER\fR sockets are threadsafe\&. .TS tab(:); lt lt lt lt. T{ .sp Option value type T}:T{ .sp boolean T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_TOS: Retrieve the Type\-of\-Service socket override status" .sp Retrieve the IP_TOS option for the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp >0 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_TYPE: Retrieve socket type" .sp The \fIZMQ_TYPE\fR option shall retrieve the socket type for the specified \fIsocket\fR\&. The socket type is specified at socket creation time and cannot be modified afterwards\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain" .sp The \fIZMQ_ZAP_DOMAIN\fR option shall retrieve the last ZAP domain set for the socket\&. The returned value shall be a NULL\-terminated string and MAY be empty\&. An empty string means that ZAP authentication is disabled\&. The returned size SHALL include the terminating null byte\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_ZAP_ENFORCE_DOMAIN: Retrieve ZAP domain handling mode" .sp The \fIZMQ_ZAP_ENFORCE_DOMAIN\fR option shall retrieve the flag that determines whether a ZAP domain is strictly required or not\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using ZAP T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_SIZE: Retrieve buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_SIZE option shall retrieve the size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 65546 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_MIN_SIZE: Retrieve min buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_MIN_SIZE option shall retrieve the min size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 128 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_MAX_SIZE: Retrieve max buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_MAX_SIZE option shall retrieve the max size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 262144 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_CONNECT_TIMEOUT: Retrieve connection timeout of the VMCI socket" .sp The ZMQ_VMCI_CONNECT_TIMEOUT option shall retrieve connection timeout for the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SH "RETURN VALUE" .sp The \fIzmq_getsockopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown, or the requested \fIoption_len\fR or \fIoption_value\fR is invalid, or the size of the buffer pointed to by \fIoption_value\fR, as specified by \fIoption_len\fR, is insufficient for storing the option value\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal\&. .RE .SH "EXAMPLE" .PP \fBRetrieving the high water mark for outgoing messages\fR. .sp .if n \{\ .RS 4 .\} .nf /* Retrieve high water mark into sndhwm */ int sndhwm; size_t sndhwm_size = sizeof (sndhwm); rc = zmq_getsockopt (socket, ZMQ_SNDHWM, &sndhwm, &sndhwm_size); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_setsockopt\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_setsockopt.txt0000664000372000037200000014716513255253220020351 0ustar00travistravis00000000000000zmq_setsockopt(3) ================= NAME ---- zmq_setsockopt - set 0MQ socket options SYNOPSIS -------- *int zmq_setsockopt (void '*socket', int 'option_name', const void '*option_value', size_t 'option_len');* Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_HANDOVER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE, ZMQ_XPUB_VERBOSER, ZMQ_REQ_CORRELATE, ZMQ_REQ_RELAXED, ZMQ_SNDHWM and ZMQ_RCVHWM, only take effect for subsequent socket bind/connects. Specifically, security options take effect for subsequent bind/connect calls, and can be changed at any time to affect subsequent binds and/or connects. DESCRIPTION ----------- The _zmq_setsockopt()_ function shall set the option specified by the 'option_name' argument to the value pointed to by the 'option_value' argument for the 0MQ socket pointed to by the 'socket' argument. The 'option_len' argument is the size of the option value in bytes. For options taking a value of type "character string", the provided byte data should either contain no zero bytes, or end in a single zero byte (terminating ASCII NUL character). The following socket options can be set with the _zmq_setsockopt()_ function: ZMQ_AFFINITY: Set I/O thread affinity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_AFFINITY' option shall set the I/O thread affinity for newly created connections on the specified 'socket'. Affinity determines which threads from the 0MQ I/O thread pool associated with the socket's _context_ shall handle newly created connections. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all 0MQ I/O threads in the thread pool. For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on. For example, a value of 3 specifies that subsequent connections on 'socket' shall be handled exclusively by I/O threads 1 and 2. See also linkzmq:zmq_init[3] for details on allocating the number of I/O threads for a specific _context_. [horizontal] Option value type:: uint64_t Option value unit:: N/A (bitmap) Default value:: 0 Applicable socket types:: N/A ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_BACKLOG' option shall set the maximum length of the queue of outstanding peer connections for the specified 'socket'; this only applies to connection-oriented transports. For details refer to your operating system documentation for the 'listen' function. [horizontal] Option value type:: int Option value unit:: connections Default value:: 100 Applicable socket types:: all, only for connection-oriented transports. ZMQ_BINDTODEVICE: Set name of device to bind the socket to ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_BINDTODEVICE' option binds this socket to a particular device, eg. an interface or VRF. If a socket is bound to an interface, only packets received from that particular interface are processed by the socket. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table. NOTE: requires setting CAP_NET_RAW on the compiled program. NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP or UDP transports. ZMQ_CONNECT_RID: Assign the next outbound connection id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This option name is now deprecated. Use ZMQ_CONNECT_ROUTING_ID instead. ZMQ_CONNECT_RID remains as an alias for now. ZMQ_CONNECT_ROUTING_ID: Assign the next outbound routing id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_CONNECT_ROUTING_ID' option sets the peer id of the peer connected via the next zmq_connect() call, such that that connection is immediately ready for data transfer with the given routing id. This option applies only to the first subsequent call to zmq_connect(), zmq_connect() calls thereafter use the default connection behaviour. Typical use is to set this socket option ahead of each zmq_connect() call. Each connection MUST be assigned a unique routing id. Assigning a routing id that is already in use is not allowed. Useful when connecting ROUTER to ROUTER, or STREAM to STREAM, as it allows for immediate sending to peers. Outbound routing id framing requirements for ROUTER and STREAM sockets apply. The routing id must be from 1 to 255 bytes long and MAY NOT start with a zero byte (such routing ids are reserved for internal use by the 0MQ infrastructure). [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: NULL Applicable socket types:: ZMQ_ROUTER, ZMQ_STREAM ZMQ_CONFLATE: Keep only last message ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If set, a socket shall keep only one message in its inbound/outbound queue, this message being the last message received/the last message to be sent. Ignores 'ZMQ_RCVHWM' and 'ZMQ_SNDHWM' options. Does not support multi-part messages, in particular, only one part of it is kept in the socket internal queue. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 0 (false) Applicable socket types:: ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER ZMQ_CONNECT_TIMEOUT: Set connect() timeout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (disabled) Applicable socket types:: all, when using TCP transports. ZMQ_CURVE_PUBLICKEY: Set CURVE public key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the socket's long term public key. You must set this on CURVE client sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. The public key must always be used with the matching secret key. To generate a public/secret key pair, use linkzmq:zmq_curve_keypair[3]. To derive the public key from a secret key, use linkzmq:zmq_curve_public[3]. NOTE: an option value size of 40 is supported for backwards compatibility, though is deprecated. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: NULL Applicable socket types:: all, when using TCP transport ZMQ_CURVE_SECRETKEY: Set CURVE secret key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the socket's long term secret key. You must set this on both CURVE client and server sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. To generate a public/secret key pair, use linkzmq:zmq_curve_keypair[3]. To derive the public key from a secret key, use linkzmq:zmq_curve_public[3]. NOTE: an option value size of 40 is supported for backwards compatibility, though is deprecated. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: NULL Applicable socket types:: all, when using TCP transport ZMQ_CURVE_SERVER: Set CURVE server role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines whether the socket will act as server for CURVE security, see linkzmq:zmq_curve[7]. A value of '1' means the socket will act as CURVE server. A value of '0' means the socket will not act as CURVE server, and its security role then depends on other option settings. Setting this to '0' shall reset the socket security to NULL. When you set this you must also set the server's secret key using the ZMQ_CURVE_SECRETKEY option. A server socket does not need to know its own public key. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: all, when using TCP transport ZMQ_CURVE_SERVERKEY: Set CURVE server key ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the socket's long term server key. You must set this on CURVE client sockets, see linkzmq:zmq_curve[7]. You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. This key must have been generated together with the server's secret key. To generate a public/secret key pair, use linkzmq:zmq_curve_keypair[3]. NOTE: an option value size of 40 is supported for backwards compatibility, though is deprecated. [horizontal] Option value type:: binary data or Z85 text string Option value size:: 32 or 41 Default value:: NULL Applicable socket types:: all, when using TCP transport ZMQ_GSSAPI_PLAINTEXT: Disable GSSAPI encryption ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines whether communications on the socket will be encrypted, see linkzmq:zmq_gssapi[7]. A value of '1' means that communications will be plaintext. A value of '0' means communications will be encrypted. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 (false) Applicable socket types:: all, when using TCP transport ZMQ_GSSAPI_PRINCIPAL: Set name of GSSAPI principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the name of the principal for whom GSSAPI credentials should be acquired. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_GSSAPI_SERVER: Set GSSAPI server role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines whether the socket will act as server for GSSAPI security, see linkzmq:zmq_gssapi[7]. A value of '1' means the socket will act as GSSAPI server. A value of '0' means the socket will act as GSSAPI client. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 (false) Applicable socket types:: all, when using TCP transport ZMQ_GSSAPI_SERVICE_PRINCIPAL: Set name of GSSAPI service principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the name of the principal of the GSSAPI server to which a GSSAPI client intends to connect. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Set name type of service principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the name type of the GSSAPI service principal. A value of 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with 'ZMQ_GSSAPI_SERVICE_PRINCIPAL' is interpreted as a host based name. A value of 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism). NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: int Option value unit:: 0, 1, 2 Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED) Applicable socket types:: all, when using TCP or IPC transport ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Set name type of principal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the name type of the GSSAPI principal. A value of 'ZMQ_GSSAPI_NT_HOSTBASED' (0) means the name specified with 'ZMQ_GSSAPI_PRINCIPAL' is interpreted as a host based name. A value of 'ZMQ_GSSAPI_NT_USER_NAME' (1) means it is interpreted as a local user name. A value of 'ZMQ_GSSAPI_NT_KRB5_PRINCIPAL' (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism). NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: int Option value unit:: 0, 1, 2 Default value:: 0 (ZMQ_GSSAPI_NT_HOSTBASED) Applicable socket types:: all, when using TCP or IPC transport ZMQ_HANDSHAKE_IVL: Set maximum handshake interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_HANDSHAKE_IVL' option shall set the maximum handshake interval for the specified 'socket'. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection-oriented transports. If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 30000 Applicable socket types:: all but ZMQ_STREAM, only for connection-oriented transports ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_HEARTBEAT_IVL' option shall set the interval between sending ZMTP heartbeats for the specified 'socket'. If this option is set and is greater than 0, then a 'PING' ZMTP command will be sent every 'ZMQ_HEARTBEAT_IVL' milliseconds. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 Applicable socket types:: all, when using connection-oriented transports ZMQ_HEARTBEAT_TIMEOUT: Set timeout for ZMTP heartbeats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_HEARTBEAT_TIMEOUT' option shall set how long to wait before timing-out a connection after sending a 'PING' ZMTP command and not receiving any traffic. This option is only valid if 'ZMQ_HEARTBEAT_IVL' is also set, and is greater than 0. The connection will time out if there is no traffic received after sending the 'PING' command, but the received traffic does not have to be a 'PONG' command - any received traffic will cancel the timeout. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 Applicable socket types:: all, when using connection-oriented transports ZMQ_HEARTBEAT_TTL: Set the TTL value for ZMTP heartbeats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_HEARTBEAT_TTL' option shall set the timeout on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if 'ZMQ_HEARTBEAT_IVL' is not set or is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 Applicable socket types:: all, when using connection-oriented transports ZMQ_IDENTITY: Set socket identity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This option name is now deprecated. Use ZMQ_ROUTING_ID instead. ZMQ_IDENTITY remains as an alias for now. ZMQ_IMMEDIATE: Queue messages only to completed connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (REQ, PUSH, DEALER). If this option is set to `1`, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 0 (false) Applicable socket types:: all, only for connection-oriented transports. ZMQ_INVERT_MATCHING: Invert message filtering ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reverses the filtering behavior of PUB-SUB sockets, when set to 1. On 'PUB' and 'XPUB' sockets, this causes messages to be sent to all connected sockets 'except' those subscribed to a prefix that matches the message. On 'SUB' sockets, this causes only incoming messages that do 'not' match any of the socket's subscriptions to be received by the user. Whenever 'ZMQ_INVERT_MATCHING' is set to 1 on a 'PUB' socket, all 'SUB' sockets connecting to it must also have the option set to 1. Failure to do so will have the 'SUB' sockets reject everything the 'PUB' socket sends them. 'XSUB' sockets do not need to do this because they do not filter incoming messages. [horizontal] Option value type:: int Option value unit:: 0,1 Default value:: 0 Applicable socket types:: ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB ZMQ_IPV6: Enable IPv6 on socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set the IPv6 option for the socket. A value of `1` means IPv6 is enabled on the socket, while `0` means the socket will use only IPv4. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 0 (false) Applicable socket types:: all, when using TCP transports. ZMQ_LINGER: Set linger period for socket shutdown ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_LINGER' option shall set the linger period for the specified 'socket'. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is disconnected with linkzmq:zmq_disconnect[3] or closed with linkzmq:zmq_close[3], and further affects the termination of the socket's context with linkzmq:zmq_ctx_term[3]. The following outlines the different behaviours: * A value of '-1' specifies an infinite linger period. Pending messages shall not be discarded after a call to _zmq_disconnect()_ or _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_ shall block until all pending messages have been sent to a peer. * The value of '0' specifies no linger period. Pending messages shall be discarded immediately after a call to _zmq_disconnect()_ or _zmq_close()_. * Positive values specify an upper bound for the linger period in milliseconds. Pending messages shall not be discarded after a call to _zmq_disconnect()_ or _zmq_close()_; attempting to terminate the socket's context with _zmq_ctx_term()_ shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Limits the size of the inbound message. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means 'no limit'. [horizontal] Option value type:: int64_t Option value unit:: bytes Default value:: -1 Applicable socket types:: all ZMQ_METADATA: Add application metadata properties to a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The _ZMQ_METADATA_ option shall add application metadata to the specified _socket_, the metadata is exchanged with peers during connection setup. A metadata property is specfied as a string, delimited by a colon, starting with the metadata _property_ followed by the metadata value, for example "X-key:value". _Property_ names are restrited to maximum 255 characters and must be prefixed by "X-". Multiple application metadata properties can be added to a socket by executing zmq_setsockopt() multiple times. As the argument is a null-terminated string, binary data must be encoded before it is added e.g. using Z85 (linkzmq:zmq_z85_encode[3]). NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don't leave the local network. [horizontal] Option value type:: int Option value unit:: network hops Default value:: 1 Applicable socket types:: all, when using multicast transports ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the maximum transport data unit size used for outbound multicast packets. This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required. [horizontal] Option value type:: int Option value unit:: bytes Default value:: 1500 Applicable socket types:: all, when using multicast transports ZMQ_PLAIN_PASSWORD: Set PLAIN security password ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security mechanism used for connections shall be NULL, see linkzmq:zmq_null[3]. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_PLAIN_SERVER: Set PLAIN server role ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Defines whether the socket will act as server for PLAIN security, see linkzmq:zmq_plain[7]. A value of '1' means the socket will act as PLAIN server. A value of '0' means the socket will not act as PLAIN server, and its security role then depends on other option settings. Setting this to '0' shall reset the socket security to NULL. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: all, when using TCP transport ZMQ_PLAIN_USERNAME: Set PLAIN security username ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN, see linkzmq:zmq_plain[7]. If you set this to a null value, the security mechanism used for connections shall be NULL, see linkzmq:zmq_null[3]. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_USE_FD: Set the pre-allocated socket file descriptor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When set to a positive integer value before zmq_bind is called on the socket, the socket shall use the corresponding file descriptor for connections over TCP or IPC instead of allocating a new file descriptor. Useful for writing systemd socket activated services. If set to -1 (default), a new file descriptor will be allocated instead (default behaviour). NOTE: if set after calling zmq_bind, this option shall have no effect. NOTE: the file descriptor passed through MUST have been ran through the "bind" and "listen" system calls beforehand. Also, socket option that would normally be passed through zmq_setsockopt like TCP buffers length, IP_TOS or SO_REUSEADDR MUST be set beforehand by the caller, as they must be set before the socket is bound. [horizontal] Option value type:: int Option value unit:: file descriptor Default value:: -1 Applicable socket types:: all bound sockets, when using IPC or TCP transport ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When set to 1, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on REQ, DEALER, or ROUTER sockets connected to a ROUTER socket. The application must filter such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the ROUTER application with an event signaling the arrival of a new peer. NOTE: do not set this option on a socket that talks to any other socket types: the results are undefined. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ ZMQ_RATE: Set multicast data rate ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RATE' option shall set the maximum send or receive data rate for multicast transports such as linkzmq:zmq_pgm[7] using the specified 'socket'. [horizontal] Option value type:: int Option value unit:: kilobits per second Default value:: 100 Applicable socket types:: all, when using multicast transports ZMQ_RCVBUF: Set kernel receive buffer size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RCVBUF' option shall set the underlying kernel receive buffer size for the 'socket' to the specified size in bytes. A value of -1 means leave the OS default unchanged. For details refer to your operating system documentation for the 'SO_RCVBUF' socket option. [horizontal] Option value type:: int Option value unit:: bytes Default value:: -1 Applicable socket types:: all ZMQ_RCVHWM: Set high water mark for inbound messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RCVHWM' option shall set the high water mark for inbound messages on the specified 'socket'. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified 'socket' is communicating with. A value of zero means no limit. If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in linkzmq:zmq_socket[3] for details on the exact action taken for each socket type. [horizontal] Option value type:: int Option value unit:: messages Default value:: 1000 Applicable socket types:: all ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the timeout for receive operation on the socket. If the value is `0`, _zmq_recv(3)_ will return immediately, with a EAGAIN error if there is no message to receive. If the value is `-1`, it will block until a message is available. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_RECONNECT_IVL: Set reconnection interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECONNECT_IVL' option shall set the initial reconnection interval for the specified 'socket'. The reconnection interval is the period 0MQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection. NOTE: The reconnection interval may be randomized by 0MQ to prevent reconnection storms in topologies with a large number of peers per socket. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 100 Applicable socket types:: all, only for connection-oriented transports ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECONNECT_IVL_MAX' option shall set the maximum reconnection interval for the specified 'socket'. This is the maximum period 0MQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential backoff strategy. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL. NOTE: Values less than ZMQ_RECONNECT_IVL will be ignored. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (only use ZMQ_RECONNECT_IVL) Applicable socket types:: all, only for connection-oriented transports ZMQ_RECOVERY_IVL: Set multicast recovery interval ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_RECOVERY_IVL' option shall set the recovery interval for multicast transports using the specified 'socket'. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur. CAUTION: Exercise care when setting large recovery intervals as the data needed for recovery will be held in memory. For example, a 1 minute recovery interval at a data rate of 1Gbps requires a 7GB in-memory buffer. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 10000 Applicable socket types:: all, when using multicast transports ZMQ_REQ_CORRELATE: match replies with requests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The default behaviour of REQ sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to 1, the REQ socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is (request id, 0, user frames...). The REQ socket will discard all incoming messages that don't begin with these two frames. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_REQ ZMQ_REQ_RELAXED: relax strict alternation between request and reply ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default, a REQ socket does not allow initiating a new request with _zmq_send(3)_ until the reply to the previous one has been received. When set to 1, sending another message is allowed and previous replies will be discarded if any. The request-reply state machine is reset and a new request is sent to the next available peer. If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_REQ ZMQ_ROUTER_HANDOVER: handle duplicate client routing ids on ROUTER sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already-used routing id. If that option is set to 1, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing one. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_ROUTER ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the ROUTER socket behaviour when an unroutable message is encountered. A value of `0` is the default and discards the message silently when it cannot be routed or the peers SNDHWM is reached. A value of `1` returns an 'EHOSTUNREACH' error code if the message cannot be routed or 'EAGAIN' error code if the SNDHWM is reached and ZMQ_DONTWAIT was used. Without ZMQ_DONTWAIT it will block until the SNDTIMEO is reached or a spot in the send queue opens up. When ZMQ_ROUTER_MANDATORY is set to `1`, 'ZMQ_POLLOUT' events will be generated if one or more messages can be sent to at least one of the peers. If ZMQ_ROUTER_MANDATORY is set to `0`, the socket will generate a 'ZMQ_POLLOUT' event on every call to 'zmq_poll'. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_ROUTER ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in raw mode, and when using the tcp:// transport, it will read and write TCP data without 0MQ framing. This lets 0MQ applications talk to non-0MQ applications. When using raw mode, you cannot set explicit identities, and the ZMQ_SNDMORE flag is ignored when sending data messages. In raw mode you can close a specific connection by sending it a zero-length message (following the routing id frame). NOTE: This option is deprecated, please use ZMQ_STREAM sockets instead. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_ROUTER ZMQ_ROUTING_ID: Set socket routing id ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ROUTING_ID' option shall set the routing id of the specified 'socket' when connecting to a ROUTER socket. A routing id must be at least one byte and at most 255 bytes long. Identities starting with a zero byte are reserved for use by the 0MQ infrastructure. If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already-used routing id. If that option is set to 1, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing one. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: NULL Applicable socket types:: ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER. ZMQ_SNDBUF: Set kernel transmit buffer size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SNDBUF' option shall set the underlying kernel transmit buffer size for the 'socket' to the specified size in bytes. A value of -1 means leave the OS default unchanged. For details please refer to your operating system documentation for the 'SO_SNDBUF' socket option. [horizontal] Option value type:: int Option value unit:: bytes Default value:: -1 Applicable socket types:: all ZMQ_SNDHWM: Set high water mark for outbound messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SNDHWM' option shall set the high water mark for outbound messages on the specified 'socket'. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified 'socket' is communicating with. A value of zero means no limit. If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in linkzmq:zmq_socket[3] for details on the exact action taken for each socket type. NOTE: 0MQ does not guarantee that the socket will accept as many as ZMQ_SNDHWM messages, and the actual limit may be as much as 90% lower depending on the flow of messages on the socket. [horizontal] Option value type:: int Option value unit:: messages Default value:: 1000 Applicable socket types:: all ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the timeout for send operation on the socket. If the value is `0`, _zmq_send(3)_ will return immediately, with a EAGAIN error if the message cannot be sent. If the value is `-1`, it will block until the message is sent. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 (infinite) Applicable socket types:: all ZMQ_SOCKS_PROXY: Set SOCKS5 proxy address ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name). [horizontal] Option value type:: character string Option value unit:: N/A Default value:: not set Applicable socket types:: all, when using TCP transport ZMQ_STREAM_NOTIFY: send connect and disconnect notifications ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Enables connect and disconnect notifications on a STREAM socket, when set to 1. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 1 Applicable socket types:: ZMQ_STREAM ZMQ_SUBSCRIBE: Establish message filter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SUBSCRIBE' option shall establish a new message filter on a 'ZMQ_SUB' socket. Newly created 'ZMQ_SUB' sockets shall filter out all incoming messages, therefore you should call this option to establish an initial message filter. An empty 'option_value' of length zero shall subscribe to all incoming messages. A non-empty 'option_value' shall subscribe to all messages beginning with the specified prefix. Multiple filters may be attached to a single 'ZMQ_SUB' socket, in which case a message shall be accepted if it matches at least one filter. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: N/A Applicable socket types:: ZMQ_SUB ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'SO_KEEPALIVE' socket option (where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,0,1 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPCNT' socket option (where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPIDLE' (or 'TCP_KEEPALIVE' on some OS) socket option (where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Override 'TCP_KEEPINTVL' socket option(where supported by OS). The default value of `-1` means to skip any overrides and leave it to OS default. [horizontal] Option value type:: int Option value unit:: -1,>0 Default value:: -1 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TCP_MAXRT: Set TCP Maximum Retransmit Timeout ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ On OSes where it is supported, sets how long before an unacknowledged TCP retransmit times out. The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: 0 (leave to OS default) Applicable socket types:: all, when using TCP transports. ZMQ_TOS: Set the Type-of-Service on socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the ToS fields (Differentiated services (DS) and Explicit Congestion Notification (ECN) field of the IP header. The ToS field is typically used to specify a packets priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc. [horizontal] Option value type:: int Option value unit:: >0 Default value:: 0 Applicable socket types:: all, only for connection-oriented transports ZMQ_UNSUBSCRIBE: Remove message filter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_UNSUBSCRIBE' option shall remove an existing message filter on a 'ZMQ_SUB' socket. The filter specified must match an existing filter previously established with the 'ZMQ_SUBSCRIBE' option. If the socket has several instances of the same filter attached the 'ZMQ_UNSUBSCRIBE' option shall remove only one instance, leaving the rest in place and functional. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: N/A Applicable socket types:: ZMQ_SUB ZMQ_XPUB_VERBOSE: pass duplicate subscribe messages on XPUB socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the 'XPUB' socket behaviour on new duplicated subscriptions. If enabled, the socket passes all subscribe messages to the caller. If disabled, only the first subscription to each filter will be passed. The default is 0 (disabled). [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_XPUB ZMQ_XPUB_VERBOSER: pass duplicate subscribe and unsubscribe messages on XPUB socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the 'XPUB' socket behaviour on new duplicated subscriptions and unsubscriptions. If enabled, the socket passes all subscribe and unsubscribe messages to the caller. If disabled, only the first subscription to each filter and the last unsubscription from each filter will be passed. The default is 0 (disabled). [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_XPUB ZMQ_XPUB_MANUAL: change the subscription handling to manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the 'XPUB' socket subscription handling mode manual/automatic. A value of '0' is the default and subscription requests will be handled automatically. A value of '1' will change the subscription requests handling to manual, with manual mode subscription requests are not added to the subscription list. To add subscription the user need to call setsockopt with ZMQ_SUBSCRIBE on XPUB socket. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_XPUB ZMQ_XPUB_NODROP: do not silently drop messages if SENDHWM is reached ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the 'XPUB' socket behaviour to return error EAGAIN if SENDHWM is reached and the message could not be send. A value of `0` is the default and drops the message silently when the peers SNDHWM is reached. A value of `1` returns an 'EAGAIN' error code if the SNDHWM is reached and ZMQ_DONTWAIT was used. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: ZMQ_XPUB, ZMQ_PUB ZMQ_XPUB_WELCOME_MSG: set welcome message that will be received by subscriber when connecting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets a welcome message the will be recieved by subscriber when connecting. Subscriber must subscribe to the Welcome message before connecting. Welcome message will also be sent on reconnecting. For welcome message to work well user must poll on incoming subscription messages on the XPUB socket and handle them. Use NULL and lenght of zero to disable welcome message. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: NULL Applicable socket types:: ZMQ_XPUB ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sets the domain for ZAP (ZMQ RFC 27) authentication. A ZAP domain must be specified to enable authentication. When the ZAP domain is empty, which is the default, ZAP authentication is disabled. This is not compatible with previous versions of libzmq, so it can be controlled by ZMQ_ZAP_ENFORCE_DOMAIN which for now is disabled by default. See http://rfc.zeromq.org/spec:27 for more details. [horizontal] Option value type:: character string Option value unit:: N/A Default value:: empty Applicable socket types:: all, when using TCP transport ZMQ_ZAP_ENFORCE_DOMAIN: Set ZAP domain handling to strictly adhere the RFC ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default. [horizontal] Option value type:: int Option value unit:: 0, 1 Default value:: 0 Applicable socket types:: all, when using ZAP ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assign an arbitrary number of filters that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source ip should be matched. To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0). Filter is a null-terminated string with ipv6 or ipv4 CIDR. NOTE: This option is deprecated, please use authentication via the ZAP API and IP address whitelisting / blacklisting. [horizontal] Option value type:: binary data Option value unit:: N/A Default value:: no filters (allow from all) Applicable socket types:: all listening sockets, when using TCP transports. ZMQ_IPC_FILTER_GID: Assign group ID filters to allow new IPC connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all GID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_GID, NULL, 0). NOTE: GID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X). NOTE: This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting. [horizontal] Option value type:: gid_t Option value unit:: N/A Default value:: no filters (allow from all) Applicable socket types:: all listening sockets, when using IPC transports. ZMQ_IPC_FILTER_PID: Assign process ID filters to allow new IPC connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all PID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_PID, NULL, 0). NOTE: PID filters are only available on platforms supporting the SO_PEERCRED socket option (currently only Linux). NOTE: This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting. [horizontal] Option value type:: pid_t Option value unit:: N/A Default value:: no filters (allow from all) Applicable socket types:: all listening sockets, when using IPC transports. ZMQ_IPC_FILTER_UID: Assign user ID filters to allow new IPC connections ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all UID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_UID, NULL, 0). NOTE: UID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X). NOTE: This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting. [horizontal] Option value type:: uid_t Option value unit:: N/A Default value:: no filters (allow from all) Applicable socket types:: all listening sockets, when using IPC transports. ZMQ_IPV4ONLY: Use IPv4-only on socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set the IPv4-only option for the socket. This option is deprecated. Please use the ZMQ_IPV6 option. [horizontal] Option value type:: int Option value unit:: boolean Default value:: 1 (true) Applicable socket types:: all, when using TCP transports. ZMQ_VMCI_BUFFER_SIZE: Set buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_SIZE` option shall set the size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 65546 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_MIN_SIZE` option shall set the min size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 128 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_BUFFER_MAX_SIZE: Set max buffer size of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_BUFFER_MAX_SIZE` option shall set the max size of the underlying buffer for the socket. Used during negotiation before the connection is established. [horizontal] Option value type:: uint64_t Option value unit:: bytes Default value:: 262144 Applicable socket types:: all, when using VMCI transport ZMQ_VMCI_CONNECT_TIMEOUT: Set connection timeout of the VMCI socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The `ZMQ_VMCI_CONNECT_TIMEOUT` option shall set connection timeout for the socket. [horizontal] Option value type:: int Option value unit:: milliseconds Default value:: -1 Applicable socket types:: all, when using VMCI transport RETURN VALUE ------------ The _zmq_setsockopt()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested option _option_name_ is unknown, or the requested _option_len_ or _option_value_ is invalid. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal. EXAMPLE ------- .Subscribing to messages on a 'ZMQ_SUB' socket ---- /* Subscribe to all messages */ rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); /* Subscribe to messages prefixed with "ANIMALS.CATS" */ rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "ANIMALS.CATS", 12); ---- .Setting I/O thread affinity ---- int64_t affinity; /* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */ affinity = 1; rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity)); assert (rc); rc = zmq_bind (socket, "tcp://lo:5555"); assert (rc); /* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */ affinity = 2; rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity)); assert (rc); rc = zmq_bind (socket, "tcp://lo:5556"); assert (rc); ---- SEE ALSO -------- linkzmq:zmq_getsockopt[3] linkzmq:zmq_socket[3] linkzmq:zmq_plain[7] linkzmq:zmq_curve[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_get.html0000664000372000037200000004707513255253332017730 0ustar00travistravis00000000000000 zmq_msg_get(3)

SYNOPSIS

int zmq_msg_get (zmq_msg_t *message, int property);

DESCRIPTION

The zmq_msg_get() function shall return the value for the property specified by the property argument for the message pointed to by the message argument.

The following properties can be retrieved with the zmq_msg_get() function:

ZMQ_MORE

Indicates that there are more message frames to follow after the message.

ZMQ_SRCFD

Returns the file descriptor of the socket the message was read from. This allows application to retrieve the remote endpoint via getpeername(2). Be aware that the respective socket might be closed already, reused even. Currently only implemented for TCP sockets.

ZMQ_SHARED

Indicates that a message MAY share underlying storage with another copy of this message.

RETURN VALUE

The zmq_msg_get() function shall return the value for the property if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested property is unknown.

EXAMPLE

Receiving a multi-frame message
zmq_msg_t frame;
while (true) {
    //  Create an empty 0MQ message to hold the message frame
    int rc = zmq_msg_init (&frame);
    assert (rc == 0);
    //  Block until a message is available to be received from socket
    rc = zmq_msg_recv (socket, &frame, 0);
    assert (rc != -1);
    if (zmq_msg_get (&frame, ZMQ_MORE))
        fprintf (stderr, "more\n");
    else {
        fprintf (stderr, "end\n");
        break;
    }
    zmq_msg_close (&frame);
}

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_z85_decode.30000664000372000037200000000444513255253372017430 0ustar00travistravis00000000000000'\" t .\" Title: zmq_z85_decode .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_Z85_DECODE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_z85_decode \- decode a binary key from Z85 printable text .SH "SYNOPSIS" .sp \fBuint8_t *zmq_z85_decode (uint8_t *dest, const char *string);\fR .SH "DESCRIPTION" .sp The \fIzmq_z85_decode()\fR function shall decode \fIstring\fR into \fIdest\fR\&. The length of \fIstring\fR shall be divisible by 5\&. \fIdest\fR must be large enough for the decoded value (0\&.8 x strlen (string))\&. .sp The encoding shall follow the ZMQ RFC 32 specification\&. .SH "RETURN VALUE" .sp The \fIzmq_z85_decode()\fR function shall return \fIdest\fR if successful, else it shall return NULL\&. .SH "EXAMPLE" .PP \fBDecoding a CURVE key\fR. .sp .if n \{\ .RS 4 .\} .nf const char decoded [] = "rq:rM>}U?@Lns47E1%kR\&.o@n%FcmmsL/@{H8]yf7"; uint8_t public_key [32]; zmq_z85_decode (public_key, decoded); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_z85_decode\fR(3) \fBzmq_curve_keypair\fR(3) \fBzmq_curve_public\fR(3) \fBzmq_curve\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_close.30000664000372000037200000000626213255253350016577 0ustar00travistravis00000000000000'\" t .\" Title: zmq_close .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CLOSE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_close \- close 0MQ socket .SH "SYNOPSIS" .sp \fBint zmq_close (void \fR\fB\fI*socket\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_close()\fR function shall destroy the socket referenced by the \fIsocket\fR argument\&. Any outstanding messages physically received from the network but not yet received by the application with \fIzmq_recv()\fR shall be discarded\&. The behaviour for discarding messages sent by the application with \fIzmq_send()\fR but not yet physically transferred to the network depends on the value of the \fIZMQ_LINGER\fR socket option for the specified \fIsocket\fR\&. .sp \fIzmq_close()\fR must be called exactly once for each socket\&. If it is never called, \fIzmq_ctx_term()\fR will block forever\&. If it is called multiple times for the same socket or if \fIsocket\fR does not point to a socket, the behaviour is undefined\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The default setting of \fIZMQ_LINGER\fR does not discard unsent messages; this behaviour may cause the application to block when calling \fIzmq_ctx_term()\fR\&. For details refer to \fBzmq_setsockopt\fR(3) and \fBzmq_ctx_term\fR(3)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This API will complete asynchronously, so not everything will be deallocated after it returns\&. See above for details about linger\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_close()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was NULL\&. .RE .SH "SEE ALSO" .sp \fBzmq_socket\fR(3) \fBzmq_ctx_term\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_set.txt0000664000372000037200000001542113255253220017611 0ustar00travistravis00000000000000zmq_ctx_set(3) ============== NAME ---- zmq_ctx_set - set context options SYNOPSIS -------- *int zmq_ctx_set (void '*context', int 'option_name', int 'option_value');* DESCRIPTION ----------- The _zmq_ctx_set()_ function shall set the option specified by the 'option_name' argument to the value of the 'option_value' argument. The _zmq_ctx_set()_ function accepts the following options: ZMQ_BLOCKY: Fix blocky behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default the context will block, forever, on a zmq_ctx_term call. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with 'ZMQ_LINGER' set to zero on all sockets. This setting is an easier way to get the same result. When 'ZMQ_BLOCKY' is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before calling zmq_ctx_term. [horizontal] Default value:: true (old behavior) ZMQ_IO_THREADS: Set number of I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_IO_THREADS' argument specifies the size of the 0MQ thread pool to handle I/O operations. If your application is using only the 'inproc' transport for messaging you may set this to zero, otherwise set it to at least one. This option only applies before creating any sockets on the context. [horizontal] Default value:: 1 ZMQ_THREAD_SCHED_POLICY: Set scheduling policy for I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_SCHED_POLICY' argument sets the scheduling policy for internal context's thread pool. This option is not available on windows. Supported values for this option can be found in sched.h file, or at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context. [horizontal] Default value:: -1 ZMQ_THREAD_PRIORITY: Set scheduling priority for I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_PRIORITY' argument sets scheduling priority for internal context's thread pool. This option is not available on windows. Supported values for this option depend on chosen scheduling policy. On Linux, when the scheduler policy is SCHED_OTHER, SCHED_IDLE or SCHED_BATCH, the OS scheduler will not use the thread priority but rather the thread "nice value"; in such cases the system call "nice" will be used to set the nice value to -20 (max priority) instead of adjusting the thread priority (which must be zero for those scheduling policies). Details can be found in sched.h file, or at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context. [horizontal] Default value:: -1 ZMQ_THREAD_AFFINITY_CPU_ADD: Add a CPU to list of affinity for I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_AFFINITY_CPU_ADD' argument adds a specific CPU to the affinity list for the internal context's thread pool. This option is only supported on Linux. This option only applies before creating any sockets on the context. The default affinity list is empty and means that no explicit CPU-affinity will be set on internal context's threads. [horizontal] Default value:: -1 ZMQ_THREAD_AFFINITY_CPU_REMOVE: Remove a CPU to list of affinity for I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_AFFINITY_CPU_REMOVE' argument removes a specific CPU to the affinity list for the internal context's thread pool. This option is only supported on Linux. This option only applies before creating any sockets on the context. The default affinity list is empty and means that no explicit CPU-affinity will be set on internal context's threads. [horizontal] Default value:: -1 ZMQ_THREAD_NAME_PREFIX: Set name prefix for I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_THREAD_NAME_PREFIX' argument sets a numeric prefix to each thread created for the internal context's thread pool. This option is only supported on Linux. This option is useful to help debugging done via "top -H" or "gdb"; in case multiple processes on the system are using ZeroMQ it is useful to provide through this context option an application-specific prefix to distinguish ZeroMQ background threads that belong to different processes. This option only applies before creating any sockets on the context. [horizontal] Default value:: -1 ZMQ_MAX_MSGSZ: Set maximum message size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MAX_MSGSZ' argument sets the maximum allowed size of a message sent in the context. You can query the maximal allowed value with linkzmq:zmq_ctx_get[3] using the 'ZMQ_MAX_MSGSZ' option. [horizontal] Default value:: INT_MAX Maximum value:: INT_MAX ZMQ_ZERO_COPY_RCV: Specify message decoding strategy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ZERO_COPY_RCV' argument specifies whether the message decoder should use a zero copy strategy when receiving messages. The zero copy strategy can lead to increased memory usage in some cases. This option allows you to use the older copying strategy. You can query the value of this option with linkzmq:zmq_ctx_get[3] using the 'ZMQ_ZERO_COPY_RECV' option. NOTE: in DRAFT state, not yet available in stable releases. [horizontal] Default value:: 1 ZMQ_MAX_SOCKETS: Set maximum number of sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MAX_SOCKETS' argument sets the maximum number of sockets allowed on the context. You can query the maximal allowed value with linkzmq:zmq_ctx_get[3] using the 'ZMQ_SOCKET_LIMIT' option. [horizontal] Default value:: 1024 ZMQ_IPV6: Set IPv6 option ~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_IPV6' argument sets the IPv6 value for all sockets created in the context from this point onwards. A value of `1` means IPv6 is enabled, while `0` means the socket will use only IPv4. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts. [horizontal] Default value:: 0 RETURN VALUE ------------ The _zmq_ctx_set()_ function returns zero if successful. Otherwise it returns `-1` and sets 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested option _option_name_ is unknown. EXAMPLE ------- .Setting a limit on the number of sockets ---- void *context = zmq_ctx_new (); zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256); int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS); assert (max_sockets == 256); ---- SEE ALSO -------- linkzmq:zmq_ctx_get[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_connect.html0000664000372000037200000005375413255253326017740 0ustar00travistravis00000000000000 zmq_connect(3)

SYNOPSIS

int zmq_connect (void *socket, const char *endpoint);

DESCRIPTION

The zmq_connect() function connects the socket to an endpoint and then accepts incoming connections on that endpoint.

The endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

ØMQ provides the the following transports:

tcp

unicast transport using TCP, see zmq_tcp(7)

ipc

local inter-process communication transport, see zmq_ipc(7)

inproc

local in-process (inter-thread) communication transport, see zmq_inproc(7)

pgm, epgm

reliable multicast transport using PGM, see zmq_pgm(7)

vmci

virtual machine communications interface (VMCI), see zmq_vmci(7)

Every ØMQ socket type except ZMQ_PAIR supports one-to-many and many-to-one semantics. The precise semantics depend on the socket type and are defined in zmq_socket(3).

Note
for most transports and socket types the connection is not performed immediately but as needed by ØMQ. Thus a successful call to zmq_connect() does not mean that the connection was or could actually be established. Because of this, for most transports and socket types the order in which a server socket is bound and a client socket is connected to it does not matter. The ZMQ_PAIR sockets are an exception, as they do not automatically reconnect to endpoints.
Note
following a zmq_connect(), for socket types except for ZMQ_ROUTER, the socket enters its normal ready state. By contrast, following a zmq_bind() alone, the socket enters a mute state in which the socket blocks or drops messages according to the socket type, as defined in zmq_socket(3). A ZMQ_ROUTER socket enters its normal ready state for a specific peer only when handshaking is complete for that peer, which may take an arbitrary time.

RETURN VALUE

The zmq_connect() function returns zero if successful. Otherwise it returns -1 and sets errno to one of the values defined below.

ERRORS

EINVAL

The endpoint supplied is invalid.

EPROTONOSUPPORT

The requested transport protocol is not supported.

ENOCOMPATPROTO

The requested transport protocol is not compatible with the socket type.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EMTHREAD

No I/O thread is available to accomplish the task.

EXAMPLE

Connecting a subscriber socket to an in-process and a TCP transport
/* Create a ZMQ_SUB socket */
void *socket = zmq_socket (context, ZMQ_SUB);
assert (socket);
/* Connect it to an in-process transport with the address 'my_publisher' */
int rc = zmq_connect (socket, "inproc://my_publisher");
assert (rc == 0);
/* Connect it to the host server001, port 5555 using a TCP transport */
rc = zmq_connect (socket, "tcp://server001:5555");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_recv.html0000664000372000037200000005416613255253331020106 0ustar00travistravis00000000000000 zmq_msg_recv(3)

SYNOPSIS

int zmq_msg_recv (zmq_msg_t *msg, void *socket, int flags);

DESCRIPTION

The zmq_msg_recv() function is identical to zmq_recvmsg(3), which shall be deprecated in future versions. zmq_msg_recv() is more consistent with other message manipulation functions.

The zmq_msg_recv() function shall receive a message part from the socket referenced by the socket argument and store it in the message referenced by the msg argument. Any content previously stored in msg shall be properly deallocated. If there are no message parts available on the specified socket the zmq_msg_recv() function shall block until the request can be satisfied. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified socket, the zmq_msg_recv() function shall fail with errno set to EAGAIN.

Multi-part messages

A ØMQ message is composed of 1 or more message parts. Each message part is an independent zmq_msg_t in its own right. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that processes multi-part messages must use the ZMQ_RCVMORE zmq_getsockopt(3) option after calling zmq_msg_recv() to determine if there are further parts to receive.

RETURN VALUE

The zmq_msg_recv() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and no messages are available at the moment.

ENOTSUP

The zmq_msg_recv() operation is not supported by this socket type.

EFSM

The zmq_msg_recv() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before a message was available.

EFAULT

The message passed to the function was invalid.

EXAMPLE

Receiving a message from a socket
/* Create an empty 0MQ message */
zmq_msg_t msg;
int rc = zmq_msg_init (&msg);
assert (rc == 0);
/* Block until a message is available to be received from socket */
rc = zmq_msg_recv (&msg, socket, 0);
assert (rc != -1);
/* Release message */
zmq_msg_close (&msg);
Receiving a multi-part message
int more;
size_t more_size = sizeof (more);
do {
    /* Create an empty 0MQ message to hold the message part */
    zmq_msg_t part;
    int rc = zmq_msg_init (&part);
    assert (rc == 0);
    /* Block until a message is available to be received from socket */
    rc = zmq_msg_recv (&part, socket, 0);
    assert (rc != -1);
    /* Determine if more message parts are to follow */
    rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size);
    assert (rc == 0);
    zmq_msg_close (&part);
} while (more);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_inproc.html0000664000372000037200000005046113255253344017571 0ustar00travistravis00000000000000 zmq_inproc(7)

SYNOPSIS

The in-process transport passes messages via memory directly between threads sharing a single ØMQ context.

Note
No I/O threads are involved in passing messages using the inproc transport. Therefore, if you are using a ØMQ context for in-process messaging only you can initialise the context with zero I/O threads. See zmq_init(3) for details.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the in-process transport, the transport is inproc, and the meaning of the address part is defined below.

Assigning a local address to a socket

When assigning a local address to a socket using zmq_bind() with the inproc transport, the endpoint shall be interpreted as an arbitrary string identifying the name to create. The name must be unique within the ØMQ context associated with the socket and may be up to 256 characters in length. No other restrictions are placed on the format of the name.

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the inproc transport, the endpoint shall be interpreted as an arbitrary string identifying the name to connect to. Before version 4.0 he name must have been previously created by assigning it to at least one socket within the same ØMQ context as the socket being connected. Since version 4.0 the order of zmq_bind() and zmq_connect() does not matter just like for the tcp transport type.

EXAMPLES

Assigning a local address to a socket
//  Assign the in-process name "#1"
rc = zmq_bind(socket, "inproc://#1");
assert (rc == 0);
//  Assign the in-process name "my-endpoint"
rc = zmq_bind(socket, "inproc://my-endpoint");
assert (rc == 0);
Connecting a socket
//  Connect to the in-process name "#1"
rc = zmq_connect(socket, "inproc://#1");
assert (rc == 0);
//  Connect to the in-process name "my-endpoint"
rc = zmq_connect(socket, "inproc://my-endpoint");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_gets.30000664000372000037200000000741513255253363017307 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_gets .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_GETS" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_gets \- get message metadata property .SH "SYNOPSIS" .sp \fBconst char *zmq_msg_gets (zmq_msg_t \fR\fB\fI*message\fR\fR\fB, const char *\fR\fB\fIproperty\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_gets()\fR function shall return the string value for the metadata property specified by the \fIproperty\fR argument for the message pointed to by the \fImessage\fR argument\&. Both the \fIproperty\fR argument and the \fIvalue\fR shall be NULL\-terminated UTF8\-encoded strings\&. .sp Metadata is defined on a per\-connection basis during the ZeroMQ connection handshake as specified in \&. Applications can set metadata properties using \fBzmq_setsockopt\fR(3) option ZMQ_METADATA\&. Application metadata properties must be prefixed with \fIX\-\fR\&. .sp In addition to application metadata, the following ZMTP properties can be retrieved with the \fIzmq_msg_gets()\fR function: .sp .if n \{\ .RS 4 .\} .nf Socket\-Type Routing\-Id .fi .if n \{\ .RE .\} .sp Note: \fIIdentity\fR is a deprecated alias for \fIRouting\-Id\fR\&. .sp Additionally, when available for the underlying transport, the \fBPeer\-Address\fR property will return the IP address of the remote endpoint as returned by getnameinfo(2)\&. .sp The names of these properties are also defined in \fIzmq\&.h\fR as \fIZMQ_MSG_PROPERTY_SOCKET_TYPE\fR \fIZMQ_MSG_PROPERTY_ROUTING_ID\fR, and \fIZMQ_MSG_PROPERTY_PEER_ADDRESS\fR\&. Currently, these definitions are only available as a DRAFT API\&. .sp Other properties may be defined based on the underlying security mechanism, see ZAP authenticated connection sample below\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_gets()\fR function shall return the string value for the property if successful\&. Otherwise it shall return NULL and set \fIerrno\fR to one of the values defined below\&. The caller shall not modify or free the returned value, which shall be owned by the message\&. The encoding of the property and value shall be UTF8\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested \fIproperty\fR is unknown\&. .RE .SH "EXAMPLE" .PP \fBGetting the ZAP authenticated user id for a message:\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_msg_t msg; zmq_msg_init (&msg); rc = zmq_msg_recv (&msg, dealer, 0); assert (rc != \-1); const char *user_id = zmq_msg_gets (&msg, ZMQ_MSG_PROPERTY_USER_ID); zmq_msg_close (&msg); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq\fR(7) \fBzmq_setsockopt\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_has.txt0000664000372000037200000000225613255253220016715 0ustar00travistravis00000000000000zmq_has(3) ========== NAME ---- zmq_has - check a ZMQ capability SYNOPSIS -------- *int zmq_has (const char *capability);* DESCRIPTION ----------- The _zmq_has()_ function shall report whether a specified capability is available in the library. This allows bindings and applications to probe a library directly, for transport and security options. Capabilities shall be lowercase strings. The following capabilities are defined: * ipc - the library supports the ipc:// protocol * pgm - the library supports the pgm:// protocol * tipc - the library supports the tipc:// protocol * norm - the library supports the norm:// protocol * curve - the library supports the CURVE security mechanism * gssapi - the library supports the GSSAPI security mechanism * draft - the library is built with the draft api When this method is provided, the zmq.h header file will define ZMQ_HAS_CAPABILITIES. RETURN VALUE ------------ The _zmq_has()_ function shall return 1 if the specified capability is provided. Otherwise it shall return 0. AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_move.html0000664000372000037200000004512713255253330020111 0ustar00travistravis00000000000000 zmq_msg_move(3)

SYNOPSIS

int zmq_msg_move (zmq_msg_t *dest, zmq_msg_t *src);

DESCRIPTION

The zmq_msg_move() function shall move the content of the message object referenced by src to the message object referenced by dest. No actual copying of message content is performed, dest is simply updated to reference the new content. src becomes an empty message after calling zmq_msg_move(). The original content of dest, if any, shall be released.

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.

RETURN VALUE

The zmq_msg_move() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EFAULT

Invalid message.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_disconnect.html0000664000372000037200000004761713255253326020441 0ustar00travistravis00000000000000 zmq_disconnect(3)

SYNOPSIS

int zmq_disconnect (void *socket, const char *endpoint);

DESCRIPTION

The zmq_disconnect() function shall disconnect a socket specified by the socket argument from the endpoint specified by the endpoint argument. Any outstanding messages physically received from the network but not yet received by the application with zmq_recv() shall be discarded. The behaviour for discarding messages sent by the application with zmq_send() but not yet physically transferred to the network depends on the value of the ZMQ_LINGER socket option for the specified socket.

The endpoint argument is as described in zmq_connect(3)

Note
The default setting of ZMQ_LINGER does not discard unsent messages; this behaviour may cause the application to block when calling zmq_ctx_term(). For details refer to zmq_setsockopt(3) and zmq_ctx_term(3).

RETURN VALUE

The zmq_disconnect() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The endpoint supplied is invalid.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

ENOENT

The provided endpoint is not connected.

EXAMPLE

Connecting a subscriber socket to an in-process and a TCP transport
/* Create a ZMQ_SUB socket */
void *socket = zmq_socket (context, ZMQ_SUB);
assert (socket);
/* Connect it to the host server001, port 5555 using a TCP transport */
rc = zmq_connect (socket, "tcp://server001:5555");
assert (rc == 0);
/* Disconnect from the previously connected endpoint */
rc = zmq_disconnect (socket, "tcp://server001:5555");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_curve.70000664000372000037200000001022113255253401016605 0ustar00travistravis00000000000000'\" t .\" Title: zmq_curve .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CURVE" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_curve \- secure authentication and confidentiality .SH "SYNOPSIS" .sp The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server\&. CURVE is intended for use on public networks\&. The CURVE mechanism is defined by this document: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:25\fR\m[]\&. .SH "CLIENT AND SERVER ROLES" .sp A socket using CURVE can be either client or server, at any moment, but not both\&. The role is independent of bind/connect direction\&. .sp A socket can change roles at any point by setting new options\&. The role affects all zmq_connect and zmq_bind calls that follow it\&. .sp To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the socket with its long\-term secret key\&. The application does not provide the socket with its long\-term public key, which is used only by clients\&. .sp To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY option with the long\-term public key of the server it intends to connect to, or accept connections from, next\&. The application then sets the ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client long\-term key pair\&. .sp If the server does authentication it will be based on the client\(cqs long term public key\&. .SH "KEY ENCODING" .sp The standard representation for keys in source code is either 32 bytes of base 256 (binary) data, or 40 characters of base 85 data encoded using the Z85 algorithm defined by \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:32\fR\m[]\&. .sp The Z85 algorithm is designed to produce printable key strings for use in configuration files, the command line, and code\&. There is a reference implementation in C at \m[blue]\fBhttps://github\&.com/zeromq/rfc/tree/master/src\fR\m[]\&. .SH "TEST KEY VALUES" .sp For test cases, the client shall use this long\-term key pair (specified as hexadecimal and in Z85): .sp .if n \{\ .RS 4 .\} .nf public: BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518 Yne@$w\-vo}U?@Lns47E1%kR\&.o@n%FcmmsL/@{H8]yf7 secret: 8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7 JTKVSB%%)wK0E\&.X)V>+}o?pNmC{O&4W4b!Ni{Lh6 .fi .if n \{\ .RE .\} .SH "SEE ALSO" .sp \fBzmq_z85_encode\fR(3) \fBzmq_z85_decode\fR(3) \fBzmq_setsockopt\fR(3) \fBzmq_null\fR(7) \fBzmq_plain\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_version.txt0000664000372000037200000000206113255253220017621 0ustar00travistravis00000000000000zmq_version(3) ============== NAME ---- zmq_version - report 0MQ library version SYNOPSIS -------- *void zmq_version (int '*major', int '*minor', int '*patch');* DESCRIPTION ----------- The _zmq_version()_ function shall fill in the integer variables pointed to by the 'major', 'minor' and 'patch' arguments with the major, minor and patch level components of the 0MQ library version. This functionality is intended for applications or language bindings dynamically linking to the 0MQ library that wish to determine the actual version of the 0MQ library they are using. RETURN VALUE ------------ There is no return value. ERRORS ------ No errors are defined. EXAMPLE ------- .Printing out the version of the 0MQ library ---- int major, minor, patch; zmq_version (&major, &minor, &patch); printf ("Current 0MQ version is %d.%d.%d\n", major, minor, patch); ---- SEE ALSO -------- linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_routing_id.txt0000664000372000037200000000255513255253220021155 0ustar00travistravis00000000000000zmq_msg_routing_id(3) ===================== NAME ---- zmq_msg_routing_id - return routing ID for message, if any SYNOPSIS -------- *uint32_t zmq_msg_routing_id (zmq_msg_t '*message');* DESCRIPTION ----------- The _zmq_msg_routing_id()_ function returns the routing ID for the message, if any. The routing ID is set on all messages received from a 'ZMQ_SERVER' socket. To send a message to a 'ZMQ_SERVER' socket you must set the routing ID of a connected 'ZMQ_CLIENT' peer. Routing IDs are transient. RETURN VALUE ------------ The _zmq_msg_routing_id()_ function shall return zero if there is no routing ID, otherwise it shall return an unsigned 32-bit integer greater than zero. EXAMPLE ------- .Receiving a client message and routing ID ---- void *ctx = zmq_ctx_new (); assert (ctx); void *server = zmq_socket (ctx, ZMQ_SERVER); assert (server); int rc = zmq_bind (server, "tcp://127.0.0.1:8080"); assert (rc == 0); zmq_msg_t message; rc = zmq_msg_init (&message); assert (rc == 0); // Receive a message from socket rc = zmq_msg_recv (server, &message, 0); assert (rc != -1); uint32_t routing_id = zmq_msg_routing_id (&message); assert (routing_id); ---- SEE ALSO -------- linkzmq:zmq_msg_set_routing_id[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_curve.txt0000664000372000037200000000551513255253220017267 0ustar00travistravis00000000000000zmq_curve(7) ============ NAME ---- zmq_curve - secure authentication and confidentiality SYNOPSIS -------- The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks. The CURVE mechanism is defined by this document: . CLIENT AND SERVER ROLES ----------------------- A socket using CURVE can be either client or server, at any moment, but not both. The role is independent of bind/connect direction. A socket can change roles at any point by setting new options. The role affects all zmq_connect and zmq_bind calls that follow it. To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the socket with its long-term secret key. The application does not provide the socket with its long-term public key, which is used only by clients. To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY option with the long-term public key of the server it intends to connect to, or accept connections from, next. The application then sets the ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client long-term key pair. If the server does authentication it will be based on the client's long term public key. KEY ENCODING ------------ The standard representation for keys in source code is either 32 bytes of base 256 (binary) data, or 40 characters of base 85 data encoded using the Z85 algorithm defined by http://rfc.zeromq.org/spec:32. The Z85 algorithm is designed to produce printable key strings for use in configuration files, the command line, and code. There is a reference implementation in C at https://github.com/zeromq/rfc/tree/master/src. TEST KEY VALUES --------------- For test cases, the client shall use this long-term key pair (specified as hexadecimal and in Z85): ---- public: BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518 Yne@$w-vo}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7 secret: 8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7 JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6 ---- SEE ALSO -------- linkzmq:zmq_z85_encode[3] linkzmq:zmq_z85_decode[3] linkzmq:zmq_setsockopt[3] linkzmq:zmq_null[7] linkzmq:zmq_plain[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_null.txt0000664000372000037200000000075613255253220017117 0ustar00travistravis00000000000000zmq_null(7) =========== NAME ---- zmq_null - no security or confidentiality SYNOPSIS -------- The NULL mechanism is defined by the ZMTP 3.0 specification: . This is the default security mechanism for ZeroMQ sockets. SEE ALSO -------- linkzmq:zmq_plain[7] linkzmq:zmq_curve[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_strerror.txt0000664000372000037200000000211313255253220020014 0ustar00travistravis00000000000000zmq_strerror(3) =============== NAME ---- zmq_strerror - get 0MQ error message string SYNOPSIS -------- *const char *zmq_strerror (int 'errnum');* DESCRIPTION ----------- The _zmq_strerror()_ function shall return a pointer to an error message string corresponding to the error number specified by the 'errnum' argument. As 0MQ defines additional error numbers over and above those defined by the operating system, applications should use _zmq_strerror()_ in preference to the standard _strerror()_ function. RETURN VALUE ------------ The _zmq_strerror()_ function shall return a pointer to an error message string. ERRORS ------ No errors are defined. EXAMPLE ------- .Displaying an error message when a 0MQ context cannot be initialised ---- void *ctx = zmq_init (1, 1, 0); if (!ctx) { printf ("Error occurred during zmq_init(): %s\n", zmq_strerror (errno)); abort (); } ---- SEE ALSO -------- linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_curve_keypair.txt0000664000372000037200000000227213255253220021010 0ustar00travistravis00000000000000zmq_curve_keypair(3) ==================== NAME ---- zmq_curve_keypair - generate a new CURVE keypair SYNOPSIS -------- *int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);* DESCRIPTION ----------- The _zmq_curve_keypair()_ function shall return a newly generated random keypair consisting of a public key and a secret key. The caller provides two buffers, each at least 41 octets large, in which this method will store the keys. The keys are encoded using linkzmq:zmq_z85_encode[3]. RETURN VALUE ------------ The _zmq_curve_keypair()_ function shall return 0 if successful, else it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ENOTSUP*:: The libzmq library was not built with cryptographic support (libsodium). EXAMPLE ------- .Generating a new CURVE keypair ---- char public_key [41]; char secret_key [41]; int rc = zmq_curve_keypair (public_key, secret_key); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_z85_decode[3] linkzmq:zmq_z85_encode[3] linkzmq:zmq_curve[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_send_const.30000664000372000037200000001163313255253361017631 0ustar00travistravis00000000000000'\" t .\" Title: zmq_send_const .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SEND_CONST" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_send_const \- send a constant\-memory message part on a socket .SH "SYNOPSIS" .sp \fBint zmq_send_const (void \fR\fB\fI*socket\fR\fR\fB, void \fR\fB\fI*buf\fR\fR\fB, size_t \fR\fB\fIlen\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_send_const()\fR function shall queue a message created from the buffer referenced by the \fIbuf\fR and \fIlen\fR arguments\&. The message buffer is assumed to be constant\-memory and will therefore not be copied or deallocated in any way\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the \fIsocket\fR, the \fIzmq_send_const()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .PP \fBZMQ_SNDMORE\fR .RS 4 Specifies that the message being sent is a multi\-part message, and that further message parts are to follow\&. Refer to the section regarding multi\-part messages below for a detailed description\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp A successful invocation of \fIzmq_send_const()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&. .sp .5v .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that sends multi\-part messages must use the \fIZMQ_SNDMORE\fR flag when sending each message part except the final one\&. .SH "RETURN VALUE" .sp The \fIzmq_send_const()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and the message cannot be sent at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_send_const()\fR operation is not supported by this socket type\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_send_const()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before the message was sent\&. .RE .PP \fBEHOSTUNREACH\fR .RS 4 The message cannot be routed\&. .RE .SH "EXAMPLE" .PP \fBSending a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf /* Send a multi\-part message consisting of three parts to socket */ rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE); assert (rc == 5); /* Final part; no more parts to follow */ rc = zmq_send_const (socket, "JK", 2, 0); assert (rc == 2); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_send\fR(3) \fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ipc.70000664000372000037200000001310513255253400016237 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ipc .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_IPC" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ipc \- 0MQ local inter\-process communication transport .SH "SYNOPSIS" .sp The inter\-process transport passes messages between local processes using a system\-dependent IPC mechanism\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The inter\-process transport is currently only implemented on operating systems that provide UNIX domain sockets\&. .sp .5v .RE .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the inter\-process transport, the transport is ipc, and the meaning of the \fIaddress\fR part is defined below\&. .SS "Binding a socket" .sp When binding a \fIsocket\fR to a local address using \fIzmq_bind()\fR with the \fIipc\fR transport, the \fIendpoint\fR shall be interpreted as an arbitrary string identifying the \fIpathname\fR to create\&. The \fIpathname\fR must be unique within the operating system namespace used by the \fIipc\fR implementation, and must fulfill any restrictions placed by the operating system on the format and length of a \fIpathname\fR\&. .sp When the address is wild\-card *, \fIzmq_bind()\fR shall generate a unique temporary pathname\&. The caller should retrieve this pathname using the ZMQ_LAST_ENDPOINT socket option\&. See \fBzmq_getsockopt\fR(3) for details\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp any existing binding to the same endpoint shall be overridden\&. That is, if a second process binds to an endpoint already bound by a process, this will succeed and the first process will lose its binding\&. In this behaviour, the \fIipc\fR transport is not consistent with the \fItcp\fR or \fIinproc\fR transports\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp the endpoint pathname must be writable by the process\&. When the endpoint starts with \fI/\fR, e\&.g\&., ipc:///pathname, this will be an \fIabsolute\fR pathname\&. If the endpoint specifies a directory that does not exist, the bind shall fail\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp on Linux only, when the endpoint pathname starts with @, the abstract namespace shall be used\&. The abstract namespace is independent of the filesystem and if a process attempts to bind an endpoint already bound by a process, it will fail\&. See unix(7) for details\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp IPC pathnames have a maximum size that depends on the operating system\&. On Linux, the maximum is 113 characters including the "ipc://" prefix (107 characters for the real path name)\&. .sp .5v .RE .SS "Unbinding wild\-card address from a socket" .sp When wild\-card * \fIendpoint\fR was used in \fIzmq_bind()\fR, the caller should use real \fIendpoint\fR obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this \fIendpoint\fR from a socket using \fIzmq_unbind()\fR\&. .SS "Connecting a socket" .sp When connecting a \fIsocket\fR to a peer address using \fIzmq_connect()\fR with the \fIipc\fR transport, the \fIendpoint\fR shall be interpreted as an arbitrary string identifying the \fIpathname\fR to connect to\&. The \fIpathname\fR must have been previously created within the operating system namespace by assigning it to a \fIsocket\fR with \fIzmq_bind()\fR\&. .SH "EXAMPLES" .PP \fBAssigning a local address to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Assign the pathname "/tmp/feeds/0" rc = zmq_bind(socket, "ipc:///tmp/feeds/0"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connect to the pathname "/tmp/feeds/0" rc = zmq_connect(socket, "ipc:///tmp/feeds/0"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_inproc\fR(7) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq_vmci\fR(7) \fBzmq_getsockopt\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_sendmsg.30000664000372000037200000001332013255253367017133 0ustar00travistravis00000000000000'\" t .\" Title: zmq_sendmsg .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SENDMSG" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_sendmsg \- send a message part on a socket .SH "SYNOPSIS" .sp \fBint zmq_sendmsg (void \fR\fB\fI*socket\fR\fR\fB, zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_sendmsg()\fR function shall queue the message referenced by the \fImsg\fR argument to be sent to the socket referenced by the \fIsocket\fR argument\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high\-water mark), specifies that the operation should be performed in non\-blocking mode\&. If the message cannot be queued on the \fIsocket\fR, the \fIzmq_sendmsg()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .PP \fBZMQ_SNDMORE\fR .RS 4 Specifies that the message being sent is a multi\-part message, and that further message parts are to follow\&. Refer to the section regarding multi\-part messages below for a detailed description\&. .RE .sp The \fIzmq_msg_t\fR structure passed to \fIzmq_sendmsg()\fR is nullified during the call\&. If you want to send the same message to multiple sockets you have to copy it (e\&.g\&. using \fIzmq_msg_copy()\fR)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp A successful invocation of \fIzmq_sendmsg()\fR does not indicate that the message has been transmitted to the network, only that it has been queued on the \fIsocket\fR and 0MQ has assumed responsibility for the message\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp this API method is deprecated in favor of zmq_msg_send(3)\&. .sp .5v .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. Each message part is an independent \fIzmq_msg_t\fR in its own right\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that sends multi\-part messages must use the \fIZMQ_SNDMORE\fR flag when sending each message part except the final one\&. .SH "RETURN VALUE" .sp The \fIzmq_sendmsg()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and the message cannot be sent at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_sendmsg()\fR operation is not supported by this socket type\&. .RE .PP \fBEINVAL\fR .RS 4 The sender tried to send multipart data, which the socket type does not allow\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_sendmsg()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before the message was sent\&. .RE .PP \fBEFAULT\fR .RS 4 Invalid message\&. .RE .PP \fBEHOSTUNREACH\fR .RS 4 The message cannot be routed\&. .RE .SH "EXAMPLE" .PP \fBFilling in a message and sending it to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a new message, allocating 6 bytes for message content */ zmq_msg_t msg; int rc = zmq_msg_init_size (&msg, 6); assert (rc == 0); /* Fill in message content with \*(AqAAAAAA\*(Aq */ memset (zmq_msg_data (&msg), \*(AqA\*(Aq, 6); /* Send the message to the socket */ rc = zmq_sendmsg (socket, &msg, 0); assert (rc == 6); .fi .if n \{\ .RE .\} .PP \fBSending a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf /* Send a multi\-part message consisting of three parts to socket */ rc = zmq_sendmsg (socket, &part1, ZMQ_SNDMORE); rc = zmq_sendmsg (socket, &part2, ZMQ_SNDMORE); /* Final part; no more parts to follow */ rc = zmq_sendmsg (socket, &part3, 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_recv\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_set.html0000664000372000037200000006604613255253327017757 0ustar00travistravis00000000000000 zmq_ctx_set(3)

SYNOPSIS

int zmq_ctx_set (void *context, int option_name, int option_value);

DESCRIPTION

The zmq_ctx_set() function shall set the option specified by the option_name argument to the value of the option_value argument.

The zmq_ctx_set() function accepts the following options:

ZMQ_BLOCKY: Fix blocky behavior

By default the context will block, forever, on a zmq_ctx_term call. The assumption behind this behavior is that abrupt termination will cause message loss. Most real applications use some form of handshaking to ensure applications receive termination messages, and then terminate the context with ZMQ_LINGER set to zero on all sockets. This setting is an easier way to get the same result. When ZMQ_BLOCKY is set to false, all new sockets are given a linger timeout of zero. You must still close all sockets before calling zmq_ctx_term.

Default value

true (old behavior)

ZMQ_IO_THREADS: Set number of I/O threads

The ZMQ_IO_THREADS argument specifies the size of the ØMQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one. This option only applies before creating any sockets on the context.

Default value

1

ZMQ_THREAD_SCHED_POLICY: Set scheduling policy for I/O threads

The ZMQ_THREAD_SCHED_POLICY argument sets the scheduling policy for internal context’s thread pool. This option is not available on windows. Supported values for this option can be found in sched.h file, or at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

Default value

-1

ZMQ_THREAD_PRIORITY: Set scheduling priority for I/O threads

The ZMQ_THREAD_PRIORITY argument sets scheduling priority for internal context’s thread pool. This option is not available on windows. Supported values for this option depend on chosen scheduling policy. On Linux, when the scheduler policy is SCHED_OTHER, SCHED_IDLE or SCHED_BATCH, the OS scheduler will not use the thread priority but rather the thread "nice value"; in such cases the system call "nice" will be used to set the nice value to -20 (max priority) instead of adjusting the thread priority (which must be zero for those scheduling policies). Details can be found in sched.h file, or at http://man7.org/linux/man-pages/man2/sched_setscheduler.2.html. This option only applies before creating any sockets on the context.

Default value

-1

ZMQ_THREAD_AFFINITY_CPU_ADD: Add a CPU to list of affinity for I/O threads

The ZMQ_THREAD_AFFINITY_CPU_ADD argument adds a specific CPU to the affinity list for the internal context’s thread pool. This option is only supported on Linux. This option only applies before creating any sockets on the context. The default affinity list is empty and means that no explicit CPU-affinity will be set on internal context’s threads.

Default value

-1

ZMQ_THREAD_AFFINITY_CPU_REMOVE: Remove a CPU to list of affinity for I/O threads

The ZMQ_THREAD_AFFINITY_CPU_REMOVE argument removes a specific CPU to the affinity list for the internal context’s thread pool. This option is only supported on Linux. This option only applies before creating any sockets on the context. The default affinity list is empty and means that no explicit CPU-affinity will be set on internal context’s threads.

Default value

-1

ZMQ_THREAD_NAME_PREFIX: Set name prefix for I/O threads

The ZMQ_THREAD_NAME_PREFIX argument sets a numeric prefix to each thread created for the internal context’s thread pool. This option is only supported on Linux. This option is useful to help debugging done via "top -H" or "gdb"; in case multiple processes on the system are using ZeroMQ it is useful to provide through this context option an application-specific prefix to distinguish ZeroMQ background threads that belong to different processes. This option only applies before creating any sockets on the context.

Default value

-1

ZMQ_MAX_MSGSZ: Set maximum message size

The ZMQ_MAX_MSGSZ argument sets the maximum allowed size of a message sent in the context. You can query the maximal allowed value with zmq_ctx_get(3) using the ZMQ_MAX_MSGSZ option.

Default value

INT_MAX

Maximum value

INT_MAX

ZMQ_ZERO_COPY_RCV: Specify message decoding strategy

The ZMQ_ZERO_COPY_RCV argument specifies whether the message decoder should use a zero copy strategy when receiving messages. The zero copy strategy can lead to increased memory usage in some cases. This option allows you to use the older copying strategy. You can query the value of this option with zmq_ctx_get(3) using the ZMQ_ZERO_COPY_RECV option. NOTE: in DRAFT state, not yet available in stable releases.

Default value

1

ZMQ_MAX_SOCKETS: Set maximum number of sockets

The ZMQ_MAX_SOCKETS argument sets the maximum number of sockets allowed on the context. You can query the maximal allowed value with zmq_ctx_get(3) using the ZMQ_SOCKET_LIMIT option.

Default value

1024

ZMQ_IPV6: Set IPv6 option

The ZMQ_IPV6 argument sets the IPv6 value for all sockets created in the context from this point onwards. A value of 1 means IPv6 is enabled, while 0 means the socket will use only IPv4. When IPv6 is enabled, a socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

Default value

0

RETURN VALUE

The zmq_ctx_set() function returns zero if successful. Otherwise it returns -1 and sets errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown.

EXAMPLE

Setting a limit on the number of sockets
void *context = zmq_ctx_new ();
zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256);
int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS);
assert (max_sockets == 256);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_close.30000664000372000037200000000534013255253356017447 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_close .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_CLOSE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_close \- release 0MQ message .SH "SYNOPSIS" .sp \fBint zmq_msg_close (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_close()\fR function shall inform the 0MQ infrastructure that any resources associated with the message object referenced by \fImsg\fR are no longer required and may be released\&. Actual release of resources associated with the message object shall be postponed by 0MQ until all users of the message or underlying data buffer have indicated it is no longer required\&. .sp Applications should ensure that \fIzmq_msg_close()\fR is called once a message is no longer required, otherwise memory leaks may occur\&. Note that this is NOT necessary after a successful \fIzmq_msg_send()\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_close()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEFAULT\fR .RS 4 Invalid message\&. .RE .SH "SEE ALSO" .sp \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_gssapi.html0000664000372000037200000004775213255253346017600 0ustar00travistravis00000000000000 zmq_gssapi(7)

SYNOPSIS

The GSSAPI mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server using the Generic Security Service Application Program Interface (GSSAPI). The GSSAPI mechanism can be used on both public and private networks. GSSAPI itself is defined in IETF RFC-2743: http://tools.ietf.org/html/rfc2743. The ZeroMQ GSSAPI mechanism is defined by this document: http://rfc.zeromq.org/spec:38.

CLIENT AND SERVER ROLES

A socket using GSSAPI can be either client or server, but not both.

To become a GSSAPI server, the application sets the ZMQ_GSSAPI_SERVER option on the socket.

To become a GSSAPI client, the application sets the ZMQ_GSSAPI_SERVICE_PRINCIPAL option to the name of the principal on the server to which it intends to connect.

On client or server, the application may additionally set the ZMQ_GSSAPI_PRINCIPAL option to provide the socket with the name of the principal for whom GSSAPI credentials should be acquired. If this option is not set, default credentials are used.

OPTIONAL ENCRYPTION

By default, the GSSAPI mechanism will encrypt all communications between client and server. If encryption is not desired (e.g. on private networks), the client and server applications can disable it by setting the ZMQ_GSSAPI_PLAINTEXT option. Both the client and server must set this option to the same value.

PRINCIPAL NAMES

Principal names specified with the ZMQ_GSSAPI_SERVICE_PRINCIPAL or ZMQ_GSSAPI_PRINCIPAL options are interpreted as "host based" name types by default. The ZMQ_GSSAPI_PRINCIPAL_NAMETYPE and ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE options may be used to change the name type to one of:

ZMQ_GSSAPI_NT_HOSTBASED

The name should be of the form "service" or "service@hostname", which will parse into a principal of "service/hostname" in the local realm. This is the default name type.

ZMQ_GSSAPI_NT_USER_NAME

The name should be a local username, which will parse into a single-component principal in the local realm.

ZMQ_GSSAPI_NT_KRB5_PRINCIPAL

The name is a principal name string. This name type only works with the krb5 GSSAPI mechanism.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_init.30000664000372000037200000000542713255253353017310 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_init .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_INIT" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_init \- initialise empty 0MQ message .SH "SYNOPSIS" .sp \fBint zmq_msg_init (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_init()\fR function shall initialise the message object referenced by \fImsg\fR to represent an empty message\&. This function is most useful when called before receiving a message with \fIzmq_msg_recv()\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The functions \fIzmq_msg_init()\fR, \fIzmq_msg_init_data()\fR and \fIzmq_msg_init_size()\fR are mutually exclusive\&. Never initialise the same \fIzmq_msg_t\fR twice\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_init()\fR function always returns zero\&. .SH "ERRORS" .sp No errors are defined\&. .SH "EXAMPLE" .PP \fBReceiving a message from a socket\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); int nbytes = zmq_msg_recv (socket, &msg, 0); assert (nbytes != \-1); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_getsockopt.html0000664000372000037200000025502513255253340020460 0ustar00travistravis00000000000000 zmq_getsockopt(3)

SYNOPSIS

int zmq_getsockopt (void *socket, int option_name, void *option_value, size_t *option_len);

DESCRIPTION

The zmq_getsockopt() function shall retrieve the value for the option specified by the option_name argument for the ØMQ socket pointed to by the socket argument, and store it in the buffer pointed to by the option_value argument. The option_len argument is the size in bytes of the buffer pointed to by option_value; upon successful completion zmq_getsockopt() shall modify the option_len argument to indicate the actual size of the option value stored in the buffer.

The following options can be retrieved with the zmq_getsockopt() function:

ZMQ_AFFINITY: Retrieve I/O thread affinity

The ZMQ_AFFINITY option shall retrieve the I/O thread affinity for newly created connections on the specified socket.

Affinity determines which threads from the ØMQ I/O thread pool associated with the socket’s context shall handle newly created connections. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all ØMQ I/O threads in the thread pool. For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on. For example, a value of 3 specifies that subsequent connections on socket shall be handled exclusively by I/O threads 1 and 2.

See also zmq_init(3) for details on allocating the number of I/O threads for a specific context.

Option value type

uint64_t

Option value unit

N/A (bitmap)

Default value

0

Applicable socket types

N/A

ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections

The ZMQ_BACKLOG option shall retrieve the maximum length of the queue of outstanding peer connections for the specified socket; this only applies to connection-oriented transports. For details refer to your operating system documentation for the listen function.

Option value type

int

Option value unit

connections

Default value

100

Applicable socket types

all, only for connection-oriented transports

ZMQ_BINDTODEVICE: Retrieve name of device the socket is bound to

The ZMQ_BINDTODEVICE option retrieves the name of the device this socket is bound to, eg. an interface or VRF. If a socket is bound to an interface, only packets received from that interface are processed by the socket. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table.

Note
in DRAFT state, not yet available in stable releases.
Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP or UDP transports.

ZMQ_CONNECT_TIMEOUT: Retrieve connect() timeout

Retrieves how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

Option value type

int

Option value unit

milliseconds

Default value

0 (disabled)

Applicable socket types

all, when using TCP transports.

ZMQ_CURVE_PUBLICKEY: Retrieve current CURVE public key

Retrieves the current long term public key for the socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte.

Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

null

Applicable socket types

all, when using TCP transport

ZMQ_CURVE_SECRETKEY: Retrieve current CURVE secret key

Retrieves the current long term secret key for the socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41 byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte.

Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

null

Applicable socket types

all, when using TCP transport

ZMQ_CURVE_SERVERKEY: Retrieve current CURVE server key

Retrieves the current server key for the client socket. You can provide either a 32 byte buffer, to retrieve the binary key value, or a 41-byte buffer, to retrieve the key in a printable Z85 format. NOTE: to fetch a printable key, the buffer must be 41 bytes large to hold the 40-char key value and one null byte.

Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

null

Applicable socket types

all, when using TCP transport

ZMQ_EVENTS: Retrieve socket event state

The ZMQ_EVENTS option shall retrieve the event state for the specified socket. The returned value is a bit mask constructed by OR’ing a combination of the following event flags:

ZMQ_POLLIN

Indicates that at least one message may be received from the specified socket without blocking.

ZMQ_POLLOUT

Indicates that at least one message may be sent to the specified socket without blocking.

The combination of a file descriptor returned by the ZMQ_FD option being ready for reading but no actual events returned by a subsequent retrieval of the ZMQ_EVENTS option is valid; applications should simply ignore this case and restart their polling operation/event loop.

Option value type

int

Option value unit

N/A (flags)

Default value

N/A

Applicable socket types

all

ZMQ_FD: Retrieve file descriptor associated with the socket

The ZMQ_FD option shall retrieve the file descriptor associated with the specified socket. The returned file descriptor can be used to integrate the socket into an existing event loop; the ØMQ library shall signal any pending events on the socket in an edge-triggered fashion by making the file descriptor become ready for reading.

Note
The ability to read from the returned file descriptor does not necessarily indicate that messages are available to be read from, or can be written to, the underlying socket; applications must retrieve the actual event state with a subsequent retrieval of the ZMQ_EVENTS option.
Note
The returned file descriptor is also used internally by the zmq_send and zmq_recv functions. As the descriptor is edge triggered, applications must update the state of ZMQ_EVENTS after each invocation of zmq_send or zmq_recv.To be more explicit: after calling zmq_send the socket may become readable (and vice versa) without triggering a read event on the file descriptor.
Caution
The returned file descriptor is intended for use with a poll or similar system call only. Applications must never attempt to read or write data to it directly, neither should they try to close it.
Option value type

int on POSIX systems, SOCKET on Windows

Option value unit

N/A

Default value

N/A

Applicable socket types

all

ZMQ_GSSAPI_PLAINTEXT: Retrieve GSSAPI plaintext or encrypted status

Returns the ZMQ_GSSAPI_PLAINTEXT option, if any, previously set on the socket. A value of 1 means that communications will be plaintext. A value of 0 means communications will be encrypted.

Option value type

int

Option value unit

0, 1

Default value

0 (false)

Applicable socket types

all, when using TCP or IPC transports

ZMQ_GSSAPI_PRINCIPAL: Retrieve the name of the GSSAPI principal

The ZMQ_GSSAPI_PRINCIPAL option shall retrieve the principal name set for the GSSAPI security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte.

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

null string

Applicable socket types

all, when using TCP or IPC transports

ZMQ_GSSAPI_SERVER: Retrieve current GSSAPI server role

Returns the ZMQ_GSSAPI_SERVER option, if any, previously set on the socket.

Option value type

int

Option value unit

0, 1

Default value

0 (false)

Applicable socket types

all, when using TCP or IPC transports

ZMQ_GSSAPI_SERVICE_PRINCIPAL: Retrieve the name of the GSSAPI service principal

The ZMQ_GSSAPI_SERVICE_PRINCIPAL option shall retrieve the principal name of the GSSAPI server to which a GSSAPI client socket intends to connect. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte.

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

null string

Applicable socket types

all, when using TCP or IPC transports

ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal

Returns the ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE option, if any, previously set on the socket. A value of ZMQ_GSSAPI_NT_HOSTBASED (0) means the name specified with ZMQ_GSSAPI_SERVICE_PRINCIPAL is interpreted as a host based name. A value of ZMQ_GSSAPI_NT_USER_NAME (1) means it is interpreted as a local user name. A value of ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism).

Note
in DRAFT state, not yet available in stable releases.
Option value type

int

Option value unit

0, 1, 2

Default value

0 (ZMQ_GSSAPI_NT_HOSTBASED)

Applicable socket types

all, when using TCP or IPC transports

ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Retrieve nametype for service principal

Returns the ZMQ_GSSAPI_PRINCIPAL_NAMETYPE option, if any, previously set on the socket. A value of ZMQ_GSSAPI_NT_HOSTBASED (0) means the name specified with ZMQ_GSSAPI_PRINCIPAL is interpreted as a host based name. A value of ZMQ_GSSAPI_NT_USER_NAME (1) means it is interpreted as a local user name. A value of ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism).

Note
in DRAFT state, not yet available in stable releases.
Option value type

int

Option value unit

0, 1, 2

Default value

0 (ZMQ_GSSAPI_NT_HOSTBASED)

Applicable socket types

all, when using TCP or IPC transports

ZMQ_HANDSHAKE_IVL: Retrieve maximum handshake interval

The ZMQ_HANDSHAKE_IVL option shall retrieve the maximum handshake interval for the specified socket. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection-oriented transports. If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

Option value type

int

Option value unit

milliseconds

Default value

30000

Applicable socket types

all but ZMQ_STREAM, only for connection-oriented transports

ZMQ_IDENTITY: Retrieve socket identity

This option name is now deprecated. Use ZMQ_ROUTING_ID instead. ZMQ_IDENTITY remains as an alias for now.

ZMQ_IMMEDIATE: Retrieve attach-on-connect value

Retrieve the state of the attach on connect value. If set to 1, will delay the attachment of a pipe on connect until the underlying connection has completed. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

Option value type

int

Option value unit

boolean

Default value

0 (false)

Applicable socket types

all, primarily when using TCP/IPC transports.

ZMQ_INVERT_MATCHING: Retrieve inverted filtering status

Returns the value of the ZMQ_INVERT_MATCHING option. A value of 1 means the socket uses inverted prefix matching.

On PUB and XPUB sockets, this causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message. On SUB sockets, this causes only incoming messages that do not match any of the socket’s subscriptions to be received by the user.

Whenever ZMQ_INVERT_MATCHING is set to 1 on a PUB socket, all SUB sockets connecting to it must also have the option set to 1. Failure to do so will have the SUB sockets reject everything the PUB socket sends them. XSUB sockets do not need to do this because they do not filter incoming messages.

Option value type

int

Option value unit

0,1

Default value

0

Applicable socket types

ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB

ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status

Retrieve the IPv4-only option for the socket. This option is deprecated. Please use the ZMQ_IPV6 option.

Option value type

int

Option value unit

boolean

Default value

1 (true)

Applicable socket types

all, when using TCP transports.

ZMQ_IPV6: Retrieve IPv6 socket status

Retrieve the IPv6 option for the socket. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

Option value type

int

Option value unit

boolean

Default value

0 (false)

Applicable socket types

all, when using TCP transports.

ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set

The ZMQ_LAST_ENDPOINT option shall retrieve the last endpoint bound for TCP and IPC transports. The returned value will be a string in the form of a ZMQ DSN. Note that if the TCP host is INADDR_ANY, indicated by a *, then the returned address will be 0.0.0.0 (for IPv4).

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

NULL

Applicable socket types

all, when binding TCP or IPC transports

ZMQ_LINGER: Retrieve linger period for socket shutdown

The ZMQ_LINGER option shall retrieve the linger period for the specified socket. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is closed with zmq_close(3), and further affects the termination of the socket’s context with zmq_ctx_term(3). The following outlines the different behaviours:

  • The default value of -1 specifies an infinite linger period. Pending messages shall not be discarded after a call to zmq_close(); attempting to terminate the socket’s context with zmq_ctx_term() shall block until all pending messages have been sent to a peer.

  • The value of 0 specifies no linger period. Pending messages shall be discarded immediately when the socket is closed with zmq_close().

  • Positive values specify an upper bound for the linger period in milliseconds. Pending messages shall not be discarded after a call to zmq_close(); attempting to terminate the socket’s context with zmq_ctx_term() shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded.

    Option value type

    int

    Option value unit

    milliseconds

    Default value

    -1 (infinite)

    Applicable socket types

    all

ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size

The option shall retrieve limit for the inbound messages. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means no limit.

Option value type

int64_t

Option value unit

bytes

Default value

-1

Applicable socket types

all

ZMQ_MECHANISM: Retrieve current security mechanism

The ZMQ_MECHANISM option shall retrieve the current security mechanism for the socket.

Option value type

int

Option value unit

ZMQ_NULL, ZMQ_PLAIN, ZMQ_CURVE, or ZMQ_GSSAPI

Default value

ZMQ_NULL

Applicable socket types

all, when using TCP or IPC transports

ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets

The option shall retrieve time-to-live used for outbound multicast packets. The default of 1 means that the multicast packets don’t leave the local network.

Option value type

int

Option value unit

network hops

Default value

1

Applicable socket types

all, when using multicast transports

ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets

The ZMQ_MULTICAST_MAXTPDU option shall retrieve the maximum transport data unit size used for outbound multicast packets.

This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

Option value type

int

Option value unit

bytes

Default value

1500

Applicable socket types

all, when using multicast transports

ZMQ_PLAIN_PASSWORD: Retrieve current password

The ZMQ_PLAIN_PASSWORD option shall retrieve the last password set for the PLAIN security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte.

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

null string

Applicable socket types

all, when using TCP or IPC transports

ZMQ_PLAIN_SERVER: Retrieve current PLAIN server role

Returns the ZMQ_PLAIN_SERVER option, if any, previously set on the socket.

Option value type

int

Option value unit

0, 1

Default value

int

Applicable socket types

all, when using TCP or IPC transports

ZMQ_PLAIN_USERNAME: Retrieve current PLAIN username

The ZMQ_PLAIN_USERNAME option shall retrieve the last username set for the PLAIN security mechanism. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte.

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

null string

Applicable socket types

all, when using TCP or IPC transports

ZMQ_USE_FD: Retrieve the pre-allocated socket file descriptor

The ZMQ_USE_FD option shall retrieve the pre-allocated file descriptor that has been assigned to a ZMQ socket, if any. -1 shall be returned if a pre-allocated file descriptor was not set for the socket.

Option value type

int

Option value unit

file descriptor

Default value

-1

Applicable socket types

all bound sockets, when using IPC or TCP transport

ZMQ_RATE: Retrieve multicast data rate

The ZMQ_RATE option shall retrieve the maximum send or receive data rate for multicast transports using the specified socket.

Option value type

int

Option value unit

kilobits per second

Default value

100

Applicable socket types

all, when using multicast transports

ZMQ_RCVBUF: Retrieve kernel receive buffer size

The ZMQ_RCVBUF option shall retrieve the underlying kernel receive buffer size for the specified socket. For details refer to your operating system documentation for the SO_RCVBUF socket option.

Option value type

int

Option value unit

bytes

Default value

8192

Applicable socket types

all

ZMQ_RCVHWM: Retrieve high water mark for inbound messages

The ZMQ_RCVHWM option shall return the high water mark for inbound messages on the specified socket. The high water mark is a hard limit on the maximum number of outstanding messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in zmq_socket(3) for details on the exact action taken for each socket type.

Option value type

int

Option value unit

messages

Default value

1000

Applicable socket types

all

ZMQ_RCVMORE: More message data parts to follow

The ZMQ_RCVMORE option shall return True (1) if the message part last received from the socket was a data part with more parts to follow. If there are no data parts to follow, this option shall return False (0).

Refer to zmq_send(3) and zmq_recv(3) for a detailed description of multi-part messages.

Option value type

int

Option value unit

boolean

Default value

N/A

Applicable socket types

all

ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN

Retrieve the timeout for recv operation on the socket. If the value is 0, zmq_recv(3) will return immediately, with a EAGAIN error if there is no message to receive. If the value is -1, it will block until a message is available. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error.

Option value type

int

Option value unit

milliseconds

Default value

-1 (infinite)

Applicable socket types

all

ZMQ_RECONNECT_IVL: Retrieve reconnection interval

The ZMQ_RECONNECT_IVL option shall retrieve the initial reconnection interval for the specified socket. The reconnection interval is the period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

Note
The reconnection interval may be randomized by ØMQ to prevent reconnection storms in topologies with a large number of peers per socket.
Option value type

int

Option value unit

milliseconds

Default value

100

Applicable socket types

all, only for connection-oriented transports

ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval

The ZMQ_RECONNECT_IVL_MAX option shall retrieve the maximum reconnection interval for the specified socket. This is the maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential backoff strategy. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.

Note
Values less than ZMQ_RECONNECT_IVL will be ignored.
Option value type

int

Option value unit

milliseconds

Default value

0 (only use ZMQ_RECONNECT_IVL)

Applicable socket types

all, only for connection-oriented transport

ZMQ_RECOVERY_IVL: Get multicast recovery interval

The ZMQ_RECOVERY_IVL option shall retrieve the recovery interval for multicast transports using the specified socket. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

Option value type

int

Option value unit

milliseconds

Default value

10000

Applicable socket types

all, when using multicast transports

ZMQ_ROUTING_ID: Retrieve socket routing id

The ZMQ_ROUTING_ID option shall retrieve the routing id of the specified socket. Routing ids are used only by the request/reply pattern. Specifically, it can be used in tandem with ROUTER socket to route messages to the peer with a specific routing id.

A routing id must be at least one byte and at most 255 bytes long. Identities starting with a zero byte are reserved for use by the ØMQ infrastructure.

Option value type

binary data

Option value unit

N/A

Default value

NULL

Applicable socket types

ZMQ_REP, ZMQ_REQ, ZMQ_ROUTER, ZMQ_DEALER.

ZMQ_SNDBUF: Retrieve kernel transmit buffer size

The ZMQ_SNDBUF option shall retrieve the underlying kernel transmit buffer size for the specified socket. For details refer to your operating system documentation for the SO_SNDBUF socket option.

Option value type

int

Option value unit

bytes

Default value

8192

Applicable socket types

all

ZMQ_SNDHWM: Retrieves high water mark for outbound messages

The ZMQ_SNDHWM option shall return the high water mark for outbound messages on the specified socket. The high water mark is a hard limit on the maximum number of outstanding messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in zmq_socket(3) for details on the exact action taken for each socket type.

Option value type

int

Option value unit

messages

Default value

1000

Applicable socket types

all

ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN

Retrieve the timeout for send operation on the socket. If the value is 0, zmq_send(3) will return immediately, with a EAGAIN error if the message cannot be sent. If the value is -1, it will block until the message is sent. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error.

Option value type

int

Option value unit

milliseconds

Default value

-1 (infinite)

Applicable socket types

all

ZMQ_SOCKS_PROXY: Retrieve SOCKS5 proxy address

The ZMQ_SOCKS_PROXY option shall retrieve the SOCKS5 proxy address in string format. The returned value shall be a NULL-terminated string and MAY be empty. The returned size SHALL include the terminating null byte.

Option value type

NULL-terminated character string

Option value unit

N/A

Default value

null string

Applicable socket types

all, when using TCP transports

ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option

Override SO_KEEPALIVE socket option(where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,0,1

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option

Override TCP_KEEPCNT socket option(where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS)

Override TCP_KEEPIDLE(or TCP_KEEPALIVE on some OS) socket option (where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option

Override TCP_KEEPINTVL socket option(where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_MAXRT: Retrieve Max TCP Retransmit Timeout

On OSes where it is supported, retrieves how long before an unacknowledged TCP retransmit times out. The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

Option value type

int

Option value unit

milliseconds

Default value

0 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_THREAD_SAFE: Retrieve socket thread safety

The ZMQ_THREAD_SAFE option shall retrieve a boolean value indicating whether or not the socket is threadsafe. Currently ZMQ_CLIENT and ZMQ_SERVER sockets are threadsafe.

Option value type

boolean

Applicable socket types

all

ZMQ_TOS: Retrieve the Type-of-Service socket override status

Retrieve the IP_TOS option for the socket.

Option value type

int

Option value unit

>0

Default value

0

Applicable socket types

all, only for connection-oriented transports

ZMQ_TYPE: Retrieve socket type

The ZMQ_TYPE option shall retrieve the socket type for the specified socket. The socket type is specified at socket creation time and cannot be modified afterwards.

Option value type

int

Option value unit

N/A

Default value

N/A

Applicable socket types

all

ZMQ_ZAP_DOMAIN: Retrieve RFC 27 authentication domain

The ZMQ_ZAP_DOMAIN option shall retrieve the last ZAP domain set for the socket. The returned value shall be a NULL-terminated string and MAY be empty. An empty string means that ZAP authentication is disabled. The returned size SHALL include the terminating null byte.

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_ZAP_ENFORCE_DOMAIN: Retrieve ZAP domain handling mode

The ZMQ_ZAP_ENFORCE_DOMAIN option shall retrieve the flag that determines whether a ZAP domain is strictly required or not.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

all, when using ZAP

ZMQ_VMCI_BUFFER_SIZE: Retrieve buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_SIZE option shall retrieve the size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

65546

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_BUFFER_MIN_SIZE: Retrieve min buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_MIN_SIZE option shall retrieve the min size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

128

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_BUFFER_MAX_SIZE: Retrieve max buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_MAX_SIZE option shall retrieve the max size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

262144

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_CONNECT_TIMEOUT: Retrieve connection timeout of the VMCI socket

The ZMQ_VMCI_CONNECT_TIMEOUT option shall retrieve connection timeout for the socket.

Option value type

int

Option value unit

milliseconds

Default value

-1

Applicable socket types

all, when using VMCI transport

RETURN VALUE

The zmq_getsockopt() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown, or the requested option_len or option_value is invalid, or the size of the buffer pointed to by option_value, as specified by option_len, is insufficient for storing the option value.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal.

EXAMPLE

Retrieving the high water mark for outgoing messages
/* Retrieve high water mark into sndhwm */
int sndhwm;
size_t sndhwm_size = sizeof (sndhwm);
rc = zmq_getsockopt (socket, ZMQ_SNDHWM, &sndhwm, &sndhwm_size);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_vmci.70000664000372000037200000001101313255253402016420 0ustar00travistravis00000000000000'\" t .\" Title: zmq_vmci .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_VMCI" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_vmci \- 0MQ transport over virtual machine communicatios interface (VMCI) sockets .SH "SYNOPSIS" .sp The VMCI transport passes messages between VMware virtual machines running on the same host, between virtual machine and the host and within virtual machines (inter\-process transport like ipc)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Communication between a virtual machine and the host is not supported on Mac OS X 10\&.9 and above\&. .sp .5v .RE .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the VMCI transport, the transport is vmci, and the meaning of the \fIaddress\fR part is defined below\&. .SS "Binding a socket" .sp When binding a \fIsocket\fR to a local address using \fIzmq_bind()\fR with the \fIvmci\fR transport, the \fIendpoint\fR shall be interpreted as an \fIinterface\fR followed by a colon and the TCP port number to use\&. .sp An \fIinterface\fR may be specified by either of the following: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The wild\-card *, meaning all available interfaces\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} An integer returned by VMCISock_GetLocalCID or @ (ZeroMQ will call VMCISock_GetLocalCID internally)\&. .RE .sp The port may be specified by: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A numeric value, usually above 1024 on POSIX systems\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The wild\-card *, meaning a system\-assigned ephemeral port\&. .RE .SS "Unbinding wild\-card address from a socket" .sp When wild\-card * \fIendpoint\fR was used in \fIzmq_bind()\fR, the caller should use real \fIendpoint\fR obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this \fIendpoint\fR from a socket using \fIzmq_unbind()\fR\&. .SS "Connecting a socket" .sp When connecting a socket to a peer address using \fIzmq_connect()\fR with the \fIvmci\fR transport, the \fIendpoint\fR shall be interpreted as a \fIpeer address\fR followed by a colon and the port number to use\&. .sp A \fIpeer address\fR must be a CID of the peer\&. .SH "EXAMPLES" .PP \fBAssigning a local address to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // VMCI port 5555 on all available interfaces rc = zmq_bind(socket, "vmci://*:5555"); assert (rc == 0); // VMCI port 5555 on the local loop\-back interface on all platforms cid = VMCISock_GetLocalCID(); sprintf(endpoint, "vmci://%d:5555", cid); rc = zmq_bind(socket, endpoint); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connecting using a CID sprintf(endpoint, "vmci://%d:5555", cid); rc = zmq_connect(socket, endpoint); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_inproc\fR(7) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq_vmci\fR(7) \fBzmq_getsockopt\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_vmci.txt0000664000372000037200000000542013255253220017074 0ustar00travistravis00000000000000zmq_vmci(7) =========== NAME ---- zmq_vmci - 0MQ transport over virtual machine communicatios interface (VMCI) sockets SYNOPSIS -------- The VMCI transport passes messages between VMware virtual machines running on the same host, between virtual machine and the host and within virtual machines (inter-process transport like ipc). NOTE: Communication between a virtual machine and the host is not supported on Mac OS X 10.9 and above. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the VMCI transport, the transport is `vmci`, and the meaning of the 'address' part is defined below. Binding a socket ~~~~~~~~~~~~~~~~ When binding a 'socket' to a local address using _zmq_bind()_ with the 'vmci' transport, the 'endpoint' shall be interpreted as an 'interface' followed by a colon and the TCP port number to use. An 'interface' may be specified by either of the following: * The wild-card `*`, meaning all available interfaces. * An integer returned by `VMCISock_GetLocalCID` or `@` (ZeroMQ will call VMCISock_GetLocalCID internally). The port may be specified by: * A numeric value, usually above 1024 on POSIX systems. * The wild-card `*`, meaning a system-assigned ephemeral port. Unbinding wild-card address from a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When wild-card `*` 'endpoint' was used in _zmq_bind()_, the caller should use real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this 'endpoint' from a socket using _zmq_unbind()_. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a socket to a peer address using _zmq_connect()_ with the 'vmci' transport, the 'endpoint' shall be interpreted as a 'peer address' followed by a colon and the port number to use. A 'peer address' must be a CID of the peer. EXAMPLES -------- .Assigning a local address to a socket ---- // VMCI port 5555 on all available interfaces rc = zmq_bind(socket, "vmci://*:5555"); assert (rc == 0); // VMCI port 5555 on the local loop-back interface on all platforms cid = VMCISock_GetLocalCID(); sprintf(endpoint, "vmci://%d:5555", cid); rc = zmq_bind(socket, endpoint); assert (rc == 0); ---- .Connecting a socket ---- // Connecting using a CID sprintf(endpoint, "vmci://%d:5555", cid); rc = zmq_connect(socket, endpoint); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_inproc[7] linkzmq:zmq_tcp[7] linkzmq:zmq_pgm[7] linkzmq:zmq_vmci[7] linkzmq:zmq_getsockopt[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_data.html0000664000372000037200000004420613255253331020052 0ustar00travistravis00000000000000 zmq_msg_data(3)

SYNOPSIS

void *zmq_msg_data (zmq_msg_t *msg);

DESCRIPTION

The zmq_msg_data() function shall return a pointer to the message content of the message object referenced by msg.

Caution
Never access zmq_msg_t members directly, instead always use the zmq_msg family of functions.

RETURN VALUE

Upon successful completion, zmq_msg_data() shall return a pointer to the message content.

ERRORS

No errors are defined.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_setsockopt.30000664000372000037200000017203313255253366017677 0ustar00travistravis00000000000000'\" t .\" Title: zmq_setsockopt .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SETSOCKOPT" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_setsockopt \- set 0MQ socket options .SH "SYNOPSIS" .sp \fBint zmq_setsockopt (void \fR\fB\fI*socket\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, const void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fIoption_len\fR\fR\fB);\fR .sp Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_HANDOVER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE, ZMQ_XPUB_VERBOSER, ZMQ_REQ_CORRELATE, ZMQ_REQ_RELAXED, ZMQ_SNDHWM and ZMQ_RCVHWM, only take effect for subsequent socket bind/connects\&. .sp Specifically, security options take effect for subsequent bind/connect calls, and can be changed at any time to affect subsequent binds and/or connects\&. .SH "DESCRIPTION" .sp The \fIzmq_setsockopt()\fR function shall set the option specified by the \fIoption_name\fR argument to the value pointed to by the \fIoption_value\fR argument for the 0MQ socket pointed to by the \fIsocket\fR argument\&. The \fIoption_len\fR argument is the size of the option value in bytes\&. For options taking a value of type "character string", the provided byte data should either contain no zero bytes, or end in a single zero byte (terminating ASCII NUL character)\&. .sp The following socket options can be set with the \fIzmq_setsockopt()\fR function: .SS "ZMQ_AFFINITY: Set I/O thread affinity" .sp The \fIZMQ_AFFINITY\fR option shall set the I/O thread affinity for newly created connections on the specified \fIsocket\fR\&. .sp Affinity determines which threads from the 0MQ I/O thread pool associated with the socket\(cqs \fIcontext\fR shall handle newly created connections\&. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all 0MQ I/O threads in the thread pool\&. For non\-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on\&. For example, a value of 3 specifies that subsequent connections on \fIsocket\fR shall be handled exclusively by I/O threads 1 and 2\&. .sp See also \fBzmq_init\fR(3) for details on allocating the number of I/O threads for a specific \fIcontext\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp N/A (bitmap) T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp N/A T} .TE .sp 1 .SS "ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections" .sp The \fIZMQ_BACKLOG\fR option shall set the maximum length of the queue of outstanding peer connections for the specified \fIsocket\fR; this only applies to connection\-oriented transports\&. For details refer to your operating system documentation for the \fIlisten\fR function\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp connections T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports\&. T} .TE .sp 1 .SS "ZMQ_BINDTODEVICE: Set name of device to bind the socket to" .sp The \fIZMQ_BINDTODEVICE\fR option binds this socket to a particular device, eg\&. an interface or VRF\&. If a socket is bound to an interface, only packets received from that particular interface are processed by the socket\&. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp requires setting CAP_NET_RAW on the compiled program\&. NOTE: in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or UDP transports\&. T} .TE .sp 1 .SS "ZMQ_CONNECT_RID: Assign the next outbound connection id" .sp This option name is now deprecated\&. Use ZMQ_CONNECT_ROUTING_ID instead\&. ZMQ_CONNECT_RID remains as an alias for now\&. .SS "ZMQ_CONNECT_ROUTING_ID: Assign the next outbound routing id" .sp The \fIZMQ_CONNECT_ROUTING_ID\fR option sets the peer id of the peer connected via the next zmq_connect() call, such that that connection is immediately ready for data transfer with the given routing id\&. This option applies only to the first subsequent call to zmq_connect(), zmq_connect() calls thereafter use the default connection behaviour\&. .sp Typical use is to set this socket option ahead of each zmq_connect() call\&. Each connection MUST be assigned a unique routing id\&. Assigning a routing id that is already in use is not allowed\&. .sp Useful when connecting ROUTER to ROUTER, or STREAM to STREAM, as it allows for immediate sending to peers\&. Outbound routing id framing requirements for ROUTER and STREAM sockets apply\&. .sp The routing id must be from 1 to 255 bytes long and MAY NOT start with a zero byte (such routing ids are reserved for internal use by the 0MQ infrastructure)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_ROUTER, ZMQ_STREAM T} .TE .sp 1 .SS "ZMQ_CONFLATE: Keep only last message" .sp If set, a socket shall keep only one message in its inbound/outbound queue, this message being the last message received/the last message to be sent\&. Ignores \fIZMQ_RCVHWM\fR and \fIZMQ_SNDHWM\fR options\&. Does not support multi\-part messages, in particular, only one part of it is kept in the socket internal queue\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER T} .TE .sp 1 .SS "ZMQ_CONNECT_TIMEOUT: Set connect() timeout" .sp Sets how long to wait before timing\-out a connect() system call\&. The connect() system call normally takes a long time before it returns a time out error\&. Setting this option allows the library to time out the call at an earlier interval\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (disabled) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_CURVE_PUBLICKEY: Set CURVE public key" .sp Sets the socket\(cqs long term public key\&. You must set this on CURVE client sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format and terminated in a null byte\&. The public key must always be used with the matching secret key\&. To generate a public/secret key pair, use \fBzmq_curve_keypair\fR(3)\&. To derive the public key from a secret key, use \fBzmq_curve_public\fR(3)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp an option value size of 40 is supported for backwards compatibility, though is deprecated\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_CURVE_SECRETKEY: Set CURVE secret key" .sp Sets the socket\(cqs long term secret key\&. You must set this on both CURVE client and server sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format and terminated in a null byte\&. To generate a public/secret key pair, use \fBzmq_curve_keypair\fR(3)\&. To derive the public key from a secret key, use \fBzmq_curve_public\fR(3)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp an option value size of 40 is supported for backwards compatibility, though is deprecated\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_CURVE_SERVER: Set CURVE server role" .sp Defines whether the socket will act as server for CURVE security, see \fBzmq_curve\fR(7)\&. A value of \fI1\fR means the socket will act as CURVE server\&. A value of \fI0\fR means the socket will not act as CURVE server, and its security role then depends on other option settings\&. Setting this to \fI0\fR shall reset the socket security to NULL\&. When you set this you must also set the server\(cqs secret key using the ZMQ_CURVE_SECRETKEY option\&. A server socket does not need to know its own public key\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_CURVE_SERVERKEY: Set CURVE server key" .sp Sets the socket\(cqs long term server key\&. You must set this on CURVE client sockets, see \fBzmq_curve\fR(7)\&. You can provide the key as 32 binary bytes, or as a 40\-character string encoded in the Z85 encoding format and terminated in a null byte\&. This key must have been generated together with the server\(cqs secret key\&. To generate a public/secret key pair, use \fBzmq_curve_keypair\fR(3)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp an option value size of 40 is supported for backwards compatibility, though is deprecated\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data or Z85 text string T} T{ .sp Option value size T}:T{ .sp 32 or 41 T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_PLAINTEXT: Disable GSSAPI encryption" .sp Defines whether communications on the socket will be encrypted, see \fBzmq_gssapi\fR(7)\&. A value of \fI1\fR means that communications will be plaintext\&. A value of \fI0\fR means communications will be encrypted\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_PRINCIPAL: Set name of GSSAPI principal" .sp Sets the name of the principal for whom GSSAPI credentials should be acquired\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVER: Set GSSAPI server role" .sp Defines whether the socket will act as server for GSSAPI security, see \fBzmq_gssapi\fR(7)\&. A value of \fI1\fR means the socket will act as GSSAPI server\&. A value of \fI0\fR means the socket will act as GSSAPI client\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVICE_PRINCIPAL: Set name of GSSAPI service principal" .sp Sets the name of the principal of the GSSAPI server to which a GSSAPI client intends to connect\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Set name type of service principal" .sp Sets the name type of the GSSAPI service principal\&. A value of \fIZMQ_GSSAPI_NT_HOSTBASED\fR (0) means the name specified with \fIZMQ_GSSAPI_SERVICE_PRINCIPAL\fR is interpreted as a host based name\&. A value of \fIZMQ_GSSAPI_NT_USER_NAME\fR (1) means it is interpreted as a local user name\&. A value of \fIZMQ_GSSAPI_NT_KRB5_PRINCIPAL\fR (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1, 2 T} T{ .sp Default value T}:T{ .sp 0 (ZMQ_GSSAPI_NT_HOSTBASED) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transport T} .TE .sp 1 .SS "ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Set name type of principal" .sp Sets the name type of the GSSAPI principal\&. A value of \fIZMQ_GSSAPI_NT_HOSTBASED\fR (0) means the name specified with \fIZMQ_GSSAPI_PRINCIPAL\fR is interpreted as a host based name\&. A value of \fIZMQ_GSSAPI_NT_USER_NAME\fR (1) means it is interpreted as a local user name\&. A value of \fIZMQ_GSSAPI_NT_KRB5_PRINCIPAL\fR (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1, 2 T} T{ .sp Default value T}:T{ .sp 0 (ZMQ_GSSAPI_NT_HOSTBASED) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP or IPC transport T} .TE .sp 1 .SS "ZMQ_HANDSHAKE_IVL: Set maximum handshake interval" .sp The \fIZMQ_HANDSHAKE_IVL\fR option shall set the maximum handshake interval for the specified \fIsocket\fR\&. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection\-oriented transports\&. If handshaking does not complete within the configured time, the connection shall be closed\&. The value 0 means no handshake time limit\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 30000 T} T{ .sp Applicable socket types T}:T{ .sp all but ZMQ_STREAM, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats" .sp The \fIZMQ_HEARTBEAT_IVL\fR option shall set the interval between sending ZMTP heartbeats for the specified \fIsocket\fR\&. If this option is set and is greater than 0, then a \fIPING\fR ZMTP command will be sent every \fIZMQ_HEARTBEAT_IVL\fR milliseconds\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_HEARTBEAT_TIMEOUT: Set timeout for ZMTP heartbeats" .sp The \fIZMQ_HEARTBEAT_TIMEOUT\fR option shall set how long to wait before timing\-out a connection after sending a \fIPING\fR ZMTP command and not receiving any traffic\&. This option is only valid if \fIZMQ_HEARTBEAT_IVL\fR is also set, and is greater than 0\&. The connection will time out if there is no traffic received after sending the \fIPING\fR command, but the received traffic does not have to be a \fIPONG\fR command \- any received traffic will cancel the timeout\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_HEARTBEAT_TTL: Set the TTL value for ZMTP heartbeats" .sp The \fIZMQ_HEARTBEAT_TTL\fR option shall set the timeout on the remote peer for ZMTP heartbeats\&. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period\&. This option does not have any effect if \fIZMQ_HEARTBEAT_IVL\fR is not set or is 0\&. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_IDENTITY: Set socket identity" .sp This option name is now deprecated\&. Use ZMQ_ROUTING_ID instead\&. ZMQ_IDENTITY remains as an alias for now\&. .SS "ZMQ_IMMEDIATE: Queue messages only to completed connections" .sp By default queues will fill on outgoing connections even if the connection has not completed\&. This can lead to "lost" messages on sockets with round\-robin routing (REQ, PUSH, DEALER)\&. If this option is set to 1, messages shall be queued only to completed connections\&. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports\&. T} .TE .sp 1 .SS "ZMQ_INVERT_MATCHING: Invert message filtering" .sp Reverses the filtering behavior of PUB\-SUB sockets, when set to 1\&. .sp On \fIPUB\fR and \fIXPUB\fR sockets, this causes messages to be sent to all connected sockets \fIexcept\fR those subscribed to a prefix that matches the message\&. On \fISUB\fR sockets, this causes only incoming messages that do \fInot\fR match any of the socket\(cqs subscriptions to be received by the user\&. .sp Whenever \fIZMQ_INVERT_MATCHING\fR is set to 1 on a \fIPUB\fR socket, all \fISUB\fR sockets connecting to it must also have the option set to 1\&. Failure to do so will have the \fISUB\fR sockets reject everything the \fIPUB\fR socket sends them\&. \fIXSUB\fR sockets do not need to do this because they do not filter incoming messages\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0,1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB T} .TE .sp 1 .SS "ZMQ_IPV6: Enable IPv6 on socket" .sp Set the IPv6 option for the socket\&. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4\&. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 0 (false) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_LINGER: Set linger period for socket shutdown" .sp The \fIZMQ_LINGER\fR option shall set the linger period for the specified \fIsocket\fR\&. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is disconnected with \fBzmq_disconnect\fR(3) or closed with \fBzmq_close\fR(3), and further affects the termination of the socket\(cqs context with \fBzmq_ctx_term\fR(3)\&. The following outlines the different behaviours: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} A value of \fI\-1\fR specifies an infinite linger period\&. Pending messages shall not be discarded after a call to \fIzmq_disconnect()\fR or \fIzmq_close()\fR; attempting to terminate the socket\(cqs context with \fIzmq_ctx_term()\fR shall block until all pending messages have been sent to a peer\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The value of \fI0\fR specifies no linger period\&. Pending messages shall be discarded immediately after a call to \fIzmq_disconnect()\fR or \fIzmq_close()\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Positive values specify an upper bound for the linger period in milliseconds\&. Pending messages shall not be discarded after a call to \fIzmq_disconnect()\fR or \fIzmq_close()\fR; attempting to terminate the socket\(cqs context with \fIzmq_ctx_term()\fR shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ Option value type T}:T{ int T} T{ Option value unit T}:T{ milliseconds T} T{ Default value T}:T{ \-1 (infinite) T} T{ Applicable socket types T}:T{ all T} .TE .sp 1 .RE .SS "ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size" .sp Limits the size of the inbound message\&. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected\&. Value of \-1 means \fIno limit\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_METADATA: Add application metadata properties to a socket" .sp The \fIZMQ_METADATA\fR option shall add application metadata to the specified \fIsocket\fR, the metadata is exchanged with peers during connection setup\&. A metadata property is specfied as a string, delimited by a colon, starting with the metadata \fIproperty\fR followed by the metadata value, for example "X\-key:value"\&. \fIProperty\fR names are restrited to maximum 255 characters and must be prefixed by "X\-"\&. Multiple application metadata properties can be added to a socket by executing zmq_setsockopt() multiple times\&. As the argument is a null\-terminated string, binary data must be encoded before it is added e\&.g\&. using Z85 (\fBzmq_z85_encode\fR(3))\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp in DRAFT state, not yet available in stable releases\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets" .sp Sets the time\-to\-live field in every multicast packet sent from this socket\&. The default is 1 which means that the multicast packets don\(cqt leave the local network\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp network hops T} T{ .sp Default value T}:T{ .sp 1 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets" .sp Sets the maximum transport data unit size used for outbound multicast packets\&. .sp This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 1500 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_PLAIN_PASSWORD: Set PLAIN security password" .sp Sets the password for outgoing connections over TCP or IPC\&. If you set this to a non\-null value, the security mechanism used for connections shall be PLAIN, see \fBzmq_plain\fR(7)\&. If you set this to a null value, the security mechanism used for connections shall be NULL, see \fBzmq_null\fR(3)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_PLAIN_SERVER: Set PLAIN server role" .sp Defines whether the socket will act as server for PLAIN security, see \fBzmq_plain\fR(7)\&. A value of \fI1\fR means the socket will act as PLAIN server\&. A value of \fI0\fR means the socket will not act as PLAIN server, and its security role then depends on other option settings\&. Setting this to \fI0\fR shall reset the socket security to NULL\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_PLAIN_USERNAME: Set PLAIN security username" .sp Sets the username for outgoing connections over TCP or IPC\&. If you set this to a non\-null value, the security mechanism used for connections shall be PLAIN, see \fBzmq_plain\fR(7)\&. If you set this to a null value, the security mechanism used for connections shall be NULL, see \fBzmq_null\fR(3)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_USE_FD: Set the pre\-allocated socket file descriptor" .sp When set to a positive integer value before zmq_bind is called on the socket, the socket shall use the corresponding file descriptor for connections over TCP or IPC instead of allocating a new file descriptor\&. Useful for writing systemd socket activated services\&. If set to \-1 (default), a new file descriptor will be allocated instead (default behaviour)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp if set after calling zmq_bind, this option shall have no effect\&. NOTE: the file descriptor passed through MUST have been ran through the "bind" and "listen" system calls beforehand\&. Also, socket option that would normally be passed through zmq_setsockopt like TCP buffers length, IP_TOS or SO_REUSEADDR MUST be set beforehand by the caller, as they must be set before the socket is bound\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp file descriptor T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all bound sockets, when using IPC or TCP transport T} .TE .sp 1 .SS "ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets" .sp When set to 1, the socket will automatically send an empty message when a new connection is made or accepted\&. You may set this on REQ, DEALER, or ROUTER sockets connected to a ROUTER socket\&. The application must filter such empty messages\&. The ZMQ_PROBE_ROUTER option in effect provides the ROUTER application with an event signaling the arrival of a new peer\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp do not set this option on a socket that talks to any other socket types: the results are undefined\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ T} .TE .sp 1 .SS "ZMQ_RATE: Set multicast data rate" .sp The \fIZMQ_RATE\fR option shall set the maximum send or receive data rate for multicast transports such as \fBzmq_pgm\fR(7) using the specified \fIsocket\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp kilobits per second T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_RCVBUF: Set kernel receive buffer size" .sp The \fIZMQ_RCVBUF\fR option shall set the underlying kernel receive buffer size for the \fIsocket\fR to the specified size in bytes\&. A value of \-1 means leave the OS default unchanged\&. For details refer to your operating system documentation for the \fISO_RCVBUF\fR socket option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RCVHWM: Set high water mark for inbound messages" .sp The \fIZMQ_RCVHWM\fR option shall set the high water mark for inbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&. .sp If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp messages T} T{ .sp Default value T}:T{ .sp 1000 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN" .sp Sets the timeout for receive operation on the socket\&. If the value is 0, \fIzmq_recv(3)\fR will return immediately, with a EAGAIN error if there is no message to receive\&. If the value is \-1, it will block until a message is available\&. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 (infinite) T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_RECONNECT_IVL: Set reconnection interval" .sp The \fIZMQ_RECONNECT_IVL\fR option shall set the initial reconnection interval for the specified \fIsocket\fR\&. The reconnection interval is the period 0MQ shall wait between attempts to reconnect disconnected peers when using connection\-oriented transports\&. The value \-1 means no reconnection\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The reconnection interval may be randomized by 0MQ to prevent reconnection storms in topologies with a large number of peers per socket\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 100 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval" .sp The \fIZMQ_RECONNECT_IVL_MAX\fR option shall set the maximum reconnection interval for the specified \fIsocket\fR\&. This is the maximum period 0MQ shall wait between attempts to reconnect\&. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached\&. This allows for exponential backoff strategy\&. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Values less than ZMQ_RECONNECT_IVL will be ignored\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (only use ZMQ_RECONNECT_IVL) T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_RECOVERY_IVL: Set multicast recovery interval" .sp The \fIZMQ_RECOVERY_IVL\fR option shall set the recovery interval for multicast transports using the specified \fIsocket\fR\&. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Exercise care when setting large recovery intervals as the data needed for recovery will be held in memory\&. For example, a 1 minute recovery interval at a data rate of 1Gbps requires a 7GB in\-memory buffer\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 10000 T} T{ .sp Applicable socket types T}:T{ .sp all, when using multicast transports T} .TE .sp 1 .SS "ZMQ_REQ_CORRELATE: match replies with requests" .sp The default behaviour of REQ sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient\&. When this option is set to 1, the REQ socket will prefix outgoing messages with an extra frame containing a request id\&. That means the full message is (request id, 0, user frames\&...)\&. The REQ socket will discard all incoming messages that don\(cqt begin with these two frames\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_REQ T} .TE .sp 1 .SS "ZMQ_REQ_RELAXED: relax strict alternation between request and reply" .sp By default, a REQ socket does not allow initiating a new request with \fIzmq_send(3)\fR until the reply to the previous one has been received\&. When set to 1, sending another message is allowed and previous replies will be discarded if any\&. The request\-reply state machine is reset and a new request is sent to the next available peer\&. .sp If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of requests and replies\&. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_REQ T} .TE .sp 1 .SS "ZMQ_ROUTER_HANDOVER: handle duplicate client routing ids on ROUTER sockets" .sp If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting\&. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already\-used routing id\&. If that option is set to 1, the ROUTER socket shall hand\-over the connection to the new client and disconnect the existing one\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_ROUTER T} .TE .sp 1 .SS "ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets" .sp Sets the ROUTER socket behaviour when an unroutable message is encountered\&. A value of 0 is the default and discards the message silently when it cannot be routed or the peers SNDHWM is reached\&. A value of 1 returns an \fIEHOSTUNREACH\fR error code if the message cannot be routed or \fIEAGAIN\fR error code if the SNDHWM is reached and ZMQ_DONTWAIT was used\&. Without ZMQ_DONTWAIT it will block until the SNDTIMEO is reached or a spot in the send queue opens up\&. .sp When ZMQ_ROUTER_MANDATORY is set to 1, \fIZMQ_POLLOUT\fR events will be generated if one or more messages can be sent to at least one of the peers\&. If ZMQ_ROUTER_MANDATORY is set to 0, the socket will generate a \fIZMQ_POLLOUT\fR event on every call to \fIzmq_poll\fR\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_ROUTER T} .TE .sp 1 .SS "ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode" .sp Sets the raw mode on the ROUTER, when set to 1\&. When the ROUTER socket is in raw mode, and when using the tcp:// transport, it will read and write TCP data without 0MQ framing\&. This lets 0MQ applications talk to non\-0MQ applications\&. When using raw mode, you cannot set explicit identities, and the ZMQ_SNDMORE flag is ignored when sending data messages\&. In raw mode you can close a specific connection by sending it a zero\-length message (following the routing id frame)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This option is deprecated, please use ZMQ_STREAM sockets instead\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_ROUTER T} .TE .sp 1 .SS "ZMQ_ROUTING_ID: Set socket routing id" .sp The \fIZMQ_ROUTING_ID\fR option shall set the routing id of the specified \fIsocket\fR when connecting to a ROUTER socket\&. .sp A routing id must be at least one byte and at most 255 bytes long\&. Identities starting with a zero byte are reserved for use by the 0MQ infrastructure\&. .sp If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting\&. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already\-used routing id\&. If that option is set to 1, the ROUTER socket shall hand\-over the connection to the new client and disconnect the existing one\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER\&. T} .TE .sp 1 .SS "ZMQ_SNDBUF: Set kernel transmit buffer size" .sp The \fIZMQ_SNDBUF\fR option shall set the underlying kernel transmit buffer size for the \fIsocket\fR to the specified size in bytes\&. A value of \-1 means leave the OS default unchanged\&. For details please refer to your operating system documentation for the \fISO_SNDBUF\fR socket option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SNDHWM: Set high water mark for outbound messages" .sp The \fIZMQ_SNDHWM\fR option shall set the high water mark for outbound messages on the specified \fIsocket\fR\&. The high water mark is a hard limit on the maximum number of outstanding messages 0MQ shall queue in memory for any single peer that the specified \fIsocket\fR is communicating with\&. A value of zero means no limit\&. .sp If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, 0MQ shall take appropriate action such as blocking or dropping sent messages\&. Refer to the individual socket descriptions in \fBzmq_socket\fR(3) for details on the exact action taken for each socket type\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp 0MQ does not guarantee that the socket will accept as many as ZMQ_SNDHWM messages, and the actual limit may be as much as 90% lower depending on the flow of messages on the socket\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp messages T} T{ .sp Default value T}:T{ .sp 1000 T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN" .sp Sets the timeout for send operation on the socket\&. If the value is 0, \fIzmq_send(3)\fR will return immediately, with a EAGAIN error if the message cannot be sent\&. If the value is \-1, it will block until the message is sent\&. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 (infinite) T} T{ .sp Applicable socket types T}:T{ .sp all T} .TE .sp 1 .SS "ZMQ_SOCKS_PROXY: Set SOCKS5 proxy address" .sp Sets the SOCKS5 proxy address that shall be used by the socket for the TCP connection(s)\&. Does not support SOCKS5 authentication\&. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp not set T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_STREAM_NOTIFY: send connect and disconnect notifications" .sp Enables connect and disconnect notifications on a STREAM socket, when set to 1\&. When notifications are enabled, the socket delivers a zero\-length message when a peer connects or disconnects\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 1 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_STREAM T} .TE .sp 1 .SS "ZMQ_SUBSCRIBE: Establish message filter" .sp The \fIZMQ_SUBSCRIBE\fR option shall establish a new message filter on a \fIZMQ_SUB\fR socket\&. Newly created \fIZMQ_SUB\fR sockets shall filter out all incoming messages, therefore you should call this option to establish an initial message filter\&. .sp An empty \fIoption_value\fR of length zero shall subscribe to all incoming messages\&. A non\-empty \fIoption_value\fR shall subscribe to all messages beginning with the specified prefix\&. Multiple filters may be attached to a single \fIZMQ_SUB\fR socket, in which case a message shall be accepted if it matches at least one filter\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_SUB T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option" .sp Override \fISO_KEEPALIVE\fR socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,0,1 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option" .sp Override \fITCP_KEEPCNT\fR socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS)" .sp Override \fITCP_KEEPIDLE\fR (or \fITCP_KEEPALIVE\fR on some OS) socket option (where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option" .sp Override \fITCP_KEEPINTVL\fR socket option(where supported by OS)\&. The default value of \-1 means to skip any overrides and leave it to OS default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp \-1,>0 T} T{ .sp Default value T}:T{ .sp \-1 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TCP_MAXRT: Set TCP Maximum Retransmit Timeout" .sp On OSes where it is supported, sets how long before an unacknowledged TCP retransmit times out\&. The system normally attempts many TCP retransmits following an exponential backoff strategy\&. This means that after a network outage, it may take a long time before the session can be re\-established\&. Setting this option allows the timeout to happen at a shorter interval\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp 0 (leave to OS default) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_TOS: Set the Type\-of\-Service on socket" .sp Sets the ToS fields (Differentiated services (DS) and Explicit Congestion Notification (ECN) field of the IP header\&. The ToS field is typically used to specify a packets priority\&. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low\-delay, high\-throughput, highly\-reliable service, etc\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp >0 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, only for connection\-oriented transports T} .TE .sp 1 .SS "ZMQ_UNSUBSCRIBE: Remove message filter" .sp The \fIZMQ_UNSUBSCRIBE\fR option shall remove an existing message filter on a \fIZMQ_SUB\fR socket\&. The filter specified must match an existing filter previously established with the \fIZMQ_SUBSCRIBE\fR option\&. If the socket has several instances of the same filter attached the \fIZMQ_UNSUBSCRIBE\fR option shall remove only one instance, leaving the rest in place and functional\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp N/A T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_SUB T} .TE .sp 1 .SS "ZMQ_XPUB_VERBOSE: pass duplicate subscribe messages on XPUB socket" .sp Sets the \fIXPUB\fR socket behaviour on new duplicated subscriptions\&. If enabled, the socket passes all subscribe messages to the caller\&. If disabled, only the first subscription to each filter will be passed\&. The default is 0 (disabled)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_XPUB T} .TE .sp 1 .SS "ZMQ_XPUB_VERBOSER: pass duplicate subscribe and unsubscribe messages on XPUB socket" .sp Sets the \fIXPUB\fR socket behaviour on new duplicated subscriptions and unsubscriptions\&. If enabled, the socket passes all subscribe and unsubscribe messages to the caller\&. If disabled, only the first subscription to each filter and the last unsubscription from each filter will be passed\&. The default is 0 (disabled)\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_XPUB T} .TE .sp 1 .SS "ZMQ_XPUB_MANUAL: change the subscription handling to manual" .sp Sets the \fIXPUB\fR socket subscription handling mode manual/automatic\&. A value of \fI0\fR is the default and subscription requests will be handled automatically\&. A value of \fI1\fR will change the subscription requests handling to manual, with manual mode subscription requests are not added to the subscription list\&. To add subscription the user need to call setsockopt with ZMQ_SUBSCRIBE on XPUB socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_XPUB T} .TE .sp 1 .SS "ZMQ_XPUB_NODROP: do not silently drop messages if SENDHWM is reached" .sp Sets the \fIXPUB\fR socket behaviour to return error EAGAIN if SENDHWM is reached and the message could not be send\&. .sp A value of 0 is the default and drops the message silently when the peers SNDHWM is reached\&. A value of 1 returns an \fIEAGAIN\fR error code if the SNDHWM is reached and ZMQ_DONTWAIT was used\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_XPUB, ZMQ_PUB T} .TE .sp 1 .SS "ZMQ_XPUB_WELCOME_MSG: set welcome message that will be received by subscriber when connecting" .sp Sets a welcome message the will be recieved by subscriber when connecting\&. Subscriber must subscribe to the Welcome message before connecting\&. Welcome message will also be sent on reconnecting\&. For welcome message to work well user must poll on incoming subscription messages on the XPUB socket and handle them\&. .sp Use NULL and lenght of zero to disable welcome message\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp NULL T} T{ .sp Applicable socket types T}:T{ .sp ZMQ_XPUB T} .TE .sp 1 .SS "ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain" .sp Sets the domain for ZAP (ZMQ RFC 27) authentication\&. A ZAP domain must be specified to enable authentication\&. When the ZAP domain is empty, which is the default, ZAP authentication is disabled\&. This is not compatible with previous versions of libzmq, so it can be controlled by ZMQ_ZAP_ENFORCE_DOMAIN which for now is disabled by default\&. See \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:27\fR\m[] for more details\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp empty T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transport T} .TE .sp 1 .SS "ZMQ_ZAP_ENFORCE_DOMAIN: Set ZAP domain handling to strictly adhere the RFC" .sp The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set\&. Older versions of libzmq did not follow the spec and allowed an empty domain to be set\&. This option can be used to enabled or disable the stricter, backward incompatible behaviour\&. For now it is disabled by default, but in a future version it will be enabled by default\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp 0, 1 T} T{ .sp Default value T}:T{ .sp 0 T} T{ .sp Applicable socket types T}:T{ .sp all, when using ZAP T} .TE .sp 1 .SS "ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections" .sp Assign an arbitrary number of filters that will be applied for each new TCP transport connection on a listening socket\&. If no filters are applied, then the TCP transport allows connections from any IP address\&. If at least one filter is applied then new connection source ip should be matched\&. To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0)\&. Filter is a null\-terminated string with ipv6 or ipv4 CIDR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This option is deprecated, please use authentication via the ZAP API and IP address whitelisting / blacklisting\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp binary data T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp no filters (allow from all) T} T{ .sp Applicable socket types T}:T{ .sp all listening sockets, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_IPC_FILTER_GID: Assign group ID filters to allow new IPC connections" .sp Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket\&. If no IPC filters are applied, then the IPC transport allows connections from any process\&. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched\&. To clear all GID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_GID, NULL, 0)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp GID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp gid_t T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp no filters (allow from all) T} T{ .sp Applicable socket types T}:T{ .sp all listening sockets, when using IPC transports\&. T} .TE .sp 1 .SS "ZMQ_IPC_FILTER_PID: Assign process ID filters to allow new IPC connections" .sp Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket\&. If no IPC filters are applied, then the IPC transport allows connections from any process\&. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched\&. To clear all PID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_PID, NULL, 0)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp PID filters are only available on platforms supporting the SO_PEERCRED socket option (currently only Linux)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp pid_t T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp no filters (allow from all) T} T{ .sp Applicable socket types T}:T{ .sp all listening sockets, when using IPC transports\&. T} .TE .sp 1 .SS "ZMQ_IPC_FILTER_UID: Assign user ID filters to allow new IPC connections" .sp Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket\&. If no IPC filters are applied, then the IPC transport allows connections from any process\&. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched\&. To clear all UID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_UID, NULL, 0)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp UID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting\&. .sp .5v .RE .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uid_t T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp no filters (allow from all) T} T{ .sp Applicable socket types T}:T{ .sp all listening sockets, when using IPC transports\&. T} .TE .sp 1 .SS "ZMQ_IPV4ONLY: Use IPv4\-only on socket" .sp Set the IPv4\-only option for the socket\&. This option is deprecated\&. Please use the ZMQ_IPV6 option\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp boolean T} T{ .sp Default value T}:T{ .sp 1 (true) T} T{ .sp Applicable socket types T}:T{ .sp all, when using TCP transports\&. T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_SIZE: Set buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_SIZE option shall set the size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 65546 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_MIN_SIZE option shall set the min size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 128 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_BUFFER_MAX_SIZE: Set max buffer size of the VMCI socket" .sp The ZMQ_VMCI_BUFFER_MAX_SIZE option shall set the max size of the underlying buffer for the socket\&. Used during negotiation before the connection is established\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp uint64_t T} T{ .sp Option value unit T}:T{ .sp bytes T} T{ .sp Default value T}:T{ .sp 262144 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SS "ZMQ_VMCI_CONNECT_TIMEOUT: Set connection timeout of the VMCI socket" .sp The ZMQ_VMCI_CONNECT_TIMEOUT option shall set connection timeout for the socket\&. .TS tab(:); lt lt lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp int T} T{ .sp Option value unit T}:T{ .sp milliseconds T} T{ .sp Default value T}:T{ .sp \-1 T} T{ .sp Applicable socket types T}:T{ .sp all, when using VMCI transport T} .TE .sp 1 .SH "RETURN VALUE" .sp The \fIzmq_setsockopt()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown, or the requested \fIoption_len\fR or \fIoption_value\fR is invalid\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal\&. .RE .SH "EXAMPLE" .PP \fBSubscribing to messages on a ZMQ_SUB socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Subscribe to all messages */ rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); /* Subscribe to messages prefixed with "ANIMALS\&.CATS" */ rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "ANIMALS\&.CATS", 12); .fi .if n \{\ .RE .\} .PP \fBSetting I/O thread affinity\fR. .sp .if n \{\ .RS 4 .\} .nf int64_t affinity; /* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */ affinity = 1; rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity)); assert (rc); rc = zmq_bind (socket, "tcp://lo:5555"); assert (rc); /* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */ affinity = 2; rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity)); assert (rc); rc = zmq_bind (socket, "tcp://lo:5556"); assert (rc); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(3) \fBzmq_plain\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_move.30000664000372000037200000000512213255253354017304 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_move .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_MOVE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_move \- move content of a message to another message .SH "SYNOPSIS" .sp \fBint zmq_msg_move (zmq_msg_t \fR\fB\fI*dest\fR\fR\fB, zmq_msg_t \fR\fB\fI*src\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_move()\fR function shall move the content of the message object referenced by \fIsrc\fR to the message object referenced by \fIdest\fR\&. No actual copying of message content is performed, \fIdest\fR is simply updated to reference the new content\&. \fIsrc\fR becomes an empty message after calling \fIzmq_msg_move()\fR\&. The original content of \fIdest\fR, if any, shall be released\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_move()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEFAULT\fR .RS 4 Invalid message\&. .RE .SH "SEE ALSO" .sp \fBzmq_msg_copy\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_tcp.html0000664000372000037200000005353613255253344017073 0ustar00travistravis00000000000000 zmq_tcp(7)

SYNOPSIS

TCP is an ubiquitous, reliable, unicast transport. When connecting distributed applications over a network with ØMQ, using the TCP transport will likely be your first choice.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the TCP transport, the transport is tcp, and the meaning of the address part is defined below.

Assigning a local address to a socket

When assigning a local address to a socket using zmq_bind() with the tcp transport, the endpoint shall be interpreted as an interface followed by a colon and the TCP port number to use.

An interface may be specified by either of the following:

  • The wild-card *, meaning all available interfaces.

  • The primary IPv4 or IPv6 address assigned to the interface, in its numeric representation.

  • The non-portable interface name as defined by the operating system.

The TCP port number may be specified by:

  • A numeric value, usually above 1024 on POSIX systems.

  • The wild-card *, meaning a system-assigned ephemeral port.

When using ephemeral ports, the caller should retrieve the actual assigned port using the ZMQ_LAST_ENDPOINT socket option. See zmq_getsockopt(3) for details.

Unbinding wild-card address from a socket

When wild-card * endpoint was used in zmq_bind(), the caller should use real endpoint obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this endpoint from a socket using zmq_unbind().

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the tcp transport, the endpoint shall be interpreted as a peer address followed by a colon and the TCP port number to use. You can optionally specify a source_endpoint which will be used as the source address for your connection; tcp://source_endpoint;'endpoint', see the interface description above for details.

A peer address may be specified by either of the following:

  • The DNS name of the peer.

  • The IPv4 or IPv6 address of the peer, in its numeric representation.

Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is used by the TCP transport can be found at http://rfc.zeromq.org/spec:15

EXAMPLES

Assigning a local address to a socket
//  TCP port 5555 on all available interfaces
rc = zmq_bind(socket, "tcp://*:5555");
assert (rc == 0);
//  TCP port 5555 on the local loop-back interface on all platforms
rc = zmq_bind(socket, "tcp://127.0.0.1:5555");
assert (rc == 0);
//  TCP port 5555 on the first Ethernet network interface on Linux
rc = zmq_bind(socket, "tcp://eth0:5555");
assert (rc == 0);
Connecting a socket
//  Connecting using an IP address
rc = zmq_connect(socket, "tcp://192.168.1.1:5555");
assert (rc == 0);
//  Connecting using a DNS name
rc = zmq_connect(socket, "tcp://server1:5555");
assert (rc == 0);
//  Connecting using a DNS name and bind to eth1
rc = zmq_connect(socket, "tcp://eth1:0;server1:5555");
assert (rc == 0);
//  Connecting using a IP address and bind to an IP address
rc = zmq_connect(socket, "tcp://192.168.1.17:5555;192.168.1.1:5555");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_errno.30000664000372000037200000000474013255253367016626 0ustar00travistravis00000000000000'\" t .\" Title: zmq_errno .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ERRNO" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_errno \- retrieve value of errno for the calling thread .SH "SYNOPSIS" .sp \fBint zmq_errno (void);\fR .SH "DESCRIPTION" .sp The \fIzmq_errno()\fR function shall retrieve the value of the \fIerrno\fR variable for the calling thread\&. .sp The \fIzmq_errno()\fR function is provided to assist users on non\-POSIX systems who are experiencing issues with retrieving the correct value of \fIerrno\fR directly\&. Specifically, users on Win32 systems whose application is using a different C run\-time library from the C run\-time library in use by 0MQ will need to use \fIzmq_errno()\fR for correct operation\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br .sp Users not experiencing issues with retrieving the correct value of \fIerrno\fR should not use this function and should instead access the \fIerrno\fR variable directly\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_errno()\fR function shall return the value of the \fIerrno\fR variable for the calling thread\&. .SH "ERRORS" .sp No errors are defined\&. .SH "SEE ALSO" .sp \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_has.html0000664000372000037200000004423313255253342017050 0ustar00travistravis00000000000000 zmq_has(3)

SYNOPSIS

int zmq_has (const char *capability);

DESCRIPTION

The zmq_has() function shall report whether a specified capability is available in the library. This allows bindings and applications to probe a library directly, for transport and security options.

Capabilities shall be lowercase strings. The following capabilities are defined:

  • ipc - the library supports the ipc:// protocol

  • pgm - the library supports the pgm:// protocol

  • tipc - the library supports the tipc:// protocol

  • norm - the library supports the norm:// protocol

  • curve - the library supports the CURVE security mechanism

  • gssapi - the library supports the GSSAPI security mechanism

  • draft - the library is built with the draft api

When this method is provided, the zmq.h header file will define ZMQ_HAS_CAPABILITIES.

RETURN VALUE

The zmq_has() function shall return 1 if the specified capability is provided. Otherwise it shall return 0.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_socket.txt0000664000372000037200000005504713255253220017440 0ustar00travistravis00000000000000zmq_socket(3) ============= NAME ---- zmq_socket - create 0MQ socket SYNOPSIS -------- *void *zmq_socket (void '*context', int 'type');* DESCRIPTION ----------- The 'zmq_socket()' function shall create a 0MQ socket within the specified 'context' and return an opaque handle to the newly created socket. The 'type' argument specifies the socket type, which determines the semantics of communication over the socket. The newly created socket is initially unbound, and not associated with any endpoints. In order to establish a message flow a socket must first be connected to at least one endpoint with linkzmq:zmq_connect[3], or at least one endpoint must be created for accepting incoming connections with linkzmq:zmq_bind[3]. .Key differences to conventional sockets Generally speaking, conventional sockets present a _synchronous_ interface to either connection-oriented reliable byte streams (SOCK_STREAM), or connection-less unreliable datagrams (SOCK_DGRAM). In comparison, 0MQ sockets present an abstraction of an asynchronous _message queue_, with the exact queueing semantics depending on the socket type in use. Where conventional sockets transfer streams of bytes or discrete datagrams, 0MQ sockets transfer discrete _messages_. 0MQ sockets being _asynchronous_ means that the timings of the physical connection setup and tear down, reconnect and effective delivery are transparent to the user and organized by 0MQ itself. Further, messages may be _queued_ in the event that a peer is unavailable to receive them. Conventional sockets allow only strict one-to-one (two peers), many-to-one (many clients, one server), or in some cases one-to-many (multicast) relationships. With the exception of 'ZMQ_PAIR', 0MQ sockets may be connected *to multiple endpoints* using _zmq_connect()_, while simultaneously accepting incoming connections *from multiple endpoints* bound to the socket using _zmq_bind()_, thus allowing many-to-many relationships. .Thread safety 0MQ has both thread safe socket type and _not_ thread safe socket types. Applications MUST NOT use a _not_ thread safe socket from multiple threads except after migrating a socket from one thread to another with a "full fence" memory barrier. Following are the thread safe sockets: * ZMQ_CLIENT * ZMQ_SERVER * ZMQ_DISH * ZMQ_RADIO * ZMQ_SCATTER * ZMQ_GATHER .Socket types The following sections present the socket types defined by 0MQ, grouped by the general _messaging pattern_ which is built from related socket types. Client-server pattern ~~~~~~~~~~~~~~~~~~~~~ The client-server pattern is used to allow a single 'ZMQ_SERVER' _server_ talk to one or more 'ZMQ_CLIENT' _clients_. The client always starts the conversation, after which either peer can send messages asynchronously, to the other. The client-server pattern is formally defined by http://rfc.zeromq.org/spec:41. ZMQ_CLIENT ^^^^^^^^^^ A 'ZMQ_CLIENT' socket talks to a 'ZMQ_SERVER' socket. Either peer can connect, though the usual and recommended model is to bind the 'ZMQ_SERVER' and connect the 'ZMQ_CLIENT'. If the 'ZMQ_CLIENT' socket has established a connection, linkzmq:zmq_send[3] will accept messages, queue them, and send them as rapidly as the network allows. The outgoing buffer limit is defined by the high water mark for the socket. If the outgoing buffer is full, or if there is no connected peer, linkzmq:zmq_send[3] will block, by default. The 'ZMQ_CLIENT' socket will not drop messages. When a 'ZMQ_CLIENT' socket is connected to multiple 'ZMQ_SERVER' sockets, outgoing messages are distributed between connected peers on a round-robin basis. Likewise, the 'ZMQ_CLIENT' socket receives messages fairly from each connected peer. This usage is sensible only for stateless protocols. 'ZMQ_CLIENT' sockets are threadsafe and can be used from multiple threads at the same time. Note that replies from a 'ZMQ_SERVER' socket will go to the first client thread that calls linkzmq:zmq_msg_recv[3]. If you need to get replies back to the originating thread, use one 'ZMQ_CLIENT' socket per thread. NOTE: 'ZMQ_CLIENT' sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives. This limits them to single part data. The intention is to extend the API to allow scatter/gather of multi-part data. [horizontal] .Summary of ZMQ_CLIENT characteristics Compatible peer sockets:: 'ZMQ_SERVER' Direction:: Bidirectional Send/receive pattern:: Unrestricted Outgoing routing strategy:: Round-robin Incoming routing strategy:: Fair-queued Action in mute state:: Block ZMQ_SERVER ^^^^^^^^^^ A 'ZMQ_SERVER' socket talks to a set of 'ZMQ_CLIENT' sockets. A 'ZMQ_SERVER' socket can only reply to an incoming message: the 'ZMQ_CLIENT' peer must always initiate a conversation. Each received message has a 'routing_id' that is a 32-bit unsigned integer. The application can fetch this with linkzmq:zmq_msg_routing_id[3]. To send a message to a given 'ZMQ_CLIENT' peer the application must set the peer's 'routing_id' on the message, using linkzmq:zmq_msg_set_routing_id[3]. If the 'routing_id' is not specified, or does not refer to a connected client peer, the send call will fail with EHOSTUNREACH. If the outgoing buffer for the client peer is full, the send call shall block, unless ZMQ_DONT_WAIT is used in the send, in which case it shall fail with EAGAIN. The 'ZMQ_SERVER' socket shall not drop messages in any case. NOTE: 'ZMQ_SERVER' sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends not ZMQ_RCVMORE on receives. This limits them to single part data. The intention is to extend the API to allow scatter/gather of multi-part data. [horizontal] .Summary of ZMQ_SERVER characteristics Compatible peer sockets:: 'ZMQ_CLIENT' Direction:: Bidirectional Send/receive pattern:: Unrestricted Outgoing routing strategy:: See text Incoming routing strategy:: Fair-queued Action in mute state:: Return EAGAIN Radio-dish pattern ~~~~~~~~~~~~~~~~~~ The radio-dish pattern is used for one-to-many distribution of data from a single _publisher_ to multiple _subscribers_ in a fan out fashion. Radio-dish is using groups (vs Pub-sub topics), Dish sockets can join a group and each message sent by Radio sockets belong to a group. Groups are null terminated strings limited to 16 chars length (including null). The intention is to increase the length to 40 chars (including null). The encoding of groups shall be UTF8. Groups are matched using exact matching (vs prefix matching of PubSub). NOTE: Radio-dish is still in draft phase. ZMQ_RADIO ^^^^^^^ A socket of type 'ZMQ_RADIO' is used by a _publisher_ to distribute data. Each message belong to a group, a group is specified with linkzmq:zmq_msg_set_group[3]. Messages are distributed to all members of a group. The linkzmq:zmq_recv[3] function is not implemented for this socket type. When a 'ZMQ_RADIO' socket enters the 'mute' state due to having reached the high water mark for a _subscriber_, then any messages that would be sent to the _subscriber_ in question shall instead be dropped until the mute state ends. The _zmq_send()_ function shall never block for this socket type. NOTE: 'ZMQ_RADIO' sockets are threadsafe. They do not accept the ZMQ_SNDMORE option on sends. This limits them to single part data. [horizontal] .Summary of ZMQ_RADIO characteristics Compatible peer sockets:: 'ZMQ_DISH' Direction:: Unidirectional Send/receive pattern:: Send only Incoming routing strategy:: N/A Outgoing routing strategy:: Fan out Action in mute state:: Drop ZMQ_DISH ^^^^^^^ A socket of type 'ZMQ_DISH' is used by a _subscriber_ to subscribe to groups distributed by a _radio_. Initially a 'ZMQ_DISH' socket is not subscribed to any groups, use linkzmq:zmq_join[3] to join a group. To get the group the message belong to call linkzmq:zmq_msg_group[3]. The _zmq_send()_ function is not implemented for this socket type. NOTE: 'ZMQ_DISH' sockets are threadsafe. They do not accept ZMQ_RCVMORE on receives. This limits them to single part data. [horizontal] .Summary of ZMQ_DISH characteristics Compatible peer sockets:: 'ZMQ_RADIO' Direction:: Unidirectional Send/receive pattern:: Receive only Incoming routing strategy:: Fair-queued Outgoing routing strategy:: N/A Publish-subscribe pattern ~~~~~~~~~~~~~~~~~~~~~~~~~ The publish-subscribe pattern is used for one-to-many distribution of data from a single _publisher_ to multiple _subscribers_ in a fan out fashion. The publish-subscribe pattern is formally defined by http://rfc.zeromq.org/spec:29. ZMQ_PUB ^^^^^^^ A socket of type 'ZMQ_PUB' is used by a _publisher_ to distribute data. Messages sent are distributed in a fan out fashion to all connected peers. The linkzmq:zmq_recv[3] function is not implemented for this socket type. When a 'ZMQ_PUB' socket enters the 'mute' state due to having reached the high water mark for a _subscriber_, then any messages that would be sent to the _subscriber_ in question shall instead be dropped until the mute state ends. The _zmq_send()_ function shall never block for this socket type. [horizontal] .Summary of ZMQ_PUB characteristics Compatible peer sockets:: 'ZMQ_SUB', 'ZMQ_XSUB' Direction:: Unidirectional Send/receive pattern:: Send only Incoming routing strategy:: N/A Outgoing routing strategy:: Fan out Action in mute state:: Drop ZMQ_SUB ^^^^^^^ A socket of type 'ZMQ_SUB' is used by a _subscriber_ to subscribe to data distributed by a _publisher_. Initially a 'ZMQ_SUB' socket is not subscribed to any messages, use the 'ZMQ_SUBSCRIBE' option of linkzmq:zmq_setsockopt[3] to specify which messages to subscribe to. The _zmq_send()_ function is not implemented for this socket type. [horizontal] .Summary of ZMQ_SUB characteristics Compatible peer sockets:: 'ZMQ_PUB', 'ZMQ_XPUB' Direction:: Unidirectional Send/receive pattern:: Receive only Incoming routing strategy:: Fair-queued Outgoing routing strategy:: N/A ZMQ_XPUB ^^^^^^^^ Same as ZMQ_PUB except that you can receive subscriptions from the peers in form of incoming messages. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix are also received, but have no effect on subscription status. [horizontal] .Summary of ZMQ_XPUB characteristics Compatible peer sockets:: 'ZMQ_SUB', 'ZMQ_XSUB' Direction:: Unidirectional Send/receive pattern:: Send messages, receive subscriptions Incoming routing strategy:: N/A Outgoing routing strategy:: Fan out Action in mute state:: Drop ZMQ_XSUB ^^^^^^^^ Same as ZMQ_SUB except that you subscribe by sending subscription messages to the socket. Subscription message is a byte 1 (for subscriptions) or byte 0 (for unsubscriptions) followed by the subscription body. Messages without a sub/unsub prefix may also be sent, but have no effect on subscription status. [horizontal] .Summary of ZMQ_XSUB characteristics Compatible peer sockets:: 'ZMQ_PUB', 'ZMQ_XPUB' Direction:: Unidirectional Send/receive pattern:: Receive messages, send subscriptions Incoming routing strategy:: Fair-queued Outgoing routing strategy:: N/A Action in mute state:: Drop Pipeline pattern ~~~~~~~~~~~~~~~~ The pipeline pattern is used for distributing data to _nodes_ arranged in a pipeline. Data always flows down the pipeline, and each stage of the pipeline is connected to at least one _node_. When a pipeline stage is connected to multiple _nodes_ data is round-robined among all connected _nodes_. The pipeline pattern is formally defined by http://rfc.zeromq.org/spec:30. ZMQ_PUSH ^^^^^^^^ A socket of type 'ZMQ_PUSH' is used by a pipeline _node_ to send messages to downstream pipeline _nodes_. Messages are round-robined to all connected downstream _nodes_. The _zmq_recv()_ function is not implemented for this socket type. When a 'ZMQ_PUSH' socket enters the 'mute' state due to having reached the high water mark for all downstream _nodes_, or if there are no downstream _nodes_ at all, then any linkzmq:zmq_send[3] operations on the socket shall block until the mute state ends or at least one downstream _node_ becomes available for sending; messages are not discarded. [horizontal] .Summary of ZMQ_PUSH characteristics Compatible peer sockets:: 'ZMQ_PULL' Direction:: Unidirectional Send/receive pattern:: Send only Incoming routing strategy:: N/A Outgoing routing strategy:: Round-robin Action in mute state:: Block ZMQ_PULL ^^^^^^^^ A socket of type 'ZMQ_PULL' is used by a pipeline _node_ to receive messages from upstream pipeline _nodes_. Messages are fair-queued from among all connected upstream _nodes_. The _zmq_send()_ function is not implemented for this socket type. [horizontal] .Summary of ZMQ_PULL characteristics Compatible peer sockets:: 'ZMQ_PUSH' Direction:: Unidirectional Send/receive pattern:: Receive only Incoming routing strategy:: Fair-queued Outgoing routing strategy:: N/A Action in mute state:: Block Exclusive pair pattern ~~~~~~~~~~~~~~~~~~~~~~ The exclusive pair pattern is used to connect a peer to precisely one other peer. This pattern is used for inter-thread communication across the inproc transport. The exclusive pair pattern is formally defined by http://rfc.zeromq.org/spec:31. ZMQ_PAIR ^^^^^^^^ A socket of type 'ZMQ_PAIR' can only be connected to a single peer at any one time. No message routing or filtering is performed on messages sent over a 'ZMQ_PAIR' socket. When a 'ZMQ_PAIR' socket enters the 'mute' state due to having reached the high water mark for the connected peer, or if no peer is connected, then any linkzmq:zmq_send[3] operations on the socket shall block until the peer becomes available for sending; messages are not discarded. NOTE: 'ZMQ_PAIR' sockets are designed for inter-thread communication across the linkzmq:zmq_inproc[7] transport and do not implement functionality such as auto-reconnection. [horizontal] .Summary of ZMQ_PAIR characteristics Compatible peer sockets:: 'ZMQ_PAIR' Direction:: Bidirectional Send/receive pattern:: Unrestricted Incoming routing strategy:: N/A Outgoing routing strategy:: N/A Action in mute state:: Block Native Pattern ~~~~~~~~~~~~~~ The native pattern is used for communicating with TCP peers and allows asynchronous requests and replies in either direction. ZMQ_STREAM ^^^^^^^^^^ A socket of type 'ZMQ_STREAM' is used to send and receive TCP data from a non-0MQ peer, when using the tcp:// transport. A 'ZMQ_STREAM' socket can act as client and/or server, sending and/or receiving TCP data asynchronously. When receiving TCP data, a 'ZMQ_STREAM' socket shall prepend a message part containing the _routing id_ of the originating peer to the message before passing it to the application. Messages received are fair-queued from among all connected peers. When sending TCP data, a 'ZMQ_STREAM' socket shall remove the first part of the message and use it to determine the _routing id_ of the peer the message shall be routed to, and unroutable messages shall cause an EHOSTUNREACH or EAGAIN error. To open a connection to a server, use the zmq_connect call, and then fetch the socket routing id using the zmq_getsockopt call with the ZMQ_ROUTING_ID option. To close a specific connection, send the routing id frame followed by a zero-length message (see EXAMPLE section). When a connection is made, a zero-length message will be received by the application. Similarly, when the peer disconnects (or the connection is lost), a zero-length message will be received by the application. You must send one routing id frame followed by one data frame. The ZMQ_SNDMORE flag is required for routing id frames but is ignored on data frames. [horizontal] .Summary of ZMQ_STREAM characteristics Compatible peer sockets:: none. Direction:: Bidirectional Send/receive pattern:: Unrestricted Outgoing routing strategy:: See text Incoming routing strategy:: Fair-queued Action in mute state:: EAGAIN Request-reply pattern ~~~~~~~~~~~~~~~~~~~~~ The request-reply pattern is used for sending requests from a ZMQ_REQ _client_ to one or more ZMQ_REP _services_, and receiving subsequent replies to each request sent. The request-reply pattern is formally defined by http://rfc.zeromq.org/spec:28. ZMQ_REQ ^^^^^^^ A socket of type 'ZMQ_REQ' is used by a _client_ to send requests to and receive replies from a _service_. This socket type allows only an alternating sequence of _zmq_send(request)_ and subsequent _zmq_recv(reply)_ calls. Each request sent is round-robined among all _services_, and each reply received is matched with the last issued request. If no services are available, then any send operation on the socket shall block until at least one _service_ becomes available. The REQ socket shall not discard messages. [horizontal] .Summary of ZMQ_REQ characteristics Compatible peer sockets:: 'ZMQ_REP', 'ZMQ_ROUTER' Direction:: Bidirectional Send/receive pattern:: Send, Receive, Send, Receive, ... Outgoing routing strategy:: Round-robin Incoming routing strategy:: Last peer Action in mute state:: Block ZMQ_REP ^^^^^^^ A socket of type 'ZMQ_REP' is used by a _service_ to receive requests from and send replies to a _client_. This socket type allows only an alternating sequence of _zmq_recv(request)_ and subsequent _zmq_send(reply)_ calls. Each request received is fair-queued from among all _clients_, and each reply sent is routed to the _client_ that issued the last request. If the original requester does not exist any more the reply is silently discarded. [horizontal] .Summary of ZMQ_REP characteristics Compatible peer sockets:: 'ZMQ_REQ', 'ZMQ_DEALER' Direction:: Bidirectional Send/receive pattern:: Receive, Send, Receive, Send, ... Incoming routing strategy:: Fair-queued Outgoing routing strategy:: Last peer ZMQ_DEALER ^^^^^^^^^^ A socket of type 'ZMQ_DEALER' is an advanced pattern used for extending request/reply sockets. Each message sent is round-robined among all connected peers, and each message received is fair-queued from all connected peers. When a 'ZMQ_DEALER' socket enters the 'mute' state due to having reached the high water mark for all peers, or if there are no peers at all, then any linkzmq:zmq_send[3] operations on the socket shall block until the mute state ends or at least one peer becomes available for sending; messages are not discarded. When a 'ZMQ_DEALER' socket is connected to a 'ZMQ_REP' socket each message sent must consist of an empty message part, the _delimiter_, followed by one or more _body parts_. [horizontal] .Summary of ZMQ_DEALER characteristics Compatible peer sockets:: 'ZMQ_ROUTER', 'ZMQ_REP', 'ZMQ_DEALER' Direction:: Bidirectional Send/receive pattern:: Unrestricted Outgoing routing strategy:: Round-robin Incoming routing strategy:: Fair-queued Action in mute state:: Block ZMQ_ROUTER ^^^^^^^^^^ A socket of type 'ZMQ_ROUTER' is an advanced socket type used for extending request/reply sockets. When receiving messages a 'ZMQ_ROUTER' socket shall prepend a message part containing the _routing id_ of the originating peer to the message before passing it to the application. Messages received are fair-queued from among all connected peers. When sending messages a 'ZMQ_ROUTER' socket shall remove the first part of the message and use it to determine the _routing id _ of the peer the message shall be routed to. If the peer does not exist anymore, or has never existed, the message shall be silently discarded. However, if 'ZMQ_ROUTER_MANDATORY' socket option is set to '1', the socket shall fail with EHOSTUNREACH in both cases. When a 'ZMQ_ROUTER' socket enters the 'mute' state due to having reached the high water mark for all peers, then any messages sent to the socket shall be dropped until the mute state ends. Likewise, any messages routed to a peer for which the individual high water mark has been reached shall also be dropped. If, 'ZMQ_ROUTER_MANDATORY' is set to '1', the socket shall block or return EAGAIN in both cases. When a 'ZMQ_ROUTER' socket has 'ZMQ_ROUTER_MANDATORY' flag set to '1', the socket shall generate 'ZMQ_POLLIN' events upon reception of messages from one or more peers. Likewise, the socket shall generate 'ZMQ_POLLOUT' events when at least one message can be sent to one or more peers. When a 'ZMQ_REQ' socket is connected to a 'ZMQ_ROUTER' socket, in addition to the _routing id_ of the originating peer each message received shall contain an empty _delimiter_ message part. Hence, the entire structure of each received message as seen by the application becomes: one or more _routing id_ parts, _delimiter_ part, one or more _body parts_. When sending replies to a 'ZMQ_REQ' socket the application must include the _delimiter_ part. [horizontal] .Summary of ZMQ_ROUTER characteristics Compatible peer sockets:: 'ZMQ_DEALER', 'ZMQ_REQ', 'ZMQ_ROUTER' Direction:: Bidirectional Send/receive pattern:: Unrestricted Outgoing routing strategy:: See text Incoming routing strategy:: Fair-queued Action in mute state:: Drop (see text) RETURN VALUE ------------ The _zmq_socket()_ function shall return an opaque handle to the newly created socket if successful. Otherwise, it shall return NULL and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested socket 'type' is invalid. *EFAULT*:: The provided 'context' is invalid. *EMFILE*:: The limit on the total number of open 0MQ sockets has been reached. *ETERM*:: The context specified was terminated. EXAMPLE ------- .Creating a simple HTTP server using ZMQ_STREAM ---- void *ctx = zmq_ctx_new (); assert (ctx); /* Create ZMQ_STREAM socket */ void *socket = zmq_socket (ctx, ZMQ_STREAM); assert (socket); int rc = zmq_bind (socket, "tcp://*:8080"); assert (rc == 0); /* Data structure to hold the ZMQ_STREAM routing id */ uint8_t routing_id [256]; size_t routing_id_size = 256; /* Data structure to hold the ZMQ_STREAM received data */ uint8_t raw [256]; size_t raw_size = 256; while (1) { /* Get HTTP request; routing id frame and then request */ routing_id_size = zmq_recv (socket, routing_id, 256, 0); assert (routing_id_size > 0); do { raw_size = zmq_recv (socket, raw, 256, 0); assert (raw_size >= 0); } while (raw_size == 256); /* Prepares the response */ char http_response [] = "HTTP/1.0 200 OK\r\n" "Content-Type: text/plain\r\n" "\r\n" "Hello, World!"; /* Sends the routing id frame followed by the response */ zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, http_response, strlen (http_response), 0); /* Closes the connection by sending the routing id frame followed by a zero response */ zmq_send (socket, routing_id, routing_id_size, ZMQ_SNDMORE); zmq_send (socket, 0, 0, 0); } zmq_close (socket); zmq_ctx_destroy (ctx); ---- SEE ALSO -------- linkzmq:zmq_init[3] linkzmq:zmq_setsockopt[3] linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_send[3] linkzmq:zmq_recv[3] linkzmq:zmq_inproc[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_send_const.html0000664000372000037200000005305713255253332020437 0ustar00travistravis00000000000000 zmq_send_const(3)

SYNOPSIS

int zmq_send_const (void *socket, void *buf, size_t len, int flags);

DESCRIPTION

The zmq_send_const() function shall queue a message created from the buffer referenced by the buf and len arguments. The message buffer is assumed to be constant-memory and will therefore not be copied or deallocated in any way. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the socket, the zmq_send_const() function shall fail with errno set to EAGAIN.

ZMQ_SNDMORE

Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description.

Note
A successful invocation of zmq_send_const() does not indicate that the message has been transmitted to the network, only that it has been queued on the socket and ØMQ has assumed responsibility for the message.

Multi-part messages

A ØMQ message is composed of 1 or more message parts. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that sends multi-part messages must use the ZMQ_SNDMORE flag when sending each message part except the final one.

RETURN VALUE

The zmq_send_const() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and the message cannot be sent at the moment.

ENOTSUP

The zmq_send_const() operation is not supported by this socket type.

EFSM

The zmq_send_const() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before the message was sent.

EHOSTUNREACH

The message cannot be routed.

EXAMPLE

Sending a multi-part message
/* Send a multi-part message consisting of three parts to socket */
rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE);
assert (rc == 3);
rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE);
assert (rc == 5);
/* Final part; no more parts to follow */
rc = zmq_send_const (socket, "JK", 2, 0);
assert (rc == 2);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_tcp.txt0000664000372000037200000000732613255253220016733 0ustar00travistravis00000000000000zmq_tcp(7) ========== NAME ---- zmq_tcp - 0MQ unicast transport using TCP SYNOPSIS -------- TCP is an ubiquitous, reliable, unicast transport. When connecting distributed applications over a network with 0MQ, using the TCP transport will likely be your first choice. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the TCP transport, the transport is `tcp`, and the meaning of the 'address' part is defined below. Assigning a local address to a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When assigning a local address to a socket using _zmq_bind()_ with the 'tcp' transport, the 'endpoint' shall be interpreted as an 'interface' followed by a colon and the TCP port number to use. An 'interface' may be specified by either of the following: * The wild-card `*`, meaning all available interfaces. * The primary IPv4 or IPv6 address assigned to the interface, in its numeric representation. * The non-portable interface name as defined by the operating system. The TCP port number may be specified by: * A numeric value, usually above 1024 on POSIX systems. * The wild-card `*`, meaning a system-assigned ephemeral port. When using ephemeral ports, the caller should retrieve the actual assigned port using the ZMQ_LAST_ENDPOINT socket option. See linkzmq:zmq_getsockopt[3] for details. Unbinding wild-card address from a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When wild-card `*` 'endpoint' was used in _zmq_bind()_, the caller should use real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this 'endpoint' from a socket using _zmq_unbind()_. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a socket to a peer address using _zmq_connect()_ with the 'tcp' transport, the 'endpoint' shall be interpreted as a 'peer address' followed by a colon and the TCP port number to use. You can optionally specify a 'source_endpoint' which will be used as the source address for your connection; tcp://'source_endpoint';'endpoint', see the 'interface' description above for details. A 'peer address' may be specified by either of the following: * The DNS name of the peer. * The IPv4 or IPv6 address of the peer, in its numeric representation. Note: A description of the ZeroMQ Message Transport Protocol (ZMTP) which is used by the TCP transport can be found at EXAMPLES -------- .Assigning a local address to a socket ---- // TCP port 5555 on all available interfaces rc = zmq_bind(socket, "tcp://*:5555"); assert (rc == 0); // TCP port 5555 on the local loop-back interface on all platforms rc = zmq_bind(socket, "tcp://127.0.0.1:5555"); assert (rc == 0); // TCP port 5555 on the first Ethernet network interface on Linux rc = zmq_bind(socket, "tcp://eth0:5555"); assert (rc == 0); ---- .Connecting a socket ---- // Connecting using an IP address rc = zmq_connect(socket, "tcp://192.168.1.1:5555"); assert (rc == 0); // Connecting using a DNS name rc = zmq_connect(socket, "tcp://server1:5555"); assert (rc == 0); // Connecting using a DNS name and bind to eth1 rc = zmq_connect(socket, "tcp://eth1:0;server1:5555"); assert (rc == 0); // Connecting using a IP address and bind to an IP address rc = zmq_connect(socket, "tcp://192.168.1.17:5555;192.168.1.1:5555"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_pgm[7] linkzmq:zmq_ipc[7] linkzmq:zmq_inproc[7] linkzmq:zmq_vmci[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_curve_keypair.html0000664000372000037200000004476313255253341021154 0ustar00travistravis00000000000000 zmq_curve_keypair(3)

SYNOPSIS

int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);

DESCRIPTION

The zmq_curve_keypair() function shall return a newly generated random keypair consisting of a public key and a secret key. The caller provides two buffers, each at least 41 octets large, in which this method will store the keys. The keys are encoded using zmq_z85_encode(3).

RETURN VALUE

The zmq_curve_keypair() function shall return 0 if successful, else it shall return -1 and set errno to one of the values defined below.

ERRORS

ENOTSUP

The libzmq library was not built with cryptographic support (libsodium).

EXAMPLE

Generating a new CURVE keypair
char public_key [41];
char secret_key [41];
int rc = zmq_curve_keypair (public_key, secret_key);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_gets.txt0000664000372000037200000000453213255253220017751 0ustar00travistravis00000000000000zmq_msg_gets(3) =============== NAME ---- zmq_msg_gets - get message metadata property SYNOPSIS -------- *const char *zmq_msg_gets (zmq_msg_t '*message', const char *'property');* DESCRIPTION ----------- The _zmq_msg_gets()_ function shall return the string value for the metadata property specified by the 'property' argument for the message pointed to by the 'message' argument. Both the 'property' argument and the 'value' shall be NULL-terminated UTF8-encoded strings. Metadata is defined on a per-connection basis during the ZeroMQ connection handshake as specified in . Applications can set metadata properties using linkzmq:zmq_setsockopt[3] option ZMQ_METADATA. Application metadata properties must be prefixed with 'X-'. In addition to application metadata, the following ZMTP properties can be retrieved with the _zmq_msg_gets()_ function: Socket-Type Routing-Id Note: 'Identity' is a deprecated alias for 'Routing-Id'. Additionally, when available for the underlying transport, the *Peer-Address* property will return the IP address of the remote endpoint as returned by getnameinfo(2). The names of these properties are also defined in _zmq.h_ as _ZMQ_MSG_PROPERTY_SOCKET_TYPE_ _ZMQ_MSG_PROPERTY_ROUTING_ID_, and _ZMQ_MSG_PROPERTY_PEER_ADDRESS_. Currently, these definitions are only available as a DRAFT API. Other properties may be defined based on the underlying security mechanism, see ZAP authenticated connection sample below. RETURN VALUE ------------ The _zmq_msg_gets()_ function shall return the string value for the property if successful. Otherwise it shall return NULL and set 'errno' to one of the values defined below. The caller shall not modify or free the returned value, which shall be owned by the message. The encoding of the property and value shall be UTF8. ERRORS ------ *EINVAL*:: The requested _property_ is unknown. EXAMPLE ------- .Getting the ZAP authenticated user id for a message: ---- zmq_msg_t msg; zmq_msg_init (&msg); rc = zmq_msg_recv (&msg, dealer, 0); assert (rc != -1); const char *user_id = zmq_msg_gets (&msg, ZMQ_MSG_PROPERTY_USER_ID); zmq_msg_close (&msg); ---- SEE ALSO -------- linkzmq:zmq[7] linkzmq:zmq_setsockopt[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_inproc.70000664000372000037200000001012213255253377016767 0ustar00travistravis00000000000000'\" t .\" Title: zmq_inproc .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_INPROC" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_inproc \- 0MQ local in\-process (inter\-thread) communication transport .SH "SYNOPSIS" .sp The in\-process transport passes messages via memory directly between threads sharing a single 0MQ \fIcontext\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp No I/O threads are involved in passing messages using the \fIinproc\fR transport\&. Therefore, if you are using a 0MQ \fIcontext\fR for in\-process messaging only you can initialise the \fIcontext\fR with zero I/O threads\&. See \fBzmq_init\fR(3) for details\&. .sp .5v .RE .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the in\-process transport, the transport is inproc, and the meaning of the \fIaddress\fR part is defined below\&. .SS "Assigning a local address to a socket" .sp When assigning a local address to a \fIsocket\fR using \fIzmq_bind()\fR with the \fIinproc\fR transport, the \fIendpoint\fR shall be interpreted as an arbitrary string identifying the \fIname\fR to create\&. The \fIname\fR must be unique within the 0MQ \fIcontext\fR associated with the \fIsocket\fR and may be up to 256 characters in length\&. No other restrictions are placed on the format of the \fIname\fR\&. .SS "Connecting a socket" .sp When connecting a \fIsocket\fR to a peer address using \fIzmq_connect()\fR with the \fIinproc\fR transport, the \fIendpoint\fR shall be interpreted as an arbitrary string identifying the \fIname\fR to connect to\&. Before version 4\&.0 he \fIname\fR must have been previously created by assigning it to at least one \fIsocket\fR within the same 0MQ \fIcontext\fR as the \fIsocket\fR being connected\&. Since version 4\&.0 the order of \fIzmq_bind()\fR and \fIzmq_connect()\fR does not matter just like for the tcp transport type\&. .SH "EXAMPLES" .PP \fBAssigning a local address to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Assign the in\-process name "#1" rc = zmq_bind(socket, "inproc://#1"); assert (rc == 0); // Assign the in\-process name "my\-endpoint" rc = zmq_bind(socket, "inproc://my\-endpoint"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connect to the in\-process name "#1" rc = zmq_connect(socket, "inproc://#1"); assert (rc == 0); // Connect to the in\-process name "my\-endpoint" rc = zmq_connect(socket, "inproc://my\-endpoint"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_ipc\fR(7) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq_vmci\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_set_routing_id.txt0000664000372000037200000000203413255253220022020 0ustar00travistravis00000000000000zmq_msg_set_routing_id(3) ========================= NAME ---- zmq_msg_set_routing_id - set routing ID property on message SYNOPSIS -------- *int zmq_msg_set_routing_id (zmq_msg_t '*message', uint32_t 'routing_id');* DESCRIPTION ----------- The _zmq_msg_set_routing_id()_ function sets the 'routing_id' specified, on the the message pointed to by the 'message' argument. The 'routing_id' must be greater than zero. To get a valid routing ID, you must receive a message from a 'ZMQ_SERVER' socket, and use the libzmq:zmq_msg_routing_id method. Routing IDs are transient. RETURN VALUE ------------ The _zmq_msg_set_routing_id()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The provided 'routing_id' is zero. SEE ALSO -------- linkzmq:zmq_msg_routing_id[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_version.30000664000372000037200000000453713255253367017172 0ustar00travistravis00000000000000'\" t .\" Title: zmq_version .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_VERSION" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_version \- report 0MQ library version .SH "SYNOPSIS" .sp \fBvoid zmq_version (int \fR\fB\fI*major\fR\fR\fB, int \fR\fB\fI*minor\fR\fR\fB, int \fR\fB\fI*patch\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_version()\fR function shall fill in the integer variables pointed to by the \fImajor\fR, \fIminor\fR and \fIpatch\fR arguments with the major, minor and patch level components of the 0MQ library version\&. .sp This functionality is intended for applications or language bindings dynamically linking to the 0MQ library that wish to determine the actual version of the 0MQ library they are using\&. .SH "RETURN VALUE" .sp There is no return value\&. .SH "ERRORS" .sp No errors are defined\&. .SH "EXAMPLE" .PP \fBPrinting out the version of the 0MQ library\fR. .sp .if n \{\ .RS 4 .\} .nf int major, minor, patch; zmq_version (&major, &minor, &patch); printf ("Current 0MQ version is %d\&.%d\&.%d\en", major, minor, patch); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_pgm.txt0000664000372000037200000001262113255253220016722 0ustar00travistravis00000000000000zmq_pgm(7) ========== NAME ---- zmq_pgm - 0MQ reliable multicast transport using PGM SYNOPSIS -------- PGM (Pragmatic General Multicast) is a protocol for reliable multicast transport of data over IP networks. DESCRIPTION ----------- 0MQ implements two variants of PGM, the standard protocol where PGM datagrams are layered directly on top of IP datagrams as defined by RFC 3208 (the 'pgm' transport) and "Encapsulated PGM" or EPGM where PGM datagrams are encapsulated inside UDP datagrams (the 'epgm' transport). The 'pgm' and 'epgm' transports can only be used with the 'ZMQ_PUB' and 'ZMQ_SUB' socket types. Further, PGM sockets are rate limited by default. For details, refer to the 'ZMQ_RATE', and 'ZMQ_RECOVERY_IVL' options documented in linkzmq:zmq_setsockopt[3]. CAUTION: The 'pgm' transport implementation requires access to raw IP sockets. Additional privileges may be required on some operating systems for this operation. Applications not requiring direct interoperability with other PGM implementations are encouraged to use the 'epgm' transport instead which does not require any special privileges. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the PGM transport, the transport is `pgm`, and for the EPGM protocol the transport is `epgm`. The meaning of the 'address' part is defined below. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a socket to a peer address using _zmq_connect()_ with the 'pgm' or 'epgm' transport, the 'endpoint' shall be interpreted as an 'interface' followed by a semicolon, followed by a 'multicast address', followed by a colon and a port number. An 'interface' may be specified by either of the following: * The interface name as defined by the operating system. * The primary IPv4 address assigned to the interface, in its numeric representation. NOTE: Interface names are not standardised in any way and should be assumed to be arbitrary and platform dependent. On Win32 platforms no short interface names exist, thus only the primary IPv4 address may be used to specify an 'interface'. The 'interface' part can be omitted, in that case the default one will be selected. A 'multicast address' is specified by an IPv4 multicast address in its numeric representation. WIRE FORMAT ----------- Consecutive PGM datagrams are interpreted by 0MQ as a single continuous stream of data where 0MQ messages are not necessarily aligned with PGM datagram boundaries and a single 0MQ message may span several PGM datagrams. This stream of data consists of 0MQ messages encapsulated in 'frames' as described in linkzmq:zmq_tcp[7]. PGM datagram payload ~~~~~~~~~~~~~~~~~~~~ The following ABNF grammar represents the payload of a single PGM datagram as used by 0MQ: .... datagram = (offset data) offset = 2OCTET data = *OCTET .... In order for late joining consumers to be able to identify message boundaries, each PGM datagram payload starts with a 16-bit unsigned integer in network byte order specifying either the offset of the first message 'frame' in the datagram or containing the value `0xFFFF` if the datagram contains solely an intermediate part of a larger message. Note that offset specifies where the first message begins rather than the first message part. Thus, if there are trailing message parts at the beginning of the packet the offset ignores them and points to first initial message part in the packet. The following diagram illustrates the layout of a single PGM datagram payload: .... +------------------+----------------------+ | offset (16 bits) | data | +------------------+----------------------+ .... The following diagram further illustrates how three example 0MQ frames are laid out in consecutive PGM datagram payloads: .... First datagram payload +--------------+-------------+---------------------+ | Frame offset | Frame 1 | Frame 2, part 1 | | 0x0000 | (Message 1) | (Message 2, part 1) | +--------------+-------------+---------------------+ Second datagram payload +--------------+---------------------+ | Frame offset | Frame 2, part 2 | | 0xFFFF | (Message 2, part 2) | +--------------+---------------------+ Third datagram payload +--------------+----------------------------+-------------+ | Frame offset | Frame 2, final 8 bytes | Frame 3 | | 0x0008 | (Message 2, final 8 bytes) | (Message 3) | +--------------+----------------------------+-------------+ .... EXAMPLE ------- .Connecting a socket ---- // Connecting to the multicast address 239.192.1.1, port 5555, // using the first Ethernet network interface on Linux // and the Encapsulated PGM protocol rc = zmq_connect(socket, "epgm://eth0;239.192.1.1:5555"); assert (rc == 0); // Connecting to the multicast address 239.192.1.1, port 5555, // using the network interface with the address 192.168.1.1 // and the standard PGM protocol rc = zmq_connect(socket, "pgm://192.168.1.1;239.192.1.1:5555"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_connect[3] linkzmq:zmq_setsockopt[3] linkzmq:zmq_tcp[7] linkzmq:zmq_ipc[7] linkzmq:zmq_inproc[7] linkzmq:zmq_vmci[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_setsockopt.html0000664000372000037200000035074513255253342020503 0ustar00travistravis00000000000000 zmq_setsockopt(3)

SYNOPSIS

int zmq_setsockopt (void *socket, int option_name, const void *option_value, size_t option_len);

Caution: All options, with the exception of ZMQ_SUBSCRIBE, ZMQ_UNSUBSCRIBE, ZMQ_LINGER, ZMQ_ROUTER_HANDOVER, ZMQ_ROUTER_MANDATORY, ZMQ_PROBE_ROUTER, ZMQ_XPUB_VERBOSE, ZMQ_XPUB_VERBOSER, ZMQ_REQ_CORRELATE, ZMQ_REQ_RELAXED, ZMQ_SNDHWM and ZMQ_RCVHWM, only take effect for subsequent socket bind/connects.

Specifically, security options take effect for subsequent bind/connect calls, and can be changed at any time to affect subsequent binds and/or connects.

DESCRIPTION

The zmq_setsockopt() function shall set the option specified by the option_name argument to the value pointed to by the option_value argument for the ØMQ socket pointed to by the socket argument. The option_len argument is the size of the option value in bytes. For options taking a value of type "character string", the provided byte data should either contain no zero bytes, or end in a single zero byte (terminating ASCII NUL character).

The following socket options can be set with the zmq_setsockopt() function:

ZMQ_AFFINITY: Set I/O thread affinity

The ZMQ_AFFINITY option shall set the I/O thread affinity for newly created connections on the specified socket.

Affinity determines which threads from the ØMQ I/O thread pool associated with the socket’s context shall handle newly created connections. A value of zero specifies no affinity, meaning that work shall be distributed fairly among all ØMQ I/O threads in the thread pool. For non-zero values, the lowest bit corresponds to thread 1, second lowest bit to thread 2 and so on. For example, a value of 3 specifies that subsequent connections on socket shall be handled exclusively by I/O threads 1 and 2.

See also zmq_init(3) for details on allocating the number of I/O threads for a specific context.

Option value type

uint64_t

Option value unit

N/A (bitmap)

Default value

0

Applicable socket types

N/A

ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections

The ZMQ_BACKLOG option shall set the maximum length of the queue of outstanding peer connections for the specified socket; this only applies to connection-oriented transports. For details refer to your operating system documentation for the listen function.

Option value type

int

Option value unit

connections

Default value

100

Applicable socket types

all, only for connection-oriented transports.

ZMQ_BINDTODEVICE: Set name of device to bind the socket to

The ZMQ_BINDTODEVICE option binds this socket to a particular device, eg. an interface or VRF. If a socket is bound to an interface, only packets received from that particular interface are processed by the socket. If device is a VRF device, then subsequent binds/connects to that socket use addresses in the VRF routing table.

Note
requires setting CAP_NET_RAW on the compiled program. NOTE: in DRAFT state, not yet available in stable releases.
Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP or UDP transports.

ZMQ_CONNECT_RID: Assign the next outbound connection id

This option name is now deprecated. Use ZMQ_CONNECT_ROUTING_ID instead. ZMQ_CONNECT_RID remains as an alias for now.

ZMQ_CONNECT_ROUTING_ID: Assign the next outbound routing id

The ZMQ_CONNECT_ROUTING_ID option sets the peer id of the peer connected via the next zmq_connect() call, such that that connection is immediately ready for data transfer with the given routing id. This option applies only to the first subsequent call to zmq_connect(), zmq_connect() calls thereafter use the default connection behaviour.

Typical use is to set this socket option ahead of each zmq_connect() call. Each connection MUST be assigned a unique routing id. Assigning a routing id that is already in use is not allowed.

Useful when connecting ROUTER to ROUTER, or STREAM to STREAM, as it allows for immediate sending to peers. Outbound routing id framing requirements for ROUTER and STREAM sockets apply.

The routing id must be from 1 to 255 bytes long and MAY NOT start with a zero byte (such routing ids are reserved for internal use by the ØMQ infrastructure).

Option value type

binary data

Option value unit

N/A

Default value

NULL

Applicable socket types

ZMQ_ROUTER, ZMQ_STREAM

ZMQ_CONFLATE: Keep only last message

If set, a socket shall keep only one message in its inbound/outbound queue, this message being the last message received/the last message to be sent. Ignores ZMQ_RCVHWM and ZMQ_SNDHWM options. Does not support multi-part messages, in particular, only one part of it is kept in the socket internal queue.

Option value type

int

Option value unit

boolean

Default value

0 (false)

Applicable socket types

ZMQ_PULL, ZMQ_PUSH, ZMQ_SUB, ZMQ_PUB, ZMQ_DEALER

ZMQ_CONNECT_TIMEOUT: Set connect() timeout

Sets how long to wait before timing-out a connect() system call. The connect() system call normally takes a long time before it returns a time out error. Setting this option allows the library to time out the call at an earlier interval.

Option value type

int

Option value unit

milliseconds

Default value

0 (disabled)

Applicable socket types

all, when using TCP transports.

ZMQ_CURVE_PUBLICKEY: Set CURVE public key

Sets the socket’s long term public key. You must set this on CURVE client sockets, see zmq_curve(7). You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. The public key must always be used with the matching secret key. To generate a public/secret key pair, use zmq_curve_keypair(3). To derive the public key from a secret key, use zmq_curve_public(3).

Note
an option value size of 40 is supported for backwards compatibility, though is deprecated.
Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

NULL

Applicable socket types

all, when using TCP transport

ZMQ_CURVE_SECRETKEY: Set CURVE secret key

Sets the socket’s long term secret key. You must set this on both CURVE client and server sockets, see zmq_curve(7). You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. To generate a public/secret key pair, use zmq_curve_keypair(3). To derive the public key from a secret key, use zmq_curve_public(3).

Note
an option value size of 40 is supported for backwards compatibility, though is deprecated.
Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

NULL

Applicable socket types

all, when using TCP transport

ZMQ_CURVE_SERVER: Set CURVE server role

Defines whether the socket will act as server for CURVE security, see zmq_curve(7). A value of 1 means the socket will act as CURVE server. A value of 0 means the socket will not act as CURVE server, and its security role then depends on other option settings. Setting this to 0 shall reset the socket security to NULL. When you set this you must also set the server’s secret key using the ZMQ_CURVE_SECRETKEY option. A server socket does not need to know its own public key.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

all, when using TCP transport

ZMQ_CURVE_SERVERKEY: Set CURVE server key

Sets the socket’s long term server key. You must set this on CURVE client sockets, see zmq_curve(7). You can provide the key as 32 binary bytes, or as a 40-character string encoded in the Z85 encoding format and terminated in a null byte. This key must have been generated together with the server’s secret key. To generate a public/secret key pair, use zmq_curve_keypair(3).

Note
an option value size of 40 is supported for backwards compatibility, though is deprecated.
Option value type

binary data or Z85 text string

Option value size

32 or 41

Default value

NULL

Applicable socket types

all, when using TCP transport

ZMQ_GSSAPI_PLAINTEXT: Disable GSSAPI encryption

Defines whether communications on the socket will be encrypted, see zmq_gssapi(7). A value of 1 means that communications will be plaintext. A value of 0 means communications will be encrypted.

Option value type

int

Option value unit

0, 1

Default value

0 (false)

Applicable socket types

all, when using TCP transport

ZMQ_GSSAPI_PRINCIPAL: Set name of GSSAPI principal

Sets the name of the principal for whom GSSAPI credentials should be acquired.

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_GSSAPI_SERVER: Set GSSAPI server role

Defines whether the socket will act as server for GSSAPI security, see zmq_gssapi(7). A value of 1 means the socket will act as GSSAPI server. A value of 0 means the socket will act as GSSAPI client.

Option value type

int

Option value unit

0, 1

Default value

0 (false)

Applicable socket types

all, when using TCP transport

ZMQ_GSSAPI_SERVICE_PRINCIPAL: Set name of GSSAPI service principal

Sets the name of the principal of the GSSAPI server to which a GSSAPI client intends to connect.

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: Set name type of service principal

Sets the name type of the GSSAPI service principal. A value of ZMQ_GSSAPI_NT_HOSTBASED (0) means the name specified with ZMQ_GSSAPI_SERVICE_PRINCIPAL is interpreted as a host based name. A value of ZMQ_GSSAPI_NT_USER_NAME (1) means it is interpreted as a local user name. A value of ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism).

Note
in DRAFT state, not yet available in stable releases.
Option value type

int

Option value unit

0, 1, 2

Default value

0 (ZMQ_GSSAPI_NT_HOSTBASED)

Applicable socket types

all, when using TCP or IPC transport

ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: Set name type of principal

Sets the name type of the GSSAPI principal. A value of ZMQ_GSSAPI_NT_HOSTBASED (0) means the name specified with ZMQ_GSSAPI_PRINCIPAL is interpreted as a host based name. A value of ZMQ_GSSAPI_NT_USER_NAME (1) means it is interpreted as a local user name. A value of ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (2) means it is interpreted as an unparsed principal name string (valid only with the krb5 GSSAPI mechanism).

Note
in DRAFT state, not yet available in stable releases.
Option value type

int

Option value unit

0, 1, 2

Default value

0 (ZMQ_GSSAPI_NT_HOSTBASED)

Applicable socket types

all, when using TCP or IPC transport

ZMQ_HANDSHAKE_IVL: Set maximum handshake interval

The ZMQ_HANDSHAKE_IVL option shall set the maximum handshake interval for the specified socket. Handshaking is the exchange of socket configuration information (socket type, routing id, security) that occurs when a connection is first opened, only for connection-oriented transports. If handshaking does not complete within the configured time, the connection shall be closed. The value 0 means no handshake time limit.

Option value type

int

Option value unit

milliseconds

Default value

30000

Applicable socket types

all but ZMQ_STREAM, only for connection-oriented transports

ZMQ_HEARTBEAT_IVL: Set interval between sending ZMTP heartbeats

The ZMQ_HEARTBEAT_IVL option shall set the interval between sending ZMTP heartbeats for the specified socket. If this option is set and is greater than 0, then a PING ZMTP command will be sent every ZMQ_HEARTBEAT_IVL milliseconds.

Option value type

int

Option value unit

milliseconds

Default value

0

Applicable socket types

all, when using connection-oriented transports

ZMQ_HEARTBEAT_TIMEOUT: Set timeout for ZMTP heartbeats

The ZMQ_HEARTBEAT_TIMEOUT option shall set how long to wait before timing-out a connection after sending a PING ZMTP command and not receiving any traffic. This option is only valid if ZMQ_HEARTBEAT_IVL is also set, and is greater than 0. The connection will time out if there is no traffic received after sending the PING command, but the received traffic does not have to be a PONG command - any received traffic will cancel the timeout.

Option value type

int

Option value unit

milliseconds

Default value

0

Applicable socket types

all, when using connection-oriented transports

ZMQ_HEARTBEAT_TTL: Set the TTL value for ZMTP heartbeats

The ZMQ_HEARTBEAT_TTL option shall set the timeout on the remote peer for ZMTP heartbeats. If this option is greater than 0, the remote side shall time out the connection if it does not receive any more traffic within the TTL period. This option does not have any effect if ZMQ_HEARTBEAT_IVL is not set or is 0. Internally, this value is rounded down to the nearest decisecond, any value less than 100 will have no effect.

Option value type

int

Option value unit

milliseconds

Default value

0

Applicable socket types

all, when using connection-oriented transports

ZMQ_IDENTITY: Set socket identity

This option name is now deprecated. Use ZMQ_ROUTING_ID instead. ZMQ_IDENTITY remains as an alias for now.

ZMQ_IMMEDIATE: Queue messages only to completed connections

By default queues will fill on outgoing connections even if the connection has not completed. This can lead to "lost" messages on sockets with round-robin routing (REQ, PUSH, DEALER). If this option is set to 1, messages shall be queued only to completed connections. This will cause the socket to block if there are no other connections, but will prevent queues from filling on pipes awaiting connection.

Option value type

int

Option value unit

boolean

Default value

0 (false)

Applicable socket types

all, only for connection-oriented transports.

ZMQ_INVERT_MATCHING: Invert message filtering

Reverses the filtering behavior of PUB-SUB sockets, when set to 1.

On PUB and XPUB sockets, this causes messages to be sent to all connected sockets except those subscribed to a prefix that matches the message. On SUB sockets, this causes only incoming messages that do not match any of the socket’s subscriptions to be received by the user.

Whenever ZMQ_INVERT_MATCHING is set to 1 on a PUB socket, all SUB sockets connecting to it must also have the option set to 1. Failure to do so will have the SUB sockets reject everything the PUB socket sends them. XSUB sockets do not need to do this because they do not filter incoming messages.

Option value type

int

Option value unit

0,1

Default value

0

Applicable socket types

ZMQ_PUB, ZMQ_XPUB, ZMQ_SUB

ZMQ_IPV6: Enable IPv6 on socket

Set the IPv6 option for the socket. A value of 1 means IPv6 is enabled on the socket, while 0 means the socket will use only IPv4. When IPv6 is enabled the socket will connect to, or accept connections from, both IPv4 and IPv6 hosts.

Option value type

int

Option value unit

boolean

Default value

0 (false)

Applicable socket types

all, when using TCP transports.

ZMQ_LINGER: Set linger period for socket shutdown

The ZMQ_LINGER option shall set the linger period for the specified socket. The linger period determines how long pending messages which have yet to be sent to a peer shall linger in memory after a socket is disconnected with zmq_disconnect(3) or closed with zmq_close(3), and further affects the termination of the socket’s context with zmq_ctx_term(3). The following outlines the different behaviours:

  • A value of -1 specifies an infinite linger period. Pending messages shall not be discarded after a call to zmq_disconnect() or zmq_close(); attempting to terminate the socket’s context with zmq_ctx_term() shall block until all pending messages have been sent to a peer.

  • The value of 0 specifies no linger period. Pending messages shall be discarded immediately after a call to zmq_disconnect() or zmq_close().

  • Positive values specify an upper bound for the linger period in milliseconds. Pending messages shall not be discarded after a call to zmq_disconnect() or zmq_close(); attempting to terminate the socket’s context with zmq_ctx_term() shall block until either all pending messages have been sent to a peer, or the linger period expires, after which any pending messages shall be discarded.

    Option value type

    int

    Option value unit

    milliseconds

    Default value

    -1 (infinite)

    Applicable socket types

    all

ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size

Limits the size of the inbound message. If a peer sends a message larger than ZMQ_MAXMSGSIZE it is disconnected. Value of -1 means no limit.

Option value type

int64_t

Option value unit

bytes

Default value

-1

Applicable socket types

all

ZMQ_METADATA: Add application metadata properties to a socket

The ZMQ_METADATA option shall add application metadata to the specified socket, the metadata is exchanged with peers during connection setup. A metadata property is specfied as a string, delimited by a colon, starting with the metadata property followed by the metadata value, for example "X-key:value". Property names are restrited to maximum 255 characters and must be prefixed by "X-". Multiple application metadata properties can be added to a socket by executing zmq_setsockopt() multiple times. As the argument is a null-terminated string, binary data must be encoded before it is added e.g. using Z85 (zmq_z85_encode(3)).

Note
in DRAFT state, not yet available in stable releases.
Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all

ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets

Sets the time-to-live field in every multicast packet sent from this socket. The default is 1 which means that the multicast packets don’t leave the local network.

Option value type

int

Option value unit

network hops

Default value

1

Applicable socket types

all, when using multicast transports

ZMQ_MULTICAST_MAXTPDU: Maximum transport data unit size for multicast packets

Sets the maximum transport data unit size used for outbound multicast packets.

This must be set at or below the minimum Maximum Transmission Unit (MTU) for all network paths over which multicast reception is required.

Option value type

int

Option value unit

bytes

Default value

1500

Applicable socket types

all, when using multicast transports

ZMQ_PLAIN_PASSWORD: Set PLAIN security password

Sets the password for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN, see zmq_plain(7). If you set this to a null value, the security mechanism used for connections shall be NULL, see zmq_null(3).

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_PLAIN_SERVER: Set PLAIN server role

Defines whether the socket will act as server for PLAIN security, see zmq_plain(7). A value of 1 means the socket will act as PLAIN server. A value of 0 means the socket will not act as PLAIN server, and its security role then depends on other option settings. Setting this to 0 shall reset the socket security to NULL.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

all, when using TCP transport

ZMQ_PLAIN_USERNAME: Set PLAIN security username

Sets the username for outgoing connections over TCP or IPC. If you set this to a non-null value, the security mechanism used for connections shall be PLAIN, see zmq_plain(7). If you set this to a null value, the security mechanism used for connections shall be NULL, see zmq_null(3).

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_USE_FD: Set the pre-allocated socket file descriptor

When set to a positive integer value before zmq_bind is called on the socket, the socket shall use the corresponding file descriptor for connections over TCP or IPC instead of allocating a new file descriptor. Useful for writing systemd socket activated services. If set to -1 (default), a new file descriptor will be allocated instead (default behaviour).

Note
if set after calling zmq_bind, this option shall have no effect. NOTE: the file descriptor passed through MUST have been ran through the "bind" and "listen" system calls beforehand. Also, socket option that would normally be passed through zmq_setsockopt like TCP buffers length, IP_TOS or SO_REUSEADDR MUST be set beforehand by the caller, as they must be set before the socket is bound.
Option value type

int

Option value unit

file descriptor

Default value

-1

Applicable socket types

all bound sockets, when using IPC or TCP transport

ZMQ_PROBE_ROUTER: bootstrap connections to ROUTER sockets

When set to 1, the socket will automatically send an empty message when a new connection is made or accepted. You may set this on REQ, DEALER, or ROUTER sockets connected to a ROUTER socket. The application must filter such empty messages. The ZMQ_PROBE_ROUTER option in effect provides the ROUTER application with an event signaling the arrival of a new peer.

Note
do not set this option on a socket that talks to any other socket types: the results are undefined.
Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_ROUTER, ZMQ_DEALER, ZMQ_REQ

ZMQ_RATE: Set multicast data rate

The ZMQ_RATE option shall set the maximum send or receive data rate for multicast transports such as zmq_pgm(7) using the specified socket.

Option value type

int

Option value unit

kilobits per second

Default value

100

Applicable socket types

all, when using multicast transports

ZMQ_RCVBUF: Set kernel receive buffer size

The ZMQ_RCVBUF option shall set the underlying kernel receive buffer size for the socket to the specified size in bytes. A value of -1 means leave the OS default unchanged. For details refer to your operating system documentation for the SO_RCVBUF socket option.

Option value type

int

Option value unit

bytes

Default value

-1

Applicable socket types

all

ZMQ_RCVHWM: Set high water mark for inbound messages

The ZMQ_RCVHWM option shall set the high water mark for inbound messages on the specified socket. The high water mark is a hard limit on the maximum number of outstanding messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in zmq_socket(3) for details on the exact action taken for each socket type.

Option value type

int

Option value unit

messages

Default value

1000

Applicable socket types

all

ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN

Sets the timeout for receive operation on the socket. If the value is 0, zmq_recv(3) will return immediately, with a EAGAIN error if there is no message to receive. If the value is -1, it will block until a message is available. For all other values, it will wait for a message for that amount of time before returning with an EAGAIN error.

Option value type

int

Option value unit

milliseconds

Default value

-1 (infinite)

Applicable socket types

all

ZMQ_RECONNECT_IVL: Set reconnection interval

The ZMQ_RECONNECT_IVL option shall set the initial reconnection interval for the specified socket. The reconnection interval is the period ØMQ shall wait between attempts to reconnect disconnected peers when using connection-oriented transports. The value -1 means no reconnection.

Note
The reconnection interval may be randomized by ØMQ to prevent reconnection storms in topologies with a large number of peers per socket.
Option value type

int

Option value unit

milliseconds

Default value

100

Applicable socket types

all, only for connection-oriented transports

ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval

The ZMQ_RECONNECT_IVL_MAX option shall set the maximum reconnection interval for the specified socket. This is the maximum period ØMQ shall wait between attempts to reconnect. On each reconnect attempt, the previous interval shall be doubled untill ZMQ_RECONNECT_IVL_MAX is reached. This allows for exponential backoff strategy. Default value means no exponential backoff is performed and reconnect interval calculations are only based on ZMQ_RECONNECT_IVL.

Note
Values less than ZMQ_RECONNECT_IVL will be ignored.
Option value type

int

Option value unit

milliseconds

Default value

0 (only use ZMQ_RECONNECT_IVL)

Applicable socket types

all, only for connection-oriented transports

ZMQ_RECOVERY_IVL: Set multicast recovery interval

The ZMQ_RECOVERY_IVL option shall set the recovery interval for multicast transports using the specified socket. The recovery interval determines the maximum time in milliseconds that a receiver can be absent from a multicast group before unrecoverable data loss will occur.

Caution
Exercise care when setting large recovery intervals as the data needed for recovery will be held in memory. For example, a 1 minute recovery interval at a data rate of 1Gbps requires a 7GB in-memory buffer.
Option value type

int

Option value unit

milliseconds

Default value

10000

Applicable socket types

all, when using multicast transports

ZMQ_REQ_CORRELATE: match replies with requests

The default behaviour of REQ sockets is to rely on the ordering of messages to match requests and responses and that is usually sufficient. When this option is set to 1, the REQ socket will prefix outgoing messages with an extra frame containing a request id. That means the full message is (request id, 0, user frames…). The REQ socket will discard all incoming messages that don’t begin with these two frames.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_REQ

ZMQ_REQ_RELAXED: relax strict alternation between request and reply

By default, a REQ socket does not allow initiating a new request with zmq_send(3) until the reply to the previous one has been received. When set to 1, sending another message is allowed and previous replies will be discarded if any. The request-reply state machine is reset and a new request is sent to the next available peer.

If set to 1, also enable ZMQ_REQ_CORRELATE to ensure correct matching of requests and replies. Otherwise a late reply to an aborted request can be reported as the reply to the superseding request.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_REQ

ZMQ_ROUTER_HANDOVER: handle duplicate client routing ids on ROUTER sockets

If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already-used routing id. If that option is set to 1, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing one.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_ROUTER

ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets

Sets the ROUTER socket behaviour when an unroutable message is encountered. A value of 0 is the default and discards the message silently when it cannot be routed or the peers SNDHWM is reached. A value of 1 returns an EHOSTUNREACH error code if the message cannot be routed or EAGAIN error code if the SNDHWM is reached and ZMQ_DONTWAIT was used. Without ZMQ_DONTWAIT it will block until the SNDTIMEO is reached or a spot in the send queue opens up.

When ZMQ_ROUTER_MANDATORY is set to 1, ZMQ_POLLOUT events will be generated if one or more messages can be sent to at least one of the peers. If ZMQ_ROUTER_MANDATORY is set to 0, the socket will generate a ZMQ_POLLOUT event on every call to zmq_poll.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_ROUTER

ZMQ_ROUTER_RAW: switch ROUTER socket to raw mode

Sets the raw mode on the ROUTER, when set to 1. When the ROUTER socket is in raw mode, and when using the tcp:// transport, it will read and write TCP data without ØMQ framing. This lets ØMQ applications talk to non-ØMQ applications. When using raw mode, you cannot set explicit identities, and the ZMQ_SNDMORE flag is ignored when sending data messages. In raw mode you can close a specific connection by sending it a zero-length message (following the routing id frame).

Note
This option is deprecated, please use ZMQ_STREAM sockets instead.
Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_ROUTER

ZMQ_ROUTING_ID: Set socket routing id

The ZMQ_ROUTING_ID option shall set the routing id of the specified socket when connecting to a ROUTER socket.

A routing id must be at least one byte and at most 255 bytes long. Identities starting with a zero byte are reserved for use by the ØMQ infrastructure.

If two clients use the same routing id when connecting to a ROUTER, the results shall depend on the ZMQ_ROUTER_HANDOVER option setting. If that is not set (or set to the default of zero), the ROUTER socket shall reject clients trying to connect with an already-used routing id. If that option is set to 1, the ROUTER socket shall hand-over the connection to the new client and disconnect the existing one.

Option value type

binary data

Option value unit

N/A

Default value

NULL

Applicable socket types

ZMQ_REQ, ZMQ_REP, ZMQ_ROUTER, ZMQ_DEALER.

ZMQ_SNDBUF: Set kernel transmit buffer size

The ZMQ_SNDBUF option shall set the underlying kernel transmit buffer size for the socket to the specified size in bytes. A value of -1 means leave the OS default unchanged. For details please refer to your operating system documentation for the SO_SNDBUF socket option.

Option value type

int

Option value unit

bytes

Default value

-1

Applicable socket types

all

ZMQ_SNDHWM: Set high water mark for outbound messages

The ZMQ_SNDHWM option shall set the high water mark for outbound messages on the specified socket. The high water mark is a hard limit on the maximum number of outstanding messages ØMQ shall queue in memory for any single peer that the specified socket is communicating with. A value of zero means no limit.

If this limit has been reached the socket shall enter an exceptional state and depending on the socket type, ØMQ shall take appropriate action such as blocking or dropping sent messages. Refer to the individual socket descriptions in zmq_socket(3) for details on the exact action taken for each socket type.

Note
ØMQ does not guarantee that the socket will accept as many as ZMQ_SNDHWM messages, and the actual limit may be as much as 90% lower depending on the flow of messages on the socket.
Option value type

int

Option value unit

messages

Default value

1000

Applicable socket types

all

ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN

Sets the timeout for send operation on the socket. If the value is 0, zmq_send(3) will return immediately, with a EAGAIN error if the message cannot be sent. If the value is -1, it will block until the message is sent. For all other values, it will try to send the message for that amount of time before returning with an EAGAIN error.

Option value type

int

Option value unit

milliseconds

Default value

-1 (infinite)

Applicable socket types

all

ZMQ_SOCKS_PROXY: Set SOCKS5 proxy address

Sets the SOCKS5 proxy address that shall be used by the socket for the TCP connection(s). Does not support SOCKS5 authentication. If the endpoints are domain names instead of addresses they shall not be resolved and they shall be forwarded unchanged to the SOCKS proxy service in the client connection request message (address type 0x03 domain name).

Option value type

character string

Option value unit

N/A

Default value

not set

Applicable socket types

all, when using TCP transport

ZMQ_STREAM_NOTIFY: send connect and disconnect notifications

Enables connect and disconnect notifications on a STREAM socket, when set to 1. When notifications are enabled, the socket delivers a zero-length message when a peer connects or disconnects.

Option value type

int

Option value unit

0, 1

Default value

1

Applicable socket types

ZMQ_STREAM

ZMQ_SUBSCRIBE: Establish message filter

The ZMQ_SUBSCRIBE option shall establish a new message filter on a ZMQ_SUB socket. Newly created ZMQ_SUB sockets shall filter out all incoming messages, therefore you should call this option to establish an initial message filter.

An empty option_value of length zero shall subscribe to all incoming messages. A non-empty option_value shall subscribe to all messages beginning with the specified prefix. Multiple filters may be attached to a single ZMQ_SUB socket, in which case a message shall be accepted if it matches at least one filter.

Option value type

binary data

Option value unit

N/A

Default value

N/A

Applicable socket types

ZMQ_SUB

ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option

Override SO_KEEPALIVE socket option (where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,0,1

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option

Override TCP_KEEPCNT socket option (where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS)

Override TCP_KEEPIDLE (or TCP_KEEPALIVE on some OS) socket option (where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option

Override TCP_KEEPINTVL socket option(where supported by OS). The default value of -1 means to skip any overrides and leave it to OS default.

Option value type

int

Option value unit

-1,>0

Default value

-1 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TCP_MAXRT: Set TCP Maximum Retransmit Timeout

On OSes where it is supported, sets how long before an unacknowledged TCP retransmit times out. The system normally attempts many TCP retransmits following an exponential backoff strategy. This means that after a network outage, it may take a long time before the session can be re-established. Setting this option allows the timeout to happen at a shorter interval.

Option value type

int

Option value unit

milliseconds

Default value

0 (leave to OS default)

Applicable socket types

all, when using TCP transports.

ZMQ_TOS: Set the Type-of-Service on socket

Sets the ToS fields (Differentiated services (DS) and Explicit Congestion Notification (ECN) field of the IP header. The ToS field is typically used to specify a packets priority. The availability of this option is dependent on intermediate network equipment that inspect the ToS field and provide a path for low-delay, high-throughput, highly-reliable service, etc.

Option value type

int

Option value unit

>0

Default value

0

Applicable socket types

all, only for connection-oriented transports

ZMQ_UNSUBSCRIBE: Remove message filter

The ZMQ_UNSUBSCRIBE option shall remove an existing message filter on a ZMQ_SUB socket. The filter specified must match an existing filter previously established with the ZMQ_SUBSCRIBE option. If the socket has several instances of the same filter attached the ZMQ_UNSUBSCRIBE option shall remove only one instance, leaving the rest in place and functional.

Option value type

binary data

Option value unit

N/A

Default value

N/A

Applicable socket types

ZMQ_SUB

ZMQ_XPUB_VERBOSE: pass duplicate subscribe messages on XPUB socket

Sets the XPUB socket behaviour on new duplicated subscriptions. If enabled, the socket passes all subscribe messages to the caller. If disabled, only the first subscription to each filter will be passed. The default is 0 (disabled).

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_XPUB

ZMQ_XPUB_VERBOSER: pass duplicate subscribe and unsubscribe messages on XPUB socket

Sets the XPUB socket behaviour on new duplicated subscriptions and unsubscriptions. If enabled, the socket passes all subscribe and unsubscribe messages to the caller. If disabled, only the first subscription to each filter and the last unsubscription from each filter will be passed. The default is 0 (disabled).

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_XPUB

ZMQ_XPUB_MANUAL: change the subscription handling to manual

Sets the XPUB socket subscription handling mode manual/automatic. A value of 0 is the default and subscription requests will be handled automatically. A value of 1 will change the subscription requests handling to manual, with manual mode subscription requests are not added to the subscription list. To add subscription the user need to call setsockopt with ZMQ_SUBSCRIBE on XPUB socket.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_XPUB

ZMQ_XPUB_NODROP: do not silently drop messages if SENDHWM is reached

Sets the XPUB socket behaviour to return error EAGAIN if SENDHWM is reached and the message could not be send.

A value of 0 is the default and drops the message silently when the peers SNDHWM is reached. A value of 1 returns an EAGAIN error code if the SNDHWM is reached and ZMQ_DONTWAIT was used.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

ZMQ_XPUB, ZMQ_PUB

ZMQ_XPUB_WELCOME_MSG: set welcome message that will be received by subscriber when connecting

Sets a welcome message the will be recieved by subscriber when connecting. Subscriber must subscribe to the Welcome message before connecting. Welcome message will also be sent on reconnecting. For welcome message to work well user must poll on incoming subscription messages on the XPUB socket and handle them.

Use NULL and lenght of zero to disable welcome message.

Option value type

binary data

Option value unit

N/A

Default value

NULL

Applicable socket types

ZMQ_XPUB

ZMQ_ZAP_DOMAIN: Set RFC 27 authentication domain

Sets the domain for ZAP (ZMQ RFC 27) authentication. A ZAP domain must be specified to enable authentication. When the ZAP domain is empty, which is the default, ZAP authentication is disabled. This is not compatible with previous versions of libzmq, so it can be controlled by ZMQ_ZAP_ENFORCE_DOMAIN which for now is disabled by default. See http://rfc.zeromq.org/spec:27 for more details.

Option value type

character string

Option value unit

N/A

Default value

empty

Applicable socket types

all, when using TCP transport

ZMQ_ZAP_ENFORCE_DOMAIN: Set ZAP domain handling to strictly adhere the RFC

The ZAP (ZMQ RFC 27) authentication protocol specifies that a domain must always be set. Older versions of libzmq did not follow the spec and allowed an empty domain to be set. This option can be used to enabled or disable the stricter, backward incompatible behaviour. For now it is disabled by default, but in a future version it will be enabled by default.

Option value type

int

Option value unit

0, 1

Default value

0

Applicable socket types

all, when using ZAP

ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections

Assign an arbitrary number of filters that will be applied for each new TCP transport connection on a listening socket. If no filters are applied, then the TCP transport allows connections from any IP address. If at least one filter is applied then new connection source ip should be matched. To clear all filters call zmq_setsockopt(socket, ZMQ_TCP_ACCEPT_FILTER, NULL, 0). Filter is a null-terminated string with ipv6 or ipv4 CIDR.

Note
This option is deprecated, please use authentication via the ZAP API and IP address whitelisting / blacklisting.
Option value type

binary data

Option value unit

N/A

Default value

no filters (allow from all)

Applicable socket types

all listening sockets, when using TCP transports.

ZMQ_IPC_FILTER_GID: Assign group ID filters to allow new IPC connections

Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all GID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_GID, NULL, 0).

Note
GID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X).
Note
This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting.
Option value type

gid_t

Option value unit

N/A

Default value

no filters (allow from all)

Applicable socket types

all listening sockets, when using IPC transports.

ZMQ_IPC_FILTER_PID: Assign process ID filters to allow new IPC connections

Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all PID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_PID, NULL, 0).

Note
PID filters are only available on platforms supporting the SO_PEERCRED socket option (currently only Linux).
Note
This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting.
Option value type

pid_t

Option value unit

N/A

Default value

no filters (allow from all)

Applicable socket types

all listening sockets, when using IPC transports.

ZMQ_IPC_FILTER_UID: Assign user ID filters to allow new IPC connections

Assign an arbitrary number of filters that will be applied for each new IPC transport connection on a listening socket. If no IPC filters are applied, then the IPC transport allows connections from any process. If at least one UID, GID, or PID filter is applied then new connection credentials should be matched. To clear all UID filters call zmq_setsockopt(socket, ZMQ_IPC_FILTER_UID, NULL, 0).

Note
UID filters are only available on platforms supporting SO_PEERCRED or LOCAL_PEERCRED socket options (currently only Linux and later versions of OS X).
Note
This option is deprecated, please use authentication via the ZAP API and IPC whitelisting / blacklisting.
Option value type

uid_t

Option value unit

N/A

Default value

no filters (allow from all)

Applicable socket types

all listening sockets, when using IPC transports.

ZMQ_IPV4ONLY: Use IPv4-only on socket

Set the IPv4-only option for the socket. This option is deprecated. Please use the ZMQ_IPV6 option.

Option value type

int

Option value unit

boolean

Default value

1 (true)

Applicable socket types

all, when using TCP transports.

ZMQ_VMCI_BUFFER_SIZE: Set buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_SIZE option shall set the size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

65546

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_BUFFER_MIN_SIZE: Set min buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_MIN_SIZE option shall set the min size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

128

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_BUFFER_MAX_SIZE: Set max buffer size of the VMCI socket

The ZMQ_VMCI_BUFFER_MAX_SIZE option shall set the max size of the underlying buffer for the socket. Used during negotiation before the connection is established.

Option value type

uint64_t

Option value unit

bytes

Default value

262144

Applicable socket types

all, when using VMCI transport

ZMQ_VMCI_CONNECT_TIMEOUT: Set connection timeout of the VMCI socket

The ZMQ_VMCI_CONNECT_TIMEOUT option shall set connection timeout for the socket.

Option value type

int

Option value unit

milliseconds

Default value

-1

Applicable socket types

all, when using VMCI transport

RETURN VALUE

The zmq_setsockopt() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown, or the requested option_len or option_value is invalid.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal.

EXAMPLE

Subscribing to messages on a ZMQ_SUB socket
/* Subscribe to all messages */
rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "", 0);
assert (rc == 0);
/* Subscribe to messages prefixed with "ANIMALS.CATS" */
rc = zmq_setsockopt (socket, ZMQ_SUBSCRIBE, "ANIMALS.CATS", 12);
Setting I/O thread affinity
int64_t affinity;
/* Incoming connections on TCP port 5555 shall be handled by I/O thread 1 */
affinity = 1;
rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5555");
assert (rc);
/* Incoming connections on TCP port 5556 shall be handled by I/O thread 2 */
affinity = 2;
rc = zmq_setsockopt (socket, ZMQ_AFFINITY, &affinity, sizeof (affinity));
assert (rc);
rc = zmq_bind (socket, "tcp://lo:5556");
assert (rc);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_sendmsg.html0000664000372000037200000005507113255253337017743 0ustar00travistravis00000000000000 zmq_sendmsg(3)

SYNOPSIS

int zmq_sendmsg (void *socket, zmq_msg_t *msg, int flags);

DESCRIPTION

The zmq_sendmsg() function shall queue the message referenced by the msg argument to be sent to the socket referenced by the socket argument. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the socket, the zmq_sendmsg() function shall fail with errno set to EAGAIN.

ZMQ_SNDMORE

Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description.

The zmq_msg_t structure passed to zmq_sendmsg() is nullified during the call. If you want to send the same message to multiple sockets you have to copy it (e.g. using zmq_msg_copy()).

Note
A successful invocation of zmq_sendmsg() does not indicate that the message has been transmitted to the network, only that it has been queued on the socket and ØMQ has assumed responsibility for the message.
Note
this API method is deprecated in favor of zmq_msg_send(3).

Multi-part messages

A ØMQ message is composed of 1 or more message parts. Each message part is an independent zmq_msg_t in its own right. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that sends multi-part messages must use the ZMQ_SNDMORE flag when sending each message part except the final one.

RETURN VALUE

The zmq_sendmsg() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and the message cannot be sent at the moment.

ENOTSUP

The zmq_sendmsg() operation is not supported by this socket type.

EINVAL

The sender tried to send multipart data, which the socket type does not allow.

EFSM

The zmq_sendmsg() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before the message was sent.

EFAULT

Invalid message.

EHOSTUNREACH

The message cannot be routed.

EXAMPLE

Filling in a message and sending it to a socket
/* Create a new message, allocating 6 bytes for message content */
zmq_msg_t msg;
int rc = zmq_msg_init_size (&msg, 6);
assert (rc == 0);
/* Fill in message content with 'AAAAAA' */
memset (zmq_msg_data (&msg), 'A', 6);
/* Send the message to the socket */
rc = zmq_sendmsg (socket, &msg, 0);
assert (rc == 6);
Sending a multi-part message
/* Send a multi-part message consisting of three parts to socket */
rc = zmq_sendmsg (socket, &part1, ZMQ_SNDMORE);
rc = zmq_sendmsg (socket, &part2, ZMQ_SNDMORE);
/* Final part; no more parts to follow */
rc = zmq_sendmsg (socket, &part3, 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_plain.70000664000372000037200000000413013255253401016566 0ustar00travistravis00000000000000'\" t .\" Title: zmq_plain .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_PLAIN" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_plain \- clear\-text authentication .SH "SYNOPSIS" .sp The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client\&. PLAIN makes no attempt at security or confidentiality\&. It is intended for use on internal networks where security requirements are low\&. The PLAIN mechanism is defined by this document: \m[blue]\fBhttp://rfc\&.zeromq\&.org/spec:24\fR\m[]\&. .SH "USAGE" .sp To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket options\&. Which peer binds, and which connects, is not relevant\&. .SH "SEE ALSO" .sp \fBzmq_setsockopt\fR(3) \fBzmq_null\fR(7) \fBzmq_curve\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_proxy_steerable.txt0000664000372000037200000000667213255253220021357 0ustar00travistravis00000000000000zmq_proxy_steerable(3) ====================== NAME ---- zmq_proxy_steerable - built-in 0MQ proxy with control flow SYNOPSIS -------- *int zmq_proxy_steerable (const void '*frontend', const void '*backend', const void '*capture', const void '*control');* DESCRIPTION ----------- The _zmq_proxy_steerable()_ function starts the built-in 0MQ proxy in the current application thread, as _zmq_proxy()_ do. Please, refer to this function for the general description and usage. We describe here only the additional control flow provided by the socket passed as the fourth argument "control". If the control socket is not NULL, the proxy supports control flow. If 'PAUSE' is received on this socket, the proxy suspends its activities. If 'RESUME' is received, it goes on. If 'TERMINATE' is received, it terminates smoothly. If 'STATISTICS' is received, the proxy will reply on the control socket sending a multipart message with 8 frames, each with an unsigned integer 64-bit wide that provide in the following order: - number of messages received by the frontend socket - number of bytes received by the frontend socket - number of messages sent out the frontend socket - number of bytes sent out the frontend socket - number of messages received by the backend socket - number of bytes received by the backend socket - number of messages sent out the backend socket - number of bytes sent out the backend socket At start, the proxy runs normally as if zmq_proxy was used. If the control socket is NULL, the function behave exactly as if linkzmq:zmq_proxy[3] had been called. Refer to linkzmq:zmq_socket[3] for a description of the available socket types. Refer to linkzmq:zmq_proxy[3] for a description of the zmq_proxy. EXAMPLE USAGE ------------- cf zmq_proxy RETURN VALUE ------------ The _zmq_proxy_steerable()_ function returns 0 if TERMINATE is sent to its control socket. Otherwise, it returns `-1` and 'errno' set to *ETERM* or *EINTR* (the 0MQ 'context' associated with either of the specified sockets was terminated). EXAMPLE ------- .Creating a shared queue proxy ---- // Create frontend, backend and control sockets void *frontend = zmq_socket (context, ZMQ_ROUTER); assert (backend); void *backend = zmq_socket (context, ZMQ_DEALER); assert (frontend); void *control = zmq_socket (context, ZMQ_SUB); assert (control); // Bind sockets to TCP ports assert (zmq_bind (frontend, "tcp://*:5555") == 0); assert (zmq_bind (backend, "tcp://*:5556") == 0); assert (zmq_connect (control, "tcp://*:5557") == 0); // Subscribe to the control socket since we have chosen SUB here assert (zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0)); // Start the queue proxy, which runs until ETERM or "TERMINATE" // received on the control socket zmq_proxy_steerable (frontend, backend, NULL, control); ---- .Set up a controller in another node, process or whatever ---- void *control = zmq_socket (context, ZMQ_PUB); assert (control); assert (zmq_bind (control, "tcp://*:5557") == 0); // pause the proxy assert (zmq_send (control, "PAUSE", 5, 0) == 0); // resume the proxy assert (zmq_send (control, "RESUME", 6, 0) == 0); // terminate the proxy assert (zmq_send (control, "TERMINATE", 9, 0) == 0); --- SEE ALSO -------- linkzmq:zmq_proxy[3] linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_udp.txt0000664000372000037200000000534213255253220016731 0ustar00travistravis00000000000000zmq_udp(7) ========== NAME ---- zmq_udp - 0MQ UDP multicast and unicast transport SYNOPSIS -------- UDP is unreliable protocol transport of data over IP networks. UDP support both unicast and multicast communication. DESCRIPTION ----------- UDP transport can only be used with the 'ZMQ_RADIO' and 'ZMQ_DISH' socket types. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the UDP transport, the transport is `udp`. The meaning of the 'address' part is defined below. Binding a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ With 'udp' we can only bind the 'ZMQ_DISH' socket type. When binding a socket using _zmq_bind()_ with the 'udp' transport the 'endpoint' shall be interpreted as an 'interface' followed by a colon and the UDP port number to use. An 'interface' may be specified by either of the following: * The wild-card `*`, meaning all available interfaces. * The primary IPv4 address assigned to the interface, in its numeric representation. * Multicast address in its numeric representation the socket should join. The UDP port number may be specified a numeric value, usually above 1024 on POSIX systems. Connecting a socket ~~~~~~~~~~~~~~~~~~~ With 'udp' we can only connect the 'ZMQ_RADIO' socket type. When connecting a socket to a peer address using _zmq_connect()_ with the 'udp' transport, the 'endpoint' shall be interpreted as a 'peer address' followed by a colon and the UDP port number to use. A 'peer address' may be specified by either of the following: * The IPv4 or IPv6 address of the peer, in its numeric representation. * Multicast address in its numeric representation. EXAMPLES -------- .Binding a socket ---- // Unicast - UDP port 5555 on all available interfaces rc = zmq_bind(dish, "udp://*:5555"); assert (rc == 0); // Unicast - UDP port 5555 on the local loop-back interface rc = zmq_bind(dish, "udp://127.0.0.1:5555"); assert (rc == 0); // Multicast - UDP port 5555 on a Multicast address rc = zmq_bind(dish, "udp://239.0.0.1:5555"); assert (rc == 0); ---- .Connecting a socket ---- // Connecting using an Unicast IP address rc = zmq_connect(radio, "udp://192.168.1.1:5555"); assert (rc == 0); // Connecting using a Multicast address" rc = zmq_connect(socket, "udp://239.0.0.1:5555); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_connect[3] linkzmq:zmq_setsockopt[3] linkzmq:zmq_tcp[7] linkzmq:zmq_ipc[7] linkzmq:zmq_inproc[7] linkzmq:zmq_vmci[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_atomic_counter_inc.30000664000372000037200000000531613255253374021343 0ustar00travistravis00000000000000'\" t .\" Title: zmq_atomic_counter_inc .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_ATOMIC_COUNTER_I" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_atomic_counter_inc \- increment an atomic counter .SH "SYNOPSIS" .sp \fBint zmq_atomic_counter_inc (void *counter);\fR .SH "DESCRIPTION" .sp The \fIzmq_atomic_counter_inc\fR function increments an atomic counter in a threadsafe fashion\&. This function uses platform specific atomic operations\&. .SH "RETURN VALUE" .sp The \fIzmq_atomic_counter_inc()\fR function returns the old value of the counter, before incrementing\&. .SH "EXAMPLE" .PP \fBTest code for atomic counters\fR. .sp .if n \{\ .RS 4 .\} .nf void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_atomic_counter_new\fR(3) \fBzmq_atomic_counter_set\fR(3) \fBzmq_atomic_counter_dec\fR(3) \fBzmq_atomic_counter_value\fR(3) \fBzmq_atomic_counter_destroy\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_recvmsg.30000664000372000037200000001235013255253370017135 0ustar00travistravis00000000000000'\" t .\" Title: zmq_recvmsg .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_RECVMSG" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_recvmsg \- receive a message part from a socket .SH "SYNOPSIS" .sp \fBint zmq_recvmsg (void \fR\fB\fI*socket\fR\fR\fB, zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, int \fR\fB\fIflags\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_recvmsg()\fR function shall receive a message part from the socket referenced by the \fIsocket\fR argument and store it in the message referenced by the \fImsg\fR argument\&. Any content previously stored in \fImsg\fR shall be properly deallocated\&. If there are no message parts available on the specified \fIsocket\fR the \fIzmq_recvmsg()\fR function shall block until the request can be satisfied\&. The \fIflags\fR argument is a combination of the flags defined below: .PP \fBZMQ_DONTWAIT\fR .RS 4 Specifies that the operation should be performed in non\-blocking mode\&. If there are no messages available on the specified \fIsocket\fR, the \fIzmq_recvmsg()\fR function shall fail with \fIerrno\fR set to EAGAIN\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp this API method is deprecated in favor of zmq_msg_recv(3)\&. .sp .5v .RE .SS "Multi\-part messages" .sp A 0MQ message is composed of 1 or more message parts\&. Each message part is an independent \fIzmq_msg_t\fR in its own right\&. 0MQ ensures atomic delivery of messages: peers shall receive either all \fImessage parts\fR of a message or none at all\&. The total number of message parts is unlimited except by available memory\&. .sp An application that processes multi\-part messages must use the \fIZMQ_RCVMORE\fR \fBzmq_getsockopt\fR(3) option after calling \fIzmq_recvmsg()\fR to determine if there are further parts to receive\&. .SH "RETURN VALUE" .sp The \fIzmq_recvmsg()\fR function shall return number of bytes in the message if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEAGAIN\fR .RS 4 Non\-blocking mode was requested and no messages are available at the moment\&. .RE .PP \fBENOTSUP\fR .RS 4 The \fIzmq_recvmsg()\fR operation is not supported by this socket type\&. .RE .PP \fBEFSM\fR .RS 4 The \fIzmq_recvmsg()\fR operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state\&. This error may occur with socket types that switch between several states, such as ZMQ_REP\&. See the \fImessaging patterns\fR section of \fBzmq_socket\fR(3) for more information\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before a message was available\&. .RE .PP \fBEFAULT\fR .RS 4 The message passed to the function was invalid\&. .RE .SH "EXAMPLE" .PP \fBReceiving a message from a socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create an empty 0MQ message */ zmq_msg_t msg; int rc = zmq_msg_init (&msg); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_recvmsg (socket, &msg, 0); assert (rc != \-1); /* Release message */ zmq_msg_close (&msg); .fi .if n \{\ .RE .\} .PP \fBReceiving a multi-part message\fR. .sp .if n \{\ .RS 4 .\} .nf int more; size_t more_size = sizeof (more); do { /* Create an empty 0MQ message to hold the message part */ zmq_msg_t part; int rc = zmq_msg_init (&part); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_recvmsg (socket, &part, 0); assert (rc != \-1); /* Determine if more message parts are to follow */ rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); zmq_msg_close (&part); } while (more); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_recv\fR(3) \fBzmq_send\fR(3) \fBzmq_getsockopt\fR(3) \fBzmq_socket\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_curve_public.txt0000664000372000037200000000264213255253220020623 0ustar00travistravis00000000000000zmq_curve_public(3) =================== NAME ---- zmq_curve_public - derive the public key from a private key SYNOPSIS -------- *int zmq_curve_public (char *z85_public_key, char *z85_secret_key);* DESCRIPTION ----------- The _zmq_curve_public()_ function shall derive the public key from a private key. The caller provides two buffers, each at least 41 octets large. In z85_secret_key the caller shall provide the private key, and the function will store the public key in z85_public_key. The keys are encoded using linkzmq:zmq_z85_encode[3]. RETURN VALUE ------------ The _zmq_curve_public()_ function shall return 0 if successful, else it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ENOTSUP*:: The libzmq library was not built with cryptographic support (libsodium). EXAMPLE ------- .Deriving the public key from a CURVE private key ---- char public_key [41]; char secret_key [41]; int rc = zmq_curve_keypair (public_key, secret_key); assert (rc == 0); char derived_public[41]; rc = zmq_curve_public (derived_public, secret_key); assert (rc == 0); assert (!strcmp (derived_public, public_key)); ---- SEE ALSO -------- linkzmq:zmq_z85_decode[3] linkzmq:zmq_z85_encode[3] linkzmq:zmq_curve_keypair[3] linkzmq:zmq_curve[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ipc.txt0000664000372000037200000000713313255253220016714 0ustar00travistravis00000000000000zmq_ipc(7) ========== NAME ---- zmq_ipc - 0MQ local inter-process communication transport SYNOPSIS -------- The inter-process transport passes messages between local processes using a system-dependent IPC mechanism. NOTE: The inter-process transport is currently only implemented on operating systems that provide UNIX domain sockets. ADDRESSING ---------- A 0MQ endpoint is a string consisting of a 'transport'`://` followed by an 'address'. The 'transport' specifies the underlying protocol to use. The 'address' specifies the transport-specific address to connect to. For the inter-process transport, the transport is `ipc`, and the meaning of the 'address' part is defined below. Binding a socket ~~~~~~~~~~~~~~~~ When binding a 'socket' to a local address using _zmq_bind()_ with the 'ipc' transport, the 'endpoint' shall be interpreted as an arbitrary string identifying the 'pathname' to create. The 'pathname' must be unique within the operating system namespace used by the 'ipc' implementation, and must fulfill any restrictions placed by the operating system on the format and length of a 'pathname'. When the address is wild-card `*`, _zmq_bind()_ shall generate a unique temporary pathname. The caller should retrieve this pathname using the ZMQ_LAST_ENDPOINT socket option. See linkzmq:zmq_getsockopt[3] for details. NOTE: any existing binding to the same endpoint shall be overridden. That is, if a second process binds to an endpoint already bound by a process, this will succeed and the first process will lose its binding. In this behaviour, the 'ipc' transport is not consistent with the 'tcp' or 'inproc' transports. NOTE: the endpoint pathname must be writable by the process. When the endpoint starts with '/', e.g., `ipc:///pathname`, this will be an _absolute_ pathname. If the endpoint specifies a directory that does not exist, the bind shall fail. NOTE: on Linux only, when the endpoint pathname starts with `@`, the abstract namespace shall be used. The abstract namespace is independent of the filesystem and if a process attempts to bind an endpoint already bound by a process, it will fail. See unix(7) for details. NOTE: IPC pathnames have a maximum size that depends on the operating system. On Linux, the maximum is 113 characters including the "ipc://" prefix (107 characters for the real path name). Unbinding wild-card address from a socket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When wild-card `*` 'endpoint' was used in _zmq_bind()_, the caller should use real 'endpoint' obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this 'endpoint' from a socket using _zmq_unbind()_. Connecting a socket ~~~~~~~~~~~~~~~~~~~ When connecting a 'socket' to a peer address using _zmq_connect()_ with the 'ipc' transport, the 'endpoint' shall be interpreted as an arbitrary string identifying the 'pathname' to connect to. The 'pathname' must have been previously created within the operating system namespace by assigning it to a 'socket' with _zmq_bind()_. EXAMPLES -------- .Assigning a local address to a socket ---- // Assign the pathname "/tmp/feeds/0" rc = zmq_bind(socket, "ipc:///tmp/feeds/0"); assert (rc == 0); ---- .Connecting a socket ---- // Connect to the pathname "/tmp/feeds/0" rc = zmq_connect(socket, "ipc:///tmp/feeds/0"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_bind[3] linkzmq:zmq_connect[3] linkzmq:zmq_inproc[7] linkzmq:zmq_tcp[7] linkzmq:zmq_pgm[7] linkzmq:zmq_vmci[7] linkzmq:zmq_getsockopt[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_init_size.txt0000664000372000037200000000270413255253220021003 0ustar00travistravis00000000000000zmq_msg_init_size(3) ==================== NAME ---- zmq_msg_init_size - initialise 0MQ message of a specified size SYNOPSIS -------- *int zmq_msg_init_size (zmq_msg_t '*msg', size_t 'size');* DESCRIPTION ----------- The _zmq_msg_init_size()_ function shall allocate any resources required to store a message 'size' bytes long and initialise the message object referenced by 'msg' to represent the newly allocated message. The implementation shall choose whether to store message content on the stack (small messages) or on the heap (large messages). For performance reasons _zmq_msg_init_size()_ shall not clear the message data. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. CAUTION: The functions _zmq_msg_init()_, _zmq_msg_init_data()_ and _zmq_msg_init_size()_ are mutually exclusive. Never initialise the same 'zmq_msg_t' twice. RETURN VALUE ------------ The _zmq_msg_init_size()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ENOMEM*:: Insufficient storage space is available. SEE ALSO -------- linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_close[3] linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_size[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ctx_new.txt0000664000372000037200000000175513255253220017614 0ustar00travistravis00000000000000zmq_ctx_new(3) ============== NAME ---- zmq_ctx_new - create new 0MQ context SYNOPSIS -------- *void *zmq_ctx_new ();* DESCRIPTION ----------- The _zmq_ctx_new()_ function creates a new 0MQ 'context'. This function replaces the deprecated function linkzmq:zmq_init[3]. .Thread safety A 0MQ 'context' is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller. RETURN VALUE ------------ The _zmq_ctx_new()_ function shall return an opaque handle to the newly created 'context' if successful. Otherwise it shall return NULL and set 'errno' to one of the values defined below. ERRORS ------ No error values are defined for this function. SEE ALSO -------- linkzmq:zmq[7] linkzmq:zmq_ctx_set[3] linkzmq:zmq_ctx_get[3] linkzmq:zmq_ctx_term[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ctx_get.txt0000664000372000037200000000566213255253220017603 0ustar00travistravis00000000000000zmq_ctx_get(3) ============== NAME ---- zmq_ctx_get - get context options SYNOPSIS -------- *int zmq_ctx_get (void '*context', int 'option_name');* DESCRIPTION ----------- The _zmq_ctx_get()_ function shall return the option specified by the 'option_name' argument. The _zmq_ctx_get()_ function accepts the following option names: ZMQ_IO_THREADS: Get number of I/O threads ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_IO_THREADS' argument returns the size of the 0MQ thread pool for this context. ZMQ_MAX_SOCKETS: Get maximum number of sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MAX_SOCKETS' argument returns the maximum number of sockets allowed for this context. ZMQ_MAX_MSGSZ: Get maximum message size ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MAX_MSGSZ' argument returns the maximum size of a message allowed for this context. Default value is INT_MAX. ZMQ_ZERO_COPY_RCV: Get message decoding strategy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_ZERO_COPY_RCV' argument return whether message decoder uses a zero copy strategy when receiving messages. Default value is 1. NOTE: in DRAFT state, not yet available in stable releases. ZMQ_SOCKET_LIMIT: Get largest configurable number of sockets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_SOCKET_LIMIT' argument returns the largest number of sockets that linkzmq:zmq_ctx_set[3] will accept. ZMQ_IPV6: Set IPv6 option ~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_IPV6' argument returns the IPv6 option for the context. ZMQ_BLOCKY: Get blocky setting ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_BLOCKY' argument returns 1 if the context will block on terminate, zero if the "block forever on context termination" gambit was disabled by setting ZMQ_BLOCKY to false on all new contexts. ZMQ_MSG_T_SIZE: Get the zmq_msg_t size at runtime ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The 'ZMQ_MSG_T_SIZE' argument returns the size of the zmq_msg_t structure at runtime, as defined in the include/zmq.h public header. This is useful for example for FFI bindings that can't simply do a sizeof(). NOTE: in DRAFT state, not yet available in stable releases. RETURN VALUE ------------ The _zmq_ctx_get()_ function returns a value of 0 or greater if successful. Otherwise it returns `-1` and sets 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested option _option_name_ is unknown. EXAMPLE ------- .Setting a limit on the number of sockets ---- void *context = zmq_ctx_new (); zmq_ctx_set (context, ZMQ_MAX_SOCKETS, 256); int max_sockets = zmq_ctx_get (context, ZMQ_MAX_SOCKETS); assert (max_sockets == 256); ---- .Switching off the context deadlock gambit ---- zmq_ctx_set (ctx, ZMQ_BLOCKY, false); ---- SEE ALSO -------- linkzmq:zmq_ctx_set[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_connect.30000664000372000037200000001220413255253350017114 0ustar00travistravis00000000000000'\" t .\" Title: zmq_connect .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CONNECT" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_connect \- create outgoing connection from socket .SH "SYNOPSIS" .sp \fBint zmq_connect (void \fR\fB\fI*socket\fR\fR\fB, const char \fR\fB\fI*endpoint\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_connect()\fR function connects the \fIsocket\fR to an \fIendpoint\fR and then accepts incoming connections on that endpoint\&. .sp The \fIendpoint\fR is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp 0MQ provides the the following transports: .PP \fItcp\fR .RS 4 unicast transport using TCP, see \fBzmq_tcp\fR(7) .RE .PP \fIipc\fR .RS 4 local inter\-process communication transport, see \fBzmq_ipc\fR(7) .RE .PP \fIinproc\fR .RS 4 local in\-process (inter\-thread) communication transport, see \fBzmq_inproc\fR(7) .RE .PP \fIpgm\fR, \fIepgm\fR .RS 4 reliable multicast transport using PGM, see \fBzmq_pgm\fR(7) .RE .PP \fIvmci\fR .RS 4 virtual machine communications interface (VMCI), see \fBzmq_vmci\fR(7) .RE .sp Every 0MQ socket type except \fIZMQ_PAIR\fR supports one\-to\-many and many\-to\-one semantics\&. The precise semantics depend on the socket type and are defined in \fBzmq_socket\fR(3)\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp for most transports and socket types the connection is not performed immediately but as needed by 0MQ\&. Thus a successful call to \fIzmq_connect()\fR does not mean that the connection was or could actually be established\&. Because of this, for most transports and socket types the order in which a \fIserver\fR socket is bound and a \fIclient\fR socket is connected to it does not matter\&. The \fIZMQ_PAIR\fR sockets are an exception, as they do not automatically reconnect to endpoints\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp following a \fIzmq_connect()\fR, for socket types except for ZMQ_ROUTER, the socket enters its normal \fIready\fR state\&. By contrast, following a \fIzmq_bind()\fR alone, the socket enters a \fImute\fR state in which the socket blocks or drops messages according to the socket type, as defined in \fBzmq_socket\fR(3)\&. A ZMQ_ROUTER socket enters its normal \fIready\fR state for a specific peer only when handshaking is complete for that peer, which may take an arbitrary time\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_connect()\fR function returns zero if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The endpoint supplied is invalid\&. .RE .PP \fBEPROTONOSUPPORT\fR .RS 4 The requested \fItransport\fR protocol is not supported\&. .RE .PP \fBENOCOMPATPROTO\fR .RS 4 The requested \fItransport\fR protocol is not compatible with the socket type\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBEMTHREAD\fR .RS 4 No I/O thread is available to accomplish the task\&. .RE .SH "EXAMPLE" .PP \fBConnecting a subscriber socket to an in-process and a TCP transport\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to an in\-process transport with the address \*(Aqmy_publisher\*(Aq */ int rc = zmq_connect (socket, "inproc://my_publisher"); assert (rc == 0); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_connect (socket, "tcp://server001:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_close.txt0000664000372000037200000000325413255253220017246 0ustar00travistravis00000000000000zmq_close(3) ============ NAME ---- zmq_close - close 0MQ socket SYNOPSIS -------- *int zmq_close (void '*socket');* DESCRIPTION ----------- The _zmq_close()_ function shall destroy the socket referenced by the 'socket' argument. Any outstanding messages physically received from the network but not yet received by the application with _zmq_recv()_ shall be discarded. The behaviour for discarding messages sent by the application with _zmq_send()_ but not yet physically transferred to the network depends on the value of the _ZMQ_LINGER_ socket option for the specified 'socket'. _zmq_close()_ must be called exactly once for each socket. If it is never called, _zmq_ctx_term()_ will block forever. If it is called multiple times for the same socket or if 'socket' does not point to a socket, the behaviour is undefined. NOTE: The default setting of _ZMQ_LINGER_ does not discard unsent messages; this behaviour may cause the application to block when calling _zmq_ctx_term()_. For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_ctx_term[3]. NOTE: This API will complete asynchronously, so not everything will be deallocated after it returns. See above for details about linger. RETURN VALUE ------------ The _zmq_close()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *ENOTSOCK*:: The provided 'socket' was NULL. SEE ALSO -------- linkzmq:zmq_socket[3] linkzmq:zmq_ctx_term[3] linkzmq:zmq_setsockopt[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_data.txt0000664000372000037200000000160213255253220017713 0ustar00travistravis00000000000000zmq_msg_data(3) =============== NAME ---- zmq_msg_data - retrieve pointer to message content SYNOPSIS -------- *void *zmq_msg_data (zmq_msg_t '*msg');* DESCRIPTION ----------- The _zmq_msg_data()_ function shall return a pointer to the message content of the message object referenced by 'msg'. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. RETURN VALUE ------------ Upon successful completion, _zmq_msg_data()_ shall return a pointer to the message content. ERRORS ------ No errors are defined. SEE ALSO -------- linkzmq:zmq_msg_size[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_pgm.html0000664000372000037200000006004113255253344017055 0ustar00travistravis00000000000000 zmq_pgm(7)

SYNOPSIS

PGM (Pragmatic General Multicast) is a protocol for reliable multicast transport of data over IP networks.

DESCRIPTION

ØMQ implements two variants of PGM, the standard protocol where PGM datagrams are layered directly on top of IP datagrams as defined by RFC 3208 (the pgm transport) and "Encapsulated PGM" or EPGM where PGM datagrams are encapsulated inside UDP datagrams (the epgm transport).

The pgm and epgm transports can only be used with the ZMQ_PUB and ZMQ_SUB socket types.

Further, PGM sockets are rate limited by default. For details, refer to the ZMQ_RATE, and ZMQ_RECOVERY_IVL options documented in zmq_setsockopt(3).

Caution
The pgm transport implementation requires access to raw IP sockets. Additional privileges may be required on some operating systems for this operation. Applications not requiring direct interoperability with other PGM implementations are encouraged to use the epgm transport instead which does not require any special privileges.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the PGM transport, the transport is pgm, and for the EPGM protocol the transport is epgm. The meaning of the address part is defined below.

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the pgm or epgm transport, the endpoint shall be interpreted as an interface followed by a semicolon, followed by a multicast address, followed by a colon and a port number.

An interface may be specified by either of the following:

  • The interface name as defined by the operating system.

  • The primary IPv4 address assigned to the interface, in its numeric representation.

Note
Interface names are not standardised in any way and should be assumed to be arbitrary and platform dependent. On Win32 platforms no short interface names exist, thus only the primary IPv4 address may be used to specify an interface. The interface part can be omitted, in that case the default one will be selected.

A multicast address is specified by an IPv4 multicast address in its numeric representation.

WIRE FORMAT

Consecutive PGM datagrams are interpreted by ØMQ as a single continuous stream of data where ØMQ messages are not necessarily aligned with PGM datagram boundaries and a single ØMQ message may span several PGM datagrams. This stream of data consists of ØMQ messages encapsulated in frames as described in zmq_tcp(7).

PGM datagram payload

The following ABNF grammar represents the payload of a single PGM datagram as used by ØMQ:

datagram               = (offset data)
offset                 = 2OCTET
data                   = *OCTET

In order for late joining consumers to be able to identify message boundaries, each PGM datagram payload starts with a 16-bit unsigned integer in network byte order specifying either the offset of the first message frame in the datagram or containing the value 0xFFFF if the datagram contains solely an intermediate part of a larger message.

Note that offset specifies where the first message begins rather than the first message part. Thus, if there are trailing message parts at the beginning of the packet the offset ignores them and points to first initial message part in the packet.

The following diagram illustrates the layout of a single PGM datagram payload:

+------------------+----------------------+
| offset (16 bits) |         data         |
+------------------+----------------------+

The following diagram further illustrates how three example ØMQ frames are laid out in consecutive PGM datagram payloads:

First datagram payload
+--------------+-------------+---------------------+
| Frame offset |   Frame 1   |   Frame 2, part 1   |
|    0x0000    | (Message 1) | (Message 2, part 1) |
+--------------+-------------+---------------------+

Second datagram payload
+--------------+---------------------+
| Frame offset |   Frame 2, part 2   |
| 0xFFFF       | (Message 2, part 2) |
+--------------+---------------------+

Third datagram payload
+--------------+----------------------------+-------------+
| Frame offset |   Frame 2, final 8 bytes   |   Frame 3   |
| 0x0008       | (Message 2, final 8 bytes) | (Message 3) |
+--------------+----------------------------+-------------+

EXAMPLE

Connecting a socket
//  Connecting to the multicast address 239.192.1.1, port 5555,
//  using the first Ethernet network interface on Linux
//  and the Encapsulated PGM protocol
rc = zmq_connect(socket, "epgm://eth0;239.192.1.1:5555");
assert (rc == 0);
//  Connecting to the multicast address 239.192.1.1, port 5555,
//  using the network interface with the address 192.168.1.1
//  and the standard PGM protocol
rc = zmq_connect(socket, "pgm://192.168.1.1;239.192.1.1:5555");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_null.html0000664000372000037200000004223513255253345017252 0ustar00travistravis00000000000000 zmq_null(7)

SYNOPSIS

The NULL mechanism is defined by the ZMTP 3.0 specification: http://rfc.zeromq.org/spec:23. This is the default security mechanism for ZeroMQ sockets.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_socket_monitor.30000664000372000037200000002550613255253364020540 0ustar00travistravis00000000000000'\" t .\" Title: zmq_socket_monitor .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_SOCKET_MONITOR" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_socket_monitor \- monitor socket events .SH "SYNOPSIS" .sp \fBint zmq_socket_monitor (void \fR\fB\fI*socket\fR\fR\fB, char \fR\fB\fI*endpoint\fR\fR\fB, int \fR\fB\fIevents\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_socket_monitor()\fR method lets an application thread track socket events (like connects) on a ZeroMQ socket\&. Each call to this method creates a \fIZMQ_PAIR\fR socket and binds that to the specified inproc:// \fIendpoint\fR\&. To collect the socket events, you must create your own \fIZMQ_PAIR\fR socket, and connect that to the endpoint\&. .sp The \fIevents\fR argument is a bitmask of the socket events you wish to monitor, see \fISupported events\fR below\&. To monitor all events, use the event value ZMQ_EVENT_ALL\&. NOTE: as new events are added, the catch\-all value will start returning them\&. An application that relies on a strict and fixed sequence of events must not use ZMQ_EVENT_ALL in order to guarantee compatibility with future versions\&. .sp Each event is sent as two frames\&. The first frame contains an event number (16 bits), and an event value (32 bits) that provides additional data according to the event number\&. The second frame contains a string that specifies the affected TCP or IPC endpoint\&. .sp .if n \{\ .RS 4 .\} .nf The _zmq_socket_monitor()_ method supports only connection\-oriented transports, that is, TCP, IPC, and TIPC\&. .fi .if n \{\ .RE .\} .SH "SUPPORTED EVENTS" .SS "ZMQ_EVENT_CONNECTED" .sp The socket has successfully connected to a remote peer\&. The event value is the file descriptor (FD) of the underlying network socket\&. Warning: there is no guarantee that the FD is still valid by the time your code receives this event\&. .SS "ZMQ_EVENT_CONNECT_DELAYED" .sp A connect request on the socket is pending\&. The event value is unspecified\&. .SS "ZMQ_EVENT_CONNECT_RETRIED" .sp A connect request failed, and is now being retried\&. The event value is the reconnect interval in milliseconds\&. Note that the reconnect interval is recalculated at each retry\&. .SS "ZMQ_EVENT_LISTENING" .sp The socket was successfully bound to a network interface\&. The event value is the FD of the underlying network socket\&. Warning: there is no guarantee that the FD is still valid by the time your code receives this event\&. .SS "ZMQ_EVENT_BIND_FAILED" .sp The socket could not bind to a given interface\&. The event value is the errno generated by the system bind call\&. .SS "ZMQ_EVENT_ACCEPTED" .sp The socket has accepted a connection from a remote peer\&. The event value is the FD of the underlying network socket\&. Warning: there is no guarantee that the FD is still valid by the time your code receives this event\&. .SS "ZMQ_EVENT_ACCEPT_FAILED" .sp The socket has rejected a connection from a remote peer\&. The event value is the errno generated by the accept call\&. .SS "ZMQ_EVENT_CLOSED" .sp The socket was closed\&. The event value is the FD of the (now closed) network socket\&. .SS "ZMQ_EVENT_CLOSE_FAILED" .sp The socket close failed\&. The event value is the errno returned by the system call\&. Note that this event occurs only on IPC transports\&. .SS "ZMQ_EVENT_DISCONNECTED" .sp The socket was disconnected unexpectedly\&. The event value is the FD of the underlying network socket\&. Warning: this socket will be closed\&. .SS "ZMQ_EVENT_MONITOR_STOPPED" .sp Monitoring on this socket ended\&. .SH "DRAFT EVENTS - SUBJECT TO CHANGE WITHOUT NOTICE" .SS "ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL" .sp Unspecified error during handshake\&. The event value is an errno\&. NOTE: in DRAFT state, not yet available in stable releases\&. .SS "ZMQ_EVENT_HANDSHAKE_SUCCEEDED" .sp The ZMTP security mechanism handshake succeeded\&. The event value is unspecified\&. NOTE: in DRAFT state, not yet available in stable releases\&. .SS "ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL" .sp The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler\&. This indicates a configuration or implementation error in either peer resp\&. the ZAP handler\&. The event value is one of the ZMQ_PROTOCOL_ERROR_* values: ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA NOTE: in DRAFT state, not yet available in stable releases\&. .SS "ZMQ_EVENT_HANDSHAKE_FAILED_AUTH" .sp The ZMTP security mechanism handshake failed due to an authentication failure\&. The event value is the status code returned by the ZAP handler (i\&.e\&. 300, 400 or 500)\&. NOTE: in DRAFT state, not yet available in stable releases\&. .SH "RETURN VALUE" .sp The \fIzmq_socket_monitor()\fR function returns a value of 0 or greater if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBEPROTONOSUPPORT\fR .RS 4 The requested \fItransport\fR protocol is not supported\&. Monitor sockets are required to use the inproc:// transport\&. .RE .PP \fBEINVAL\fR .RS 4 The endpoint supplied is invalid\&. .RE .SH "EXAMPLE" .PP \fBMonitoring client and server sockets\fR. .sp .if n \{\ .RS 4 .\} .nf // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value\&. Returns \-1 // in case of error\&. static int get_monitor_event (void *monitor, int *value, char **address) { // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == \-1) return \-1; // Interrupted, presumably assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); if (value) *value = *(uint32_t *) (data + 2); // Second frame in message contains event address zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == \-1) return \-1; // Interrupted, presumably assert (!zmq_msg_more (&msg)); if (address) { uint8_t *data = (uint8_t *) zmq_msg_data (&msg); size_t size = zmq_msg_size (&msg); *address = (char *) malloc (size + 1); memcpy (*address, data, size); (*address)[size] = 0; } return event; } int main (void) { void *ctx = zmq_ctx_new (); assert (ctx); // We\*(Aqll monitor these two sockets void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); // Socket monitoring only works over inproc:// int rc = zmq_socket_monitor (client, "tcp://127\&.0\&.0\&.1:9999", 0); assert (rc == \-1); assert (zmq_errno () == EPROTONOSUPPORT); // Monitor all events on client and server sockets rc = zmq_socket_monitor (client, "inproc://monitor\-client", ZMQ_EVENT_ALL); assert (rc == 0); rc = zmq_socket_monitor (server, "inproc://monitor\-server", ZMQ_EVENT_ALL); assert (rc == 0); // Create two sockets for collecting monitor events void *client_mon = zmq_socket (ctx, ZMQ_PAIR); assert (client_mon); void *server_mon = zmq_socket (ctx, ZMQ_PAIR); assert (server_mon); // Connect these to the inproc endpoints so they\*(Aqll get events rc = zmq_connect (client_mon, "inproc://monitor\-client"); assert (rc == 0); rc = zmq_connect (server_mon, "inproc://monitor\-server"); assert (rc == 0); // Now do a basic ping test rc = zmq_bind (server, "tcp://127\&.0\&.0\&.1:9998"); assert (rc == 0); rc = zmq_connect (client, "tcp://127\&.0\&.0\&.1:9998"); assert (rc == 0); bounce (client, server); // Close client and server close_zero_linger (client); close_zero_linger (server); // Now collect and check events from both sockets int event = get_monitor_event (client_mon, NULL, NULL); if (event == ZMQ_EVENT_CONNECT_DELAYED) event = get_monitor_event (client_mon, NULL, NULL); assert (event == ZMQ_EVENT_CONNECTED); event = get_monitor_event (client_mon, NULL, NULL); assert (event == ZMQ_EVENT_MONITOR_STOPPED); // This is the flow of server events event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_LISTENING); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_ACCEPTED); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_CLOSED); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_MONITOR_STOPPED); // Close down the sockets close_zero_linger (client_mon); close_zero_linger (server_mon); zmq_ctx_term (ctx); return 0 ; } .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_get.txt0000664000372000037200000000363413255253220017570 0ustar00travistravis00000000000000zmq_msg_get(3) ============== NAME ---- zmq_msg_get - get message property SYNOPSIS -------- *int zmq_msg_get (zmq_msg_t '*message', int 'property');* DESCRIPTION ----------- The _zmq_msg_get()_ function shall return the value for the property specified by the 'property' argument for the message pointed to by the 'message' argument. The following properties can be retrieved with the _zmq_msg_get()_ function: *ZMQ_MORE*:: Indicates that there are more message frames to follow after the 'message'. *ZMQ_SRCFD*:: Returns the file descriptor of the socket the 'message' was read from. This allows application to retrieve the remote endpoint via 'getpeername(2)'. Be aware that the respective socket might be closed already, reused even. Currently only implemented for TCP sockets. *ZMQ_SHARED*:: Indicates that a message MAY share underlying storage with another copy of this message. RETURN VALUE ------------ The _zmq_msg_get()_ function shall return the value for the property if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The requested _property_ is unknown. EXAMPLE ------- .Receiving a multi-frame message ---- zmq_msg_t frame; while (true) { // Create an empty 0MQ message to hold the message frame int rc = zmq_msg_init (&frame); assert (rc == 0); // Block until a message is available to be received from socket rc = zmq_msg_recv (socket, &frame, 0); assert (rc != -1); if (zmq_msg_get (&frame, ZMQ_MORE)) fprintf (stderr, "more\n"); else { fprintf (stderr, "end\n"); break; } zmq_msg_close (&frame); } ---- SEE ALSO -------- linkzmq:zmq_msg_set[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_send_const.txt0000664000372000037200000000641413255253220020301 0ustar00travistravis00000000000000zmq_send_const(3) ================= NAME ---- zmq_send_const - send a constant-memory message part on a socket SYNOPSIS -------- *int zmq_send_const (void '*socket', void '*buf', size_t 'len', int 'flags');* DESCRIPTION ----------- The _zmq_send_const()_ function shall queue a message created from the buffer referenced by the 'buf' and 'len' arguments. The message buffer is assumed to be constant-memory and will therefore not be copied or deallocated in any way. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the 'socket', the _zmq_send_const()_ function shall fail with 'errno' set to EAGAIN. *ZMQ_SNDMORE*:: Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description. NOTE: A successful invocation of _zmq_send_const()_ does not indicate that the message has been transmitted to the network, only that it has been queued on the 'socket' and 0MQ has assumed responsibility for the message. Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that sends multi-part messages must use the _ZMQ_SNDMORE_ flag when sending each message part except the final one. RETURN VALUE ------------ The _zmq_send_const()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and the message cannot be sent at the moment. *ENOTSUP*:: The _zmq_send_const()_ operation is not supported by this socket type. *EFSM*:: The _zmq_send_const()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before the message was sent. *EHOSTUNREACH*:: The message cannot be routed. EXAMPLE ------- .Sending a multi-part message ---- /* Send a multi-part message consisting of three parts to socket */ rc = zmq_send_const (socket, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send_const (socket, "DEFGH", 5, ZMQ_SNDMORE); assert (rc == 5); /* Final part; no more parts to follow */ rc = zmq_send_const (socket, "JK", 2, 0); assert (rc == 2); ---- SEE ALSO -------- linkzmq:zmq_send[3] linkzmq:zmq_recv[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_socket_monitor.html0000664000372000037200000007125713255253334021343 0ustar00travistravis00000000000000 zmq_socket_monitor(3)

SYNOPSIS

int zmq_socket_monitor (void *socket, char *endpoint, int events);

DESCRIPTION

The zmq_socket_monitor() method lets an application thread track socket events (like connects) on a ZeroMQ socket. Each call to this method creates a ZMQ_PAIR socket and binds that to the specified inproc:// endpoint. To collect the socket events, you must create your own ZMQ_PAIR socket, and connect that to the endpoint.

The events argument is a bitmask of the socket events you wish to monitor, see Supported events below. To monitor all events, use the event value ZMQ_EVENT_ALL. NOTE: as new events are added, the catch-all value will start returning them. An application that relies on a strict and fixed sequence of events must not use ZMQ_EVENT_ALL in order to guarantee compatibility with future versions.

Each event is sent as two frames. The first frame contains an event number (16 bits), and an event value (32 bits) that provides additional data according to the event number. The second frame contains a string that specifies the affected TCP or IPC endpoint.

The _zmq_socket_monitor()_ method supports only connection-oriented
transports, that is, TCP, IPC, and TIPC.

Supported events

ZMQ_EVENT_CONNECTED

The socket has successfully connected to a remote peer. The event value is the file descriptor (FD) of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event.

ZMQ_EVENT_CONNECT_DELAYED

A connect request on the socket is pending. The event value is unspecified.

ZMQ_EVENT_CONNECT_RETRIED

A connect request failed, and is now being retried. The event value is the reconnect interval in milliseconds. Note that the reconnect interval is recalculated at each retry.

ZMQ_EVENT_LISTENING

The socket was successfully bound to a network interface. The event value is the FD of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event.

ZMQ_EVENT_BIND_FAILED

The socket could not bind to a given interface. The event value is the errno generated by the system bind call.

ZMQ_EVENT_ACCEPTED

The socket has accepted a connection from a remote peer. The event value is the FD of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event.

ZMQ_EVENT_ACCEPT_FAILED

The socket has rejected a connection from a remote peer. The event value is the errno generated by the accept call.

ZMQ_EVENT_CLOSED

The socket was closed. The event value is the FD of the (now closed) network socket.

ZMQ_EVENT_CLOSE_FAILED

The socket close failed. The event value is the errno returned by the system call. Note that this event occurs only on IPC transports.

ZMQ_EVENT_DISCONNECTED

The socket was disconnected unexpectedly. The event value is the FD of the underlying network socket. Warning: this socket will be closed.

ZMQ_EVENT_MONITOR_STOPPED

Monitoring on this socket ended.

DRAFT events - subject to change without notice

ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL

Unspecified error during handshake. The event value is an errno. NOTE: in DRAFT state, not yet available in stable releases.

ZMQ_EVENT_HANDSHAKE_SUCCEEDED

The ZMTP security mechanism handshake succeeded. The event value is unspecified. NOTE: in DRAFT state, not yet available in stable releases.

ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL

The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler. This indicates a configuration or implementation error in either peer resp. the ZAP handler. The event value is one of the ZMQ_PROTOCOL_ERROR_* values: ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA NOTE: in DRAFT state, not yet available in stable releases.

ZMQ_EVENT_HANDSHAKE_FAILED_AUTH

The ZMTP security mechanism handshake failed due to an authentication failure. The event value is the status code returned by the ZAP handler (i.e. 300, 400 or 500). NOTE: in DRAFT state, not yet available in stable releases.

RETURN VALUE

The zmq_socket_monitor() function returns a value of 0 or greater if successful. Otherwise it returns -1 and sets errno to one of the values defined below.

ERRORS

ETERM

The ØMQ context associated with the specified socket was terminated.

EPROTONOSUPPORT

The requested transport protocol is not supported. Monitor sockets are required to use the inproc:// transport.

EINVAL

The endpoint supplied is invalid.

EXAMPLE

Monitoring client and server sockets
//  Read one event off the monitor socket; return value and address
//  by reference, if not null, and event number by value. Returns -1
//  in case of error.

static int
get_monitor_event (void *monitor, int *value, char **address)
{
    //  First frame in message contains event number and value
    zmq_msg_t msg;
    zmq_msg_init (&msg);
    if (zmq_msg_recv (&msg, monitor, 0) == -1)
        return -1;              //  Interrupted, presumably
    assert (zmq_msg_more (&msg));

    uint8_t *data = (uint8_t *) zmq_msg_data (&msg);
    uint16_t event = *(uint16_t *) (data);
    if (value)
        *value = *(uint32_t *) (data + 2);

    //  Second frame in message contains event address
    zmq_msg_init (&msg);
    if (zmq_msg_recv (&msg, monitor, 0) == -1)
        return -1;              //  Interrupted, presumably
    assert (!zmq_msg_more (&msg));

    if (address) {
        uint8_t *data = (uint8_t *) zmq_msg_data (&msg);
        size_t size = zmq_msg_size (&msg);
        *address = (char *) malloc (size + 1);
        memcpy (*address, data, size);
        (*address)[size] = 0;
    }
    return event;
}

int main (void)
{
    void *ctx = zmq_ctx_new ();
    assert (ctx);

    //  We'll monitor these two sockets
    void *client = zmq_socket (ctx, ZMQ_DEALER);
    assert (client);
    void *server = zmq_socket (ctx, ZMQ_DEALER);
    assert (server);

    //  Socket monitoring only works over inproc://
    int rc = zmq_socket_monitor (client, "tcp://127.0.0.1:9999", 0);
    assert (rc == -1);
    assert (zmq_errno () == EPROTONOSUPPORT);

    //  Monitor all events on client and server sockets
    rc = zmq_socket_monitor (client, "inproc://monitor-client", ZMQ_EVENT_ALL);
    assert (rc == 0);
    rc = zmq_socket_monitor (server, "inproc://monitor-server", ZMQ_EVENT_ALL);
    assert (rc == 0);

    //  Create two sockets for collecting monitor events
    void *client_mon = zmq_socket (ctx, ZMQ_PAIR);
    assert (client_mon);
    void *server_mon = zmq_socket (ctx, ZMQ_PAIR);
    assert (server_mon);

    //  Connect these to the inproc endpoints so they'll get events
    rc = zmq_connect (client_mon, "inproc://monitor-client");
    assert (rc == 0);
    rc = zmq_connect (server_mon, "inproc://monitor-server");
    assert (rc == 0);

    //  Now do a basic ping test
    rc = zmq_bind (server, "tcp://127.0.0.1:9998");
    assert (rc == 0);
    rc = zmq_connect (client, "tcp://127.0.0.1:9998");
    assert (rc == 0);
    bounce (client, server);

    //  Close client and server
    close_zero_linger (client);
    close_zero_linger (server);

    //  Now collect and check events from both sockets
    int event = get_monitor_event (client_mon, NULL, NULL);
    if (event == ZMQ_EVENT_CONNECT_DELAYED)
        event = get_monitor_event (client_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_CONNECTED);
    event = get_monitor_event (client_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_MONITOR_STOPPED);

    //  This is the flow of server events
    event = get_monitor_event (server_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_LISTENING);
    event = get_monitor_event (server_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_ACCEPTED);
    event = get_monitor_event (server_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_CLOSED);
    event = get_monitor_event (server_mon, NULL, NULL);
    assert (event == ZMQ_EVENT_MONITOR_STOPPED);

    //  Close down the sockets
    close_zero_linger (client_mon);
    close_zero_linger (server_mon);
    zmq_ctx_term (ctx);

    return 0 ;
}

SEE ALSO

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_proxy_steerable.30000664000372000037200000001150113255253371020674 0ustar00travistravis00000000000000'\" t .\" Title: zmq_proxy_steerable .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_PROXY_STEERABLE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_proxy_steerable \- built\-in 0MQ proxy with control flow .SH "SYNOPSIS" .sp \fBint zmq_proxy_steerable (const void \fR\fB\fI*frontend\fR\fR\fB, const void \fR\fB\fI*backend\fR\fR\fB, const void \fR\fB\fI*capture\fR\fR\fB, const void \fR\fB\fI*control\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_proxy_steerable()\fR function starts the built\-in 0MQ proxy in the current application thread, as \fIzmq_proxy()\fR do\&. Please, refer to this function for the general description and usage\&. We describe here only the additional control flow provided by the socket passed as the fourth argument "control"\&. .sp If the control socket is not NULL, the proxy supports control flow\&. If \fIPAUSE\fR is received on this socket, the proxy suspends its activities\&. If \fIRESUME\fR is received, it goes on\&. If \fITERMINATE\fR is received, it terminates smoothly\&. If \fISTATISTICS\fR is received, the proxy will reply on the control socket sending a multipart message with 8 frames, each with an unsigned integer 64\-bit wide that provide in the following order: \- number of messages received by the frontend socket \- number of bytes received by the frontend socket \- number of messages sent out the frontend socket \- number of bytes sent out the frontend socket \- number of messages received by the backend socket \- number of bytes received by the backend socket \- number of messages sent out the backend socket \- number of bytes sent out the backend socket .sp At start, the proxy runs normally as if zmq_proxy was used\&. .sp If the control socket is NULL, the function behave exactly as if \fBzmq_proxy\fR(3) had been called\&. .sp Refer to \fBzmq_socket\fR(3) for a description of the available socket types\&. Refer to \fBzmq_proxy\fR(3) for a description of the zmq_proxy\&. .SH "EXAMPLE USAGE" .sp cf zmq_proxy .SH "RETURN VALUE" .sp The \fIzmq_proxy_steerable()\fR function returns 0 if TERMINATE is sent to its control socket\&. Otherwise, it returns \-1 and \fIerrno\fR set to \fBETERM\fR or \fBEINTR\fR (the 0MQ \fIcontext\fR associated with either of the specified sockets was terminated)\&. .SH "EXAMPLE" .PP \fBCreating a shared queue proxy\fR. .sp .if n \{\ .RS 4 .\} .nf // Create frontend, backend and control sockets void *frontend = zmq_socket (context, ZMQ_ROUTER); assert (backend); void *backend = zmq_socket (context, ZMQ_DEALER); assert (frontend); void *control = zmq_socket (context, ZMQ_SUB); assert (control); // Bind sockets to TCP ports assert (zmq_bind (frontend, "tcp://*:5555") == 0); assert (zmq_bind (backend, "tcp://*:5556") == 0); assert (zmq_connect (control, "tcp://*:5557") == 0); // Subscribe to the control socket since we have chosen SUB here assert (zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0)); // Start the queue proxy, which runs until ETERM or "TERMINATE" // received on the control socket zmq_proxy_steerable (frontend, backend, NULL, control); .fi .if n \{\ .RE .\} .PP \fBSet up a controller in another node, process or whatever\fR. .sp .if n \{\ .RS 4 .\} .nf void *control = zmq_socket (context, ZMQ_PUB); assert (control); assert (zmq_bind (control, "tcp://*:5557") == 0); // pause the proxy assert (zmq_send (control, "PAUSE", 5, 0) == 0); // resume the proxy assert (zmq_send (control, "RESUME", 6, 0) == 0); // terminate the proxy assert (zmq_send (control, "TERMINATE", 9, 0) == 0); \-\-\- SEE ALSO .fi .if n \{\ .RE .\} .sp \fBzmq_proxy\fR(3) \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_plain.html0000664000372000037200000004331513255253345017403 0ustar00travistravis00000000000000 zmq_plain(7)

SYNOPSIS

The PLAIN mechanism defines a simple username/password mechanism that lets a server authenticate a client. PLAIN makes no attempt at security or confidentiality. It is intended for use on internal networks where security requirements are low. The PLAIN mechanism is defined by this document: http://rfc.zeromq.org/spec:24.

USAGE

To use PLAIN, the server shall set the ZMQ_PLAIN_SERVER option, and the client shall set the ZMQ_PLAIN_USERNAME and ZMQ_PLAIN_PASSWORD socket options. Which peer binds, and which connects, is not relevant.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_vmci.html0000664000372000037200000005150313255253345017234 0ustar00travistravis00000000000000 zmq_vmci(7)

SYNOPSIS

The VMCI transport passes messages between VMware virtual machines running on the same host, between virtual machine and the host and within virtual machines (inter-process transport like ipc).

Note
Communication between a virtual machine and the host is not supported on Mac OS X 10.9 and above.

ADDRESSING

A ØMQ endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to connect to.

For the VMCI transport, the transport is vmci, and the meaning of the address part is defined below.

Binding a socket

When binding a socket to a local address using zmq_bind() with the vmci transport, the endpoint shall be interpreted as an interface followed by a colon and the TCP port number to use.

An interface may be specified by either of the following:

  • The wild-card *, meaning all available interfaces.

  • An integer returned by VMCISock_GetLocalCID or @ (ZeroMQ will call VMCISock_GetLocalCID internally).

The port may be specified by:

  • A numeric value, usually above 1024 on POSIX systems.

  • The wild-card *, meaning a system-assigned ephemeral port.

Unbinding wild-card address from a socket

When wild-card * endpoint was used in zmq_bind(), the caller should use real endpoint obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this endpoint from a socket using zmq_unbind().

Connecting a socket

When connecting a socket to a peer address using zmq_connect() with the vmci transport, the endpoint shall be interpreted as a peer address followed by a colon and the port number to use.

A peer address must be a CID of the peer.

EXAMPLES

Assigning a local address to a socket
//  VMCI port 5555 on all available interfaces
rc = zmq_bind(socket, "vmci://*:5555");
assert (rc == 0);
//  VMCI port 5555 on the local loop-back interface on all platforms
cid = VMCISock_GetLocalCID();
sprintf(endpoint, "vmci://%d:5555", cid);
rc = zmq_bind(socket, endpoint);
assert (rc == 0);
Connecting a socket
//  Connecting using a CID
sprintf(endpoint, "vmci://%d:5555", cid);
rc = zmq_connect(socket, endpoint);
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_recvmsg.txt0000664000372000037200000000710013255253220017601 0ustar00travistravis00000000000000zmq_recvmsg(3) ============== NAME ---- zmq_recvmsg - receive a message part from a socket SYNOPSIS -------- *int zmq_recvmsg (void '*socket', zmq_msg_t '*msg', int 'flags');* DESCRIPTION ----------- The _zmq_recvmsg()_ function shall receive a message part from the socket referenced by the 'socket' argument and store it in the message referenced by the 'msg' argument. Any content previously stored in 'msg' shall be properly deallocated. If there are no message parts available on the specified 'socket' the _zmq_recvmsg()_ function shall block until the request can be satisfied. The 'flags' argument is a combination of the flags defined below: *ZMQ_DONTWAIT*:: Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified 'socket', the _zmq_recvmsg()_ function shall fail with 'errno' set to EAGAIN. NOTE: this API method is deprecated in favor of zmq_msg_recv(3). Multi-part messages ~~~~~~~~~~~~~~~~~~~ A 0MQ message is composed of 1 or more message parts. Each message part is an independent 'zmq_msg_t' in its own right. 0MQ ensures atomic delivery of messages: peers shall receive either all _message parts_ of a message or none at all. The total number of message parts is unlimited except by available memory. An application that processes multi-part messages must use the _ZMQ_RCVMORE_ linkzmq:zmq_getsockopt[3] option after calling _zmq_recvmsg()_ to determine if there are further parts to receive. RETURN VALUE ------------ The _zmq_recvmsg()_ function shall return number of bytes in the message if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EAGAIN*:: Non-blocking mode was requested and no messages are available at the moment. *ENOTSUP*:: The _zmq_recvmsg()_ operation is not supported by this socket type. *EFSM*:: The _zmq_recvmsg()_ operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the _messaging patterns_ section of linkzmq:zmq_socket[3] for more information. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *EINTR*:: The operation was interrupted by delivery of a signal before a message was available. *EFAULT*:: The message passed to the function was invalid. EXAMPLE ------- .Receiving a message from a socket ---- /* Create an empty 0MQ message */ zmq_msg_t msg; int rc = zmq_msg_init (&msg); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_recvmsg (socket, &msg, 0); assert (rc != -1); /* Release message */ zmq_msg_close (&msg); ---- .Receiving a multi-part message ---- int more; size_t more_size = sizeof (more); do { /* Create an empty 0MQ message to hold the message part */ zmq_msg_t part; int rc = zmq_msg_init (&part); assert (rc == 0); /* Block until a message is available to be received from socket */ rc = zmq_recvmsg (socket, &part, 0); assert (rc != -1); /* Determine if more message parts are to follow */ rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); zmq_msg_close (&part); } while (more); ---- SEE ALSO -------- linkzmq:zmq_recv[3] linkzmq:zmq_send[3] linkzmq:zmq_getsockopt[3] linkzmq:zmq_socket[7] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_ctx_term.30000664000372000037200000000655513255253352017326 0ustar00travistravis00000000000000'\" t .\" Title: zmq_ctx_term .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CTX_TERM" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_term \- terminate a 0MQ context .SH "SYNOPSIS" .sp \fBint zmq_ctx_term (void \fR\fB\fI*context\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_term()\fR function shall destroy the 0MQ context \fIcontext\fR\&. .sp Context termination is performed in the following steps: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} Any blocking operations currently in progress on sockets open within \fIcontext\fR shall return immediately with an error code of ETERM\&. With the exception of \fIzmq_close()\fR, any further operations on sockets open within \fIcontext\fR shall fail with an error code of ETERM\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} After interrupting all blocking calls, \fIzmq_ctx_term()\fR shall \fIblock\fR until the following conditions are satisfied: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} All sockets open within \fIcontext\fR have been closed with \fIzmq_close()\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} For each socket within \fIcontext\fR, all messages sent by the application with \fIzmq_send()\fR have either been physically transferred to a network peer, or the socket\(cqs linger period set with the \fIZMQ_LINGER\fR socket option has expired\&. .RE .RE .sp For further details regarding socket linger behaviour refer to the \fIZMQ_LINGER\fR option in \fBzmq_setsockopt\fR(3)\&. .sp This function replaces the deprecated functions \fBzmq_term\fR(3) and \fBzmq_ctx_destroy\fR(3)\&. .SH "RETURN VALUE" .sp The \fIzmq_ctx_term()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEFAULT\fR .RS 4 The provided \fIcontext\fR was invalid\&. .RE .PP \fBEINTR\fR .RS 4 Termination was interrupted by a signal\&. It can be restarted if needed\&. .RE .SH "SEE ALSO" .sp \fBzmq\fR(7) \fBzmq_init\fR(3) \fBzmq_close\fR(3) \fBzmq_setsockopt\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_routing_id.30000664000372000037200000000520013255253357020501 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_routing_id .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_ROUTING_ID" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_routing_id \- return routing ID for message, if any .SH "SYNOPSIS" .sp \fBuint32_t zmq_msg_routing_id (zmq_msg_t \fR\fB\fI*message\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_routing_id()\fR function returns the routing ID for the message, if any\&. The routing ID is set on all messages received from a \fIZMQ_SERVER\fR socket\&. To send a message to a \fIZMQ_SERVER\fR socket you must set the routing ID of a connected \fIZMQ_CLIENT\fR peer\&. Routing IDs are transient\&. .SH "RETURN VALUE" .sp The \fIzmq_msg_routing_id()\fR function shall return zero if there is no routing ID, otherwise it shall return an unsigned 32\-bit integer greater than zero\&. .SH "EXAMPLE" .PP \fBReceiving a client message and routing ID\fR. .sp .if n \{\ .RS 4 .\} .nf void *ctx = zmq_ctx_new (); assert (ctx); void *server = zmq_socket (ctx, ZMQ_SERVER); assert (server); int rc = zmq_bind (server, "tcp://127\&.0\&.0\&.1:8080"); assert (rc == 0); zmq_msg_t message; rc = zmq_msg_init (&message); assert (rc == 0); // Receive a message from socket rc = zmq_msg_recv (server, &message, 0); assert (rc != \-1); uint32_t routing_id = zmq_msg_routing_id (&message); assert (routing_id); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_set_routing_id\fR(3) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_curve.html0000664000372000037200000005065113255253345017425 0ustar00travistravis00000000000000 zmq_curve(7)

SYNOPSIS

The CURVE mechanism defines a mechanism for secure authentication and confidentiality for communications between a client and a server. CURVE is intended for use on public networks. The CURVE mechanism is defined by this document: http://rfc.zeromq.org/spec:25.

CLIENT AND SERVER ROLES

A socket using CURVE can be either client or server, at any moment, but not both. The role is independent of bind/connect direction.

A socket can change roles at any point by setting new options. The role affects all zmq_connect and zmq_bind calls that follow it.

To become a CURVE server, the application sets the ZMQ_CURVE_SERVER option on the socket, and then sets the ZMQ_CURVE_SECRETKEY option to provide the socket with its long-term secret key. The application does not provide the socket with its long-term public key, which is used only by clients.

To become a CURVE client, the application sets the ZMQ_CURVE_SERVERKEY option with the long-term public key of the server it intends to connect to, or accept connections from, next. The application then sets the ZMQ_CURVE_PUBLICKEY and ZMQ_CURVE_SECRETKEY options with its client long-term key pair.

If the server does authentication it will be based on the client’s long term public key.

KEY ENCODING

The standard representation for keys in source code is either 32 bytes of base 256 (binary) data, or 40 characters of base 85 data encoded using the Z85 algorithm defined by http://rfc.zeromq.org/spec:32.

The Z85 algorithm is designed to produce printable key strings for use in configuration files, the command line, and code. There is a reference implementation in C at https://github.com/zeromq/rfc/tree/master/src.

TEST KEY VALUES

For test cases, the client shall use this long-term key pair (specified as hexadecimal and in Z85):

public:
    BB88471D65E2659B30C55A5321CEBB5AAB2B70A398645C26DCA2B2FCB43FC518
    Yne@$w-vo<fVvi]a<NY6T1ed:M$fCG*[IaLV{hID

secret:
    7BB864B489AFA3671FBE69101F94B38972F24816DFB01B51656B3FEC8DFD0888
    D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs

And the server shall use this long-term key pair (specified as hexadecimal and in Z85):

public:
    54FCBA24E93249969316FB617C872BB0C1D1FF14800427C594CBFACF1BC2D652
    rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7

secret:
    8E0BDD697628B91D8F245587EE95C5B04D48963F79259877B49CD9063AEAD3B7
    JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq.70000664000372000037200000002300213255253376015415 0ustar00travistravis00000000000000'\" t .\" Title: zmq .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq \- 0MQ lightweight messaging kernel .SH "SYNOPSIS" .sp \fB#include \fR .sp \fBcc\fR [\fIflags\fR] \fIfiles\fR \fB\-lzmq\fR [\fIlibraries\fR] .SH "DESCRIPTION" .sp The 0MQ lightweight messaging kernel is a library which extends the standard socket interfaces with features traditionally provided by specialised \fImessaging middleware\fR products\&. 0MQ sockets provide an abstraction of asynchronous \fImessage queues\fR, multiple \fImessaging patterns\fR, message filtering (\fIsubscriptions\fR), seamless access to multiple \fItransport protocols\fR and more\&. .sp This documentation presents an overview of 0MQ concepts, describes how 0MQ abstracts standard sockets and provides a reference manual for the functions provided by the 0MQ library\&. .SS "Context" .sp The 0MQ \fIcontext\fR keeps the list of sockets and manages the async I/O thread and internal queries\&. .sp Before using any 0MQ library functions you must create a 0MQ \fIcontext\fR\&. When you exit your application you must destroy the \fIcontext\fR\&. These functions let you work with \fIcontexts\fR: .PP Create a new 0MQ context .RS 4 \fBzmq_ctx_new\fR(3) .RE .PP Work with context properties .RS 4 \fBzmq_ctx_set\fR(3)\fBzmq_ctx_get\fR(3) .RE .PP Destroy a 0MQ context .RS 4 \fBzmq_ctx_shutdown\fR(3)\fBzmq_ctx_term\fR(3) .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBThread safety\fR .RS 4 .sp A 0MQ \fIcontext\fR is thread safe and may be shared among as many application threads as necessary, without any additional locking required on the part of the caller\&. .sp Individual 0MQ \fIsockets\fR are \fInot\fR thread safe except in the case where full memory barriers are issued when migrating a socket from one thread to another\&. In practice this means applications can create a socket in one thread with \fIzmq_socket()\fR and then pass it to a \fInewly created\fR thread as part of thread initialisation, for example via a structure passed as an argument to \fIpthread_create()\fR\&. .RE .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBMultiple contexts\fR .RS 4 .sp Multiple \fIcontexts\fR may coexist within a single application\&. Thus, an application can use 0MQ directly and at the same time make use of any number of additional libraries or components which themselves make use of 0MQ as long as the above guidelines regarding thread safety are adhered to\&. .RE .SS "Messages" .sp A 0MQ message is a discrete unit of data passed between applications or components of the same application\&. 0MQ messages have no internal structure and from the point of view of 0MQ itself they are considered to be opaque binary data\&. .sp The following functions are provided to work with messages: .PP Initialise a message .RS 4 \fBzmq_msg_init\fR(3)\fBzmq_msg_init_size\fR(3)\fBzmq_msg_init_data\fR(3) .RE .PP Sending and receiving a message .RS 4 \fBzmq_msg_send\fR(3)\fBzmq_msg_recv\fR(3) .RE .PP Release a message .RS 4 \fBzmq_msg_close\fR(3) .RE .PP Access message content .RS 4 \fBzmq_msg_data\fR(3)\fBzmq_msg_size\fR(3)\fBzmq_msg_more\fR(3) .RE .PP Work with message properties .RS 4 \fBzmq_msg_gets\fR(3)\fBzmq_msg_get\fR(3)\fBzmq_msg_set\fR(3) .RE .PP Message manipulation .RS 4 \fBzmq_msg_copy\fR(3)\fBzmq_msg_move\fR(3) .RE .SS "Sockets" .sp 0MQ sockets present an abstraction of an asynchronous \fImessage queue\fR, with the exact queueing semantics depending on the socket type in use\&. See \fBzmq_socket\fR(3) for the socket types provided\&. .sp The following functions are provided to work with sockets: .PP Creating a socket .RS 4 \fBzmq_socket\fR(3) .RE .PP Closing a socket .RS 4 \fBzmq_close\fR(3) .RE .PP Manipulating socket options .RS 4 \fBzmq_getsockopt\fR(3)\fBzmq_setsockopt\fR(3) .RE .PP Establishing a message flow .RS 4 \fBzmq_bind\fR(3)\fBzmq_connect\fR(3) .RE .PP Sending and receiving messages .RS 4 \fBzmq_msg_send\fR(3)\fBzmq_msg_recv\fR(3)\fBzmq_send\fR(3)\fBzmq_recv\fR(3)\fBzmq_send_const\fR(3) .RE .PP Monitoring socket events .RS 4 \fBzmq_socket_monitor\fR(3) .RE .PP \fBInput/output multiplexing\fR. 0MQ provides a mechanism for applications to multiplex input/output events over a set containing both 0MQ sockets and standard sockets\&. This mechanism mirrors the standard \fIpoll()\fR system call, and is described in detail in \fBzmq_poll\fR(3)\&. .SS "Transports" .sp A 0MQ socket can use multiple different underlying transport mechanisms\&. Each transport mechanism is suited to a particular purpose and has its own advantages and drawbacks\&. .sp The following transport mechanisms are provided: .PP Unicast transport using TCP .RS 4 \fBzmq_tcp\fR(7) .RE .PP Reliable multicast transport using PGM .RS 4 \fBzmq_pgm\fR(7) .RE .PP Local inter\-process communication transport .RS 4 \fBzmq_ipc\fR(7) .RE .PP Local in\-process (inter\-thread) communication transport .RS 4 \fBzmq_inproc\fR(7) .RE .PP Virtual Machine Communications Interface (VMC) transport .RS 4 \fBzmq_vmci\fR(7) .RE .PP Unreliable unicast and multicast using UDP .RS 4 \fBzmq_udp\fR(7) .RE .SS "Proxies" .sp 0MQ provides \fIproxies\fR to create fanout and fan\-in topologies\&. A proxy connects a \fIfrontend\fR socket to a \fIbackend\fR socket and switches all messages between the two sockets, opaquely\&. A proxy may optionally capture all traffic to a third socket\&. To start a proxy in an application thread, use \fBzmq_proxy\fR(3)\&. .SS "Security" .sp A 0MQ socket can select a security mechanism\&. Both peers must use the same security mechanism\&. .sp The following security mechanisms are provided for IPC and TCP connections: .PP Null security .RS 4 \fBzmq_null\fR(7) .RE .PP Plain\-text authentication using username and password .RS 4 \fBzmq_plain\fR(7) .RE .PP Elliptic curve authentication and encryption .RS 4 \fBzmq_curve\fR(7) .RE .PP Generate a CURVE keypair in armored text format .RS 4 \fBzmq_curve_keypair\fR(3) .RE .sp Derive a CURVE public key from a secret key: \fBzmq_curve_public\fR(3) .PP Converting keys to/from armoured text strings .RS 4 \fBzmq_z85_decode\fR(3)\fBzmq_z85_encode\fR(3) .RE .SH "ERROR HANDLING" .sp The 0MQ library functions handle errors using the standard conventions found on POSIX systems\&. Generally, this means that upon failure a 0MQ library function shall return either a NULL value (if returning a pointer) or a negative value (if returning an integer), and the actual error code shall be stored in the \fIerrno\fR variable\&. .sp On non\-POSIX systems some users may experience issues with retrieving the correct value of the \fIerrno\fR variable\&. The \fIzmq_errno()\fR function is provided to assist in these cases; for details refer to \fBzmq_errno\fR(3)\&. .sp The \fIzmq_strerror()\fR function is provided to translate 0MQ\-specific error codes into error message strings; for details refer to \fBzmq_strerror\fR(3)\&. .SH "UTILITY" .sp The following utility functions are provided: .PP Working with atomic counters .RS 4 \fBzmq_atomic_counter_new\fR(3)\fBzmq_atomic_counter_set\fR(3)\fBzmq_atomic_counter_inc\fR(3)\fBzmq_atomic_counter_dec\fR(3)\fBzmq_atomic_counter_value\fR(3)\fBzmq_atomic_counter_destroy\fR(3) .RE .SH "MISCELLANEOUS" .sp The following miscellaneous functions are provided: .PP Report 0MQ library version .RS 4 \fBzmq_version\fR(3) .RE .SH "LANGUAGE BINDINGS" .sp The 0MQ library provides interfaces suitable for calling from programs in any language; this documentation documents those interfaces as they would be used by C programmers\&. The intent is that programmers using 0MQ from other languages shall refer to this documentation alongside any documentation provided by the vendor of their language binding\&. .sp Language bindings (C++, Python, PHP, Ruby, Java and more) are provided by members of the 0MQ community and pointers can be found on the 0MQ website\&. .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. .SH "RESOURCES" .sp Main web site: \m[blue]\fBhttp://www\&.zeromq\&.org/\fR\m[] .sp Report bugs to the 0MQ development mailing list: <\m[blue]\fBzeromq\-dev@lists\&.zeromq\&.org\fR\m[]\&\s-2\u[1]\d\s+2> .SH "COPYING" .sp Free use of this software is granted under the terms of the GNU Lesser General Public License (LGPL)\&. For details see the files COPYING and COPYING\&.LESSER included with the 0MQ distribution\&. .SH "NOTES" .IP " 1." 4 zeromq-dev@lists.zeromq.org .RS 4 \%mailto:zeromq-dev@lists.zeromq.org .RE zeromq-4.2.5/doc/zmq_msg_init.txt0000664000372000037200000000240713255253220017751 0ustar00travistravis00000000000000zmq_msg_init(3) =============== NAME ---- zmq_msg_init - initialise empty 0MQ message SYNOPSIS -------- *int zmq_msg_init (zmq_msg_t '*msg');* DESCRIPTION ----------- The _zmq_msg_init()_ function shall initialise the message object referenced by 'msg' to represent an empty message. This function is most useful when called before receiving a message with _zmq_msg_recv()_. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. CAUTION: The functions _zmq_msg_init()_, _zmq_msg_init_data()_ and _zmq_msg_init_size()_ are mutually exclusive. Never initialise the same 'zmq_msg_t' twice. RETURN VALUE ------------ The _zmq_msg_init()_ function always returns zero. ERRORS ------ No errors are defined. EXAMPLE ------- .Receiving a message from a socket ---- zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); int nbytes = zmq_msg_recv (socket, &msg, 0); assert (nbytes != -1); ---- SEE ALSO -------- linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_close[3] linkzmq:zmq_msg_data[3] linkzmq:zmq_msg_size[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_size.30000664000372000037200000000432613255253356017317 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_size .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_SIZE" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_size \- retrieve message content size in bytes .SH "SYNOPSIS" .sp \fBsize_t zmq_msg_size (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_size()\fR function shall return the size in bytes of the content of the message object referenced by \fImsg\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .SH "RETURN VALUE" .sp Upon successful completion, \fIzmq_msg_size()\fR shall return the size of the message content in bytes\&. .SH "ERRORS" .sp No errors are defined\&. .SH "SEE ALSO" .sp \fBzmq_msg_data\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init_data\fR(3) \fBzmq_msg_close\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_tipc.70000664000372000037200000000676513255253401016442 0ustar00travistravis00000000000000'\" t .\" Title: zmq_tipc .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_TIPC" "7" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_tipc \- 0MQ unicast transport using TIPC .SH "SYNOPSIS" .sp TIPC is a cluster IPC protocol with a location transparent addressing scheme\&. .SH "ADDRESSING" .sp A 0MQ endpoint is a string consisting of a \fItransport\fR:// followed by an \fIaddress\fR\&. The \fItransport\fR specifies the underlying protocol to use\&. The \fIaddress\fR specifies the transport\-specific address to connect to\&. .sp For the TIPC transport, the transport is tipc, and the meaning of the \fIaddress\fR part is defined below\&. .SS "Assigning a port name to a socket" .sp When assigning a port name to a socket using \fIzmq_bind()\fR with the \fItipc\fR transport, the \fIendpoint\fR is defined in the form: {type, lower, upper} .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Type is the numerical (u32) ID of your service\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Lower and Upper specify a range for your service\&. .RE .sp Publishing the same service with overlapping lower/upper ID\(cqs will cause connection requests to be distributed over these in a round\-robin manner\&. .SS "Connecting a socket" .sp When connecting a socket to a peer address using \fIzmq_connect()\fR with the \fItipc\fR transport, the \fIendpoint\fR shall be interpreted as a service ID, followed by a comma and the instance ID\&. .sp The instance ID must be within the lower/upper range of a published port name for the endpoint to be valid\&. .SH "EXAMPLES" .PP \fBAssigning a local address to a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Publish TIPC service ID 5555 rc = zmq_bind(socket, "tipc://{5555,0,0}"); assert (rc == 0); // Publish TIPC service ID 5555 with a service range of 0\-100 rc = zmq_bind(socket, "tipc://{5555,0,100}"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBConnecting a socket\fR. .sp .if n \{\ .RS 4 .\} .nf // Connect to service 5555 instance id 50 rc = zmq_connect(socket, "tipc://{5555,50}"); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_connect\fR(3) \fBzmq_tcp\fR(7) \fBzmq_pgm\fR(7) \fBzmq_ipc\fR(7) \fBzmq_inproc\fR(7) \fBzmq_vmci\fR(7) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_strerror.html0000664000372000037200000004436613255253336020171 0ustar00travistravis00000000000000 zmq_strerror(3)

SYNOPSIS

const char *zmq_strerror (int errnum);

DESCRIPTION

The zmq_strerror() function shall return a pointer to an error message string corresponding to the error number specified by the errnum argument. As ØMQ defines additional error numbers over and above those defined by the operating system, applications should use zmq_strerror() in preference to the standard strerror() function.

RETURN VALUE

The zmq_strerror() function shall return a pointer to an error message string.

ERRORS

No errors are defined.

EXAMPLE

Displaying an error message when a ØMQ context cannot be initialised
void *ctx = zmq_init (1, 1, 0);
if (!ctx) {
    printf ("Error occurred during zmq_init(): %s\n", zmq_strerror (errno));
    abort ();
}

SEE ALSO

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_msg_copy.txt0000664000372000037200000000335213255253220017760 0ustar00travistravis00000000000000zmq_msg_copy(3) =============== NAME ---- zmq_msg_copy - copy content of a message to another message SYNOPSIS -------- *int zmq_msg_copy (zmq_msg_t '*dest', zmq_msg_t '*src');* DESCRIPTION ----------- The _zmq_msg_copy()_ function shall copy the message object referenced by 'src' to the message object referenced by 'dest'. The original content of 'dest', if any, shall be released. You must initialise 'dest' before copying to it. CAUTION: The implementation may choose not to physically copy the message content, rather to share the underlying buffer between 'src' and 'dest'. Avoid modifying message content after a message has been copied with _zmq_msg_copy()_, doing so can result in undefined behaviour. If what you need is an actual hard copy, allocate a new message using _zmq_msg_init_size()_ and copy the message content using _memcpy()_. CAUTION: Never access 'zmq_msg_t' members directly, instead always use the _zmq_msg_ family of functions. RETURN VALUE ------------ The _zmq_msg_copy()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EFAULT*:: Invalid message. EXAMPLE ------- .Copying a message ---- zmq_msg_t msg; zmq_msg_init_size (&msg, 255); memcpy (zmq_msg_data (&msg, "Hello, World", 12); zmq_msg_t copy; zmq_msg_init (©); zmq_msg_copy (©, &msg); ... zmq_msg_close (©); zmq_msg_close (&msg); ---- SEE ALSO -------- linkzmq:zmq_msg_move[3] linkzmq:zmq_msg_init[3] linkzmq:zmq_msg_init_size[3] linkzmq:zmq_msg_init_data[3] linkzmq:zmq_msg_close[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_msg_more.html0000664000372000037200000004517413255253333020112 0ustar00travistravis00000000000000 zmq_msg_more(3)

SYNOPSIS

int zmq_msg_more (zmq_msg_t *message);

DESCRIPTION

The zmq_msg_more() function indicates whether this is part of a multi-part message, and there are further parts to receive. This method can safely be called after zmq_msg_close(). This method is identical to zmq_msg_get() with an argument of ZMQ_MORE.

RETURN VALUE

The zmq_msg_more() function shall return zero if this is the final part of a multi-part message, or the only part of a single-part message. It shall return 1 if there are further parts to receive.

EXAMPLE

Receiving a multi-part message
zmq_msg_t part;
while (true) {
    //  Create an empty 0MQ message to hold the message part
    int rc = zmq_msg_init (&part);
    assert (rc == 0);
    //  Block until a message is available to be received from socket
    rc = zmq_msg_recv (socket, &part, 0);
    assert (rc != -1);
    if (zmq_msg_more (&part))
        fprintf (stderr, "more\n");
    else {
        fprintf (stderr, "end\n");
        break;
    }
    zmq_msg_close (&part);
}

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_dec.html0000664000372000037200000004534513255253342022130 0ustar00travistravis00000000000000 zmq_atomic_counter_dec(3)

SYNOPSIS

int zmq_atomic_counter_dec (void *counter);

DESCRIPTION

The zmq_atomic_counter_dec function decrements an atomic counter in a threadsafe fashion. This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_dec() function returns 1 if the counter is greater than zero after decrementing, or zero if the counter reached zero.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_recv.html0000664000372000037200000005153513255253332017236 0ustar00travistravis00000000000000 zmq_recv(3)

SYNOPSIS

int zmq_recv (void *socket, void *buf, size_t len, int flags);

DESCRIPTION

The zmq_recv() function shall receive a message from the socket referenced by the socket argument and store it in the buffer referenced by the buf argument. Any bytes exceeding the length specified by the len argument shall be truncated. If there are no messages available on the specified socket the zmq_recv() function shall block until the request can be satisfied. The flags argument is a combination of the flags defined below: The buf argument may be null if len is zero.

ZMQ_DONTWAIT

Specifies that the operation should be performed in non-blocking mode. If there are no messages available on the specified socket, the zmq_recv() function shall fail with errno set to EAGAIN.

Multi-part messages

A ØMQ message is composed of 1 or more message parts. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that processes multi-part messages must use the ZMQ_RCVMORE zmq_getsockopt(3) option after calling zmq_recv() to determine if there are further parts to receive.

RETURN VALUE

The zmq_recv() function shall return number of bytes in the message if successful. Note that the value can exceed the value of the len parameter in case the message was truncated. If not successful the function shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and no messages are available at the moment.

ENOTSUP

The zmq_recv() operation is not supported by this socket type.

EFSM

The zmq_recv() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before a message was available.

EXAMPLE

Receiving a message from a socket
char buf [256];
nbytes = zmq_recv (socket, buf, 256, 0);
assert (nbytes != -1);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_disconnect.txt0000664000372000037200000000410713255253220020270 0ustar00travistravis00000000000000zmq_disconnect(3) ================= NAME ---- zmq_disconnect - Disconnect a socket SYNOPSIS -------- *int zmq_disconnect (void '*socket', const char '*endpoint');* DESCRIPTION ----------- The _zmq_disconnect()_ function shall disconnect a socket specified by the 'socket' argument from the endpoint specified by the 'endpoint' argument. Any outstanding messages physically received from the network but not yet received by the application with _zmq_recv()_ shall be discarded. The behaviour for discarding messages sent by the application with _zmq_send()_ but not yet physically transferred to the network depends on the value of the _ZMQ_LINGER_ socket option for the specified 'socket'. The 'endpoint' argument is as described in linkzmq:zmq_connect[3] NOTE: The default setting of _ZMQ_LINGER_ does not discard unsent messages; this behaviour may cause the application to block when calling _zmq_ctx_term()_. For details refer to linkzmq:zmq_setsockopt[3] and linkzmq:zmq_ctx_term[3]. RETURN VALUE ------------ The _zmq_disconnect()_ function shall return zero if successful. Otherwise it shall return `-1` and set 'errno' to one of the values defined below. ERRORS ------ *EINVAL*:: The endpoint supplied is invalid. *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *ENOTSOCK*:: The provided 'socket' was invalid. *ENOENT*:: The provided endpoint is not connected. EXAMPLE ------- .Connecting a subscriber socket to an in-process and a TCP transport ---- /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_connect (socket, "tcp://server001:5555"); assert (rc == 0); /* Disconnect from the previously connected endpoint */ rc = zmq_disconnect (socket, "tcp://server001:5555"); assert (rc == 0); ---- SEE ALSO -------- linkzmq:zmq_connect[3] linkzmq:zmq_socket[3] linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_curve_public.30000664000372000037200000000523313255253373020156 0ustar00travistravis00000000000000'\" t .\" Title: zmq_curve_public .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CURVE_PUBLIC" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_curve_public \- derive the public key from a private key .SH "SYNOPSIS" .sp \fBint zmq_curve_public (char *z85_public_key, char *z85_secret_key);\fR .SH "DESCRIPTION" .sp The \fIzmq_curve_public()\fR function shall derive the public key from a private key\&. The caller provides two buffers, each at least 41 octets large\&. In z85_secret_key the caller shall provide the private key, and the function will store the public key in z85_public_key\&. The keys are encoded using \fBzmq_z85_encode\fR(3)\&. .SH "RETURN VALUE" .sp The \fIzmq_curve_public()\fR function shall return 0 if successful, else it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBENOTSUP\fR .RS 4 The libzmq library was not built with cryptographic support (libsodium)\&. .RE .SH "EXAMPLE" .PP \fBDeriving the public key from a CURVE private key\fR. .sp .if n \{\ .RS 4 .\} .nf char public_key [41]; char secret_key [41]; int rc = zmq_curve_keypair (public_key, secret_key); assert (rc == 0); char derived_public[41]; rc = zmq_curve_public (derived_public, secret_key); assert (rc == 0); assert (!strcmp (derived_public, public_key)); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_z85_decode\fR(3) \fBzmq_z85_encode\fR(3) \fBzmq_curve_keypair\fR(3) \fBzmq_curve\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_ctx_shutdown.html0000664000372000037200000004474013255253327021034 0ustar00travistravis00000000000000 zmq_ctx_shutdown(3)

SYNOPSIS

int zmq_ctx_shutdown (void *context);

DESCRIPTION

The zmq_ctx_shutdown() function shall shutdown the ØMQ context context.

Context shutdown will cause any blocking operations currently in progress on sockets open within context to return immediately with an error code of ETERM. With the exception of zmq_close(), any further operations on sockets open within context shall fail with an error code of ETERM.

This function is optional, client code is still required to call the zmq_ctx_term(3) function to free all resources allocated by zeromq.

RETURN VALUE

The zmq_ctx_shutdown() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EFAULT

The provided context was invalid.

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_destroy.html0000664000372000037200000004547713255253343023075 0ustar00travistravis00000000000000 zmq_atomic_counter_destroy(3)

SYNOPSIS

void zmq_atomic_counter_destroy (void **counter_p);

DESCRIPTION

The zmq_atomic_counter_destroy function destroys an atomic counter and nullifies its reference. Pass the address of an atomic counter (void **) rather than the counter itself. You must destroy all counters that you create, to avoid memory leakage. This function uses platform specific atomic operations.

RETURN VALUE

The zmq_atomic_counter_destroy() function has no return value.

EXAMPLE

Test code for atomic counters
void *counter = zmq_atomic_counter_new ();
assert (zmq_atomic_counter_value (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 0);
assert (zmq_atomic_counter_inc (counter) == 1);
assert (zmq_atomic_counter_inc (counter) == 2);
assert (zmq_atomic_counter_value (counter) == 3);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_set (counter, 2);
assert (zmq_atomic_counter_dec (counter) == 1);
assert (zmq_atomic_counter_dec (counter) == 0);
zmq_atomic_counter_destroy (&counter);
return 0;

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_curve_keypair.30000664000372000037200000000466313255253372020351 0ustar00travistravis00000000000000'\" t .\" Title: zmq_curve_keypair .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_CURVE_KEYPAIR" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_curve_keypair \- generate a new CURVE keypair .SH "SYNOPSIS" .sp \fBint zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);\fR .SH "DESCRIPTION" .sp The \fIzmq_curve_keypair()\fR function shall return a newly generated random keypair consisting of a public key and a secret key\&. The caller provides two buffers, each at least 41 octets large, in which this method will store the keys\&. The keys are encoded using \fBzmq_z85_encode\fR(3)\&. .SH "RETURN VALUE" .sp The \fIzmq_curve_keypair()\fR function shall return 0 if successful, else it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBENOTSUP\fR .RS 4 The libzmq library was not built with cryptographic support (libsodium)\&. .RE .SH "EXAMPLE" .PP \fBGenerating a new CURVE keypair\fR. .sp .if n \{\ .RS 4 .\} .nf char public_key [41]; char secret_key [41]; int rc = zmq_curve_keypair (public_key, secret_key); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_z85_decode\fR(3) \fBzmq_z85_encode\fR(3) \fBzmq_curve\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_msg_init_data.30000664000372000037200000001006713255253353020275 0ustar00travistravis00000000000000'\" t .\" Title: zmq_msg_init_data .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_MSG_INIT_DATA" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_msg_init_data \- initialise 0MQ message from a supplied buffer .SH "SYNOPSIS" .sp \fBtypedef void (zmq_free_fn) (void \fR\fB\fI*data\fR\fR\fB, void \fR\fB\fI*hint\fR\fR\fB);\fR .sp \fBint zmq_msg_init_data (zmq_msg_t \fR\fB\fI*msg\fR\fR\fB, void \fR\fB\fI*data\fR\fR\fB, size_t \fR\fB\fIsize\fR\fR\fB, zmq_free_fn \fR\fB\fI*ffn\fR\fR\fB, void \fR\fB\fI*hint\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_msg_init_data()\fR function shall initialise the message object referenced by \fImsg\fR to represent the content referenced by the buffer located at address \fIdata\fR, \fIsize\fR bytes long\&. No copy of \fIdata\fR shall be performed and 0MQ shall take ownership of the supplied buffer\&. .sp If provided, the deallocation function \fIffn\fR shall be called once the data buffer is no longer required by 0MQ, with the \fIdata\fR and \fIhint\fR arguments supplied to \fIzmq_msg_init_data()\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp Never access \fIzmq_msg_t\fR members directly, instead always use the \fIzmq_msg\fR family of functions\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The deallocation function \fIffn\fR needs to be thread\-safe, since it will be called from an arbitrary thread\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp If the deallocation function is not provided, the allocated memory will not be freed, and this may cause a memory leak\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBCaution\fR .ps -1 .br .sp The functions \fIzmq_msg_init()\fR, \fIzmq_msg_init_data()\fR and \fIzmq_msg_init_size()\fR are mutually exclusive\&. Never initialise the same \fIzmq_msg_t\fR twice\&. .sp .5v .RE .SH "RETURN VALUE" .sp The \fIzmq_msg_init_data()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBENOMEM\fR .RS 4 Insufficient storage space is available\&. .RE .SH "EXAMPLE" .PP \fBInitialising a message from a supplied buffer\fR. .sp .if n \{\ .RS 4 .\} .nf void my_free (void *data, void *hint) { free (data); } /* \&.\&.\&. */ void *data = malloc (6); assert (data); memcpy (data, "ABCDEF", 6); zmq_msg_t msg; rc = zmq_msg_init_data (&msg, data, 6, my_free, NULL); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_msg_init_size\fR(3) \fBzmq_msg_init\fR(3) \fBzmq_msg_close\fR(3) \fBzmq_msg_data\fR(3) \fBzmq_msg_size\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/asciidoc.conf0000664000372000037200000000240113255253220017127 0ustar00travistravis00000000000000[paradef-default] literal-style=template="literalparagraph" [macros] (?su)[\\]?(?Plinkzmq):(?P\S*?)\[(?P.*?)\]= ifdef::backend-docbook[] [linkzmq-inlinemacro] {0%{target}} {0#} {0#{target}{0}} {0#} endif::backend-docbook[] ifdef::backend-xhtml11[] [linkzmq-inlinemacro] {target}{0?({0})} endif::backend-xhtml11[] ifdef::doctype-manpage[] ifdef::backend-docbook[] [header] template::[header-declarations] {mantitle} {manvolnum} 0MQ {zmq_version} 0MQ Manual {manname} {manpurpose} endif::backend-docbook[] endif::doctype-manpage[] ifdef::backend-xhtml11[] [footer] {disable-javascript%

} endif::backend-xhtml11[] [replacements] ifdef::backend-xhtml11[] 0MQ=ØMQ endif::backend-xhtml11[] zeromq-4.2.5/doc/zmq_send.html0000664000372000037200000005301213255253332017220 0ustar00travistravis00000000000000 zmq_send(3)

SYNOPSIS

int zmq_send (void *socket, void *buf, size_t len, int flags);

DESCRIPTION

The zmq_send() function shall queue a message created from the buffer referenced by the buf and len arguments. The flags argument is a combination of the flags defined below:

ZMQ_DONTWAIT

For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the socket, the zmq_send() function shall fail with errno set to EAGAIN.

ZMQ_SNDMORE

Specifies that the message being sent is a multi-part message, and that further message parts are to follow. Refer to the section regarding multi-part messages below for a detailed description.

Note
A successful invocation of zmq_send() does not indicate that the message has been transmitted to the network, only that it has been queued on the socket and ØMQ has assumed responsibility for the message.

Multi-part messages

A ØMQ message is composed of 1 or more message parts. ØMQ ensures atomic delivery of messages: peers shall receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.

An application that sends multi-part messages must use the ZMQ_SNDMORE flag when sending each message part except the final one.

RETURN VALUE

The zmq_send() function shall return number of bytes in the message if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EAGAIN

Non-blocking mode was requested and the message cannot be sent at the moment.

ENOTSUP

The zmq_send() operation is not supported by this socket type.

EINVAL

The sender tried to send multipart data, which the socket type does not allow.

EFSM

The zmq_send() operation cannot be performed on this socket at the moment due to the socket not being in the appropriate state. This error may occur with socket types that switch between several states, such as ZMQ_REP. See the messaging patterns section of zmq_socket(3) for more information.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EINTR

The operation was interrupted by delivery of a signal before the message was sent.

EHOSTUNREACH

The message cannot be routed.

EXAMPLE

Sending a multi-part message
/* Send a multi-part message consisting of three parts to socket */
rc = zmq_send (socket, "ABC", 3, ZMQ_SNDMORE);
assert (rc == 3);
rc = zmq_send (socket, "DEFGH", 5, ZMQ_SNDMORE);
assert (rc == 5);
/* Final part; no more parts to follow */
rc = zmq_send (socket, "JK", 2, 0);
assert (rc == 2);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_unbind.30000664000372000037200000000730313255253347016754 0ustar00travistravis00000000000000'\" t .\" Title: zmq_unbind .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_UNBIND" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_unbind \- Stop accepting connections on a socket .SH "SYNOPSIS" .sp int zmq_unbind (void \fI*socket\fR, const char \fI*endpoint\fR); .SH "DESCRIPTION" .sp The \fIzmq_unbind()\fR function shall unbind a socket specified by the \fIsocket\fR argument from the endpoint specified by the \fIendpoint\fR argument\&. .sp The \fIendpoint\fR argument is as described in \fBzmq_bind\fR(3) .SS "Unbinding wild\-card address from a socket" .sp When wild\-card * \fIendpoint\fR (described in \fBzmq_tcp\fR(7), \fBzmq_ipc\fR(7) and \fBzmq_vmci\fR(7)) was used in \fIzmq_bind()\fR, the caller should use real \fIendpoint\fR obtained from the ZMQ_LAST_ENDPOINT socket option to unbind this \fIendpoint\fR from a socket\&. .SH "RETURN VALUE" .sp The \fIzmq_unbind()\fR function shall return zero if successful\&. Otherwise it shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The endpoint supplied is invalid\&. .RE .PP \fBETERM\fR .RS 4 The 0MQ \fIcontext\fR associated with the specified \fIsocket\fR was terminated\&. .RE .PP \fBENOTSOCK\fR .RS 4 The provided \fIsocket\fR was invalid\&. .RE .PP \fBENOENT\fR .RS 4 The endpoint supplied was not previously bound\&. .RE .SH "EXAMPLES" .PP \fBUnbind a subscriber socket from a TCP transport\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Connect it to the host server001, port 5555 using a TCP transport */ rc = zmq_bind (socket, "tcp://127\&.0\&.0\&.1:5555"); assert (rc == 0); /* Disconnect from the previously connected endpoint */ rc = zmq_unbind (socket, "tcp://127\&.0\&.0\&.1:5555"); assert (rc == 0); .fi .if n \{\ .RE .\} .PP \fBUnbind wild-card * binded socket\fR. .sp .if n \{\ .RS 4 .\} .nf /* Create a ZMQ_SUB socket */ void *socket = zmq_socket (context, ZMQ_SUB); assert (socket); /* Bind it to the system\-assigned ephemeral port using a TCP transport */ rc = zmq_bind (socket, "tcp://127\&.0\&.0\&.1:*"); assert (rc == 0); /* Obtain real endpoint */ const size_t buf_size = 32; char buf[buf_size]; rc = zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, buf, (size_t *)&buf_size); assert (rc == 0); /* Unbind socket by real endpoint */ rc = zmq_unbind (socket, buf); assert (rc == 0); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_bind\fR(3) \fBzmq_socket\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_socket_monitor.txt0000664000372000037200000002311013255253220021171 0ustar00travistravis00000000000000zmq_socket_monitor(3) ===================== NAME ---- zmq_socket_monitor - monitor socket events SYNOPSIS -------- *int zmq_socket_monitor (void '*socket', char '*endpoint', int 'events');* DESCRIPTION ----------- The _zmq_socket_monitor()_ method lets an application thread track socket events (like connects) on a ZeroMQ socket. Each call to this method creates a 'ZMQ_PAIR' socket and binds that to the specified inproc:// 'endpoint'. To collect the socket events, you must create your own 'ZMQ_PAIR' socket, and connect that to the endpoint. The 'events' argument is a bitmask of the socket events you wish to monitor, see 'Supported events' below. To monitor all events, use the event value ZMQ_EVENT_ALL. NOTE: as new events are added, the catch-all value will start returning them. An application that relies on a strict and fixed sequence of events must not use ZMQ_EVENT_ALL in order to guarantee compatibility with future versions. Each event is sent as two frames. The first frame contains an event number (16 bits), and an event value (32 bits) that provides additional data according to the event number. The second frame contains a string that specifies the affected TCP or IPC endpoint. ---- The _zmq_socket_monitor()_ method supports only connection-oriented transports, that is, TCP, IPC, and TIPC. ---- Supported events ---------------- ZMQ_EVENT_CONNECTED ~~~~~~~~~~~~~~~~~~~ The socket has successfully connected to a remote peer. The event value is the file descriptor (FD) of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event. ZMQ_EVENT_CONNECT_DELAYED ~~~~~~~~~~~~~~~~~~~~~~~~~ A connect request on the socket is pending. The event value is unspecified. ZMQ_EVENT_CONNECT_RETRIED ~~~~~~~~~~~~~~~~~~~~~~~~~ A connect request failed, and is now being retried. The event value is the reconnect interval in milliseconds. Note that the reconnect interval is recalculated at each retry. ZMQ_EVENT_LISTENING ~~~~~~~~~~~~~~~~~~~ The socket was successfully bound to a network interface. The event value is the FD of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event. ZMQ_EVENT_BIND_FAILED ~~~~~~~~~~~~~~~~~~~~~ The socket could not bind to a given interface. The event value is the errno generated by the system bind call. ZMQ_EVENT_ACCEPTED ~~~~~~~~~~~~~~~~~~ The socket has accepted a connection from a remote peer. The event value is the FD of the underlying network socket. Warning: there is no guarantee that the FD is still valid by the time your code receives this event. ZMQ_EVENT_ACCEPT_FAILED ~~~~~~~~~~~~~~~~~~~~~~~ The socket has rejected a connection from a remote peer. The event value is the errno generated by the accept call. ZMQ_EVENT_CLOSED ~~~~~~~~~~~~~~~~ The socket was closed. The event value is the FD of the (now closed) network socket. ZMQ_EVENT_CLOSE_FAILED ~~~~~~~~~~~~~~~~~~~~~~ The socket close failed. The event value is the errno returned by the system call. Note that this event occurs only on IPC transports. ZMQ_EVENT_DISCONNECTED ~~~~~~~~~~~~~~~~~~~~~~ The socket was disconnected unexpectedly. The event value is the FD of the underlying network socket. Warning: this socket will be closed. ZMQ_EVENT_MONITOR_STOPPED ~~~~~~~~~~~~~~~~~~~~~~~~~ Monitoring on this socket ended. DRAFT events - subject to change without notice ----------------------------------------------- ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unspecified error during handshake. The event value is an errno. NOTE: in DRAFT state, not yet available in stable releases. ZMQ_EVENT_HANDSHAKE_SUCCEEDED ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ZMTP security mechanism handshake succeeded. The event value is unspecified. NOTE: in DRAFT state, not yet available in stable releases. ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ZMTP security mechanism handshake failed due to some mechanism protocol error, either between the ZMTP mechanism peers, or between the mechanism server and the ZAP handler. This indicates a configuration or implementation error in either peer resp. the ZAP handler. The event value is one of the ZMQ_PROTOCOL_ERROR_* values: ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA NOTE: in DRAFT state, not yet available in stable releases. ZMQ_EVENT_HANDSHAKE_FAILED_AUTH ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ZMTP security mechanism handshake failed due to an authentication failure. The event value is the status code returned by the ZAP handler (i.e. 300, 400 or 500). NOTE: in DRAFT state, not yet available in stable releases. RETURN VALUE ------------ The _zmq_socket_monitor()_ function returns a value of 0 or greater if successful. Otherwise it returns `-1` and sets 'errno' to one of the values defined below. ERRORS ------ *ETERM*:: The 0MQ 'context' associated with the specified 'socket' was terminated. *EPROTONOSUPPORT*:: The requested 'transport' protocol is not supported. Monitor sockets are required to use the inproc:// transport. *EINVAL*:: The endpoint supplied is invalid. EXAMPLE ------- .Monitoring client and server sockets ---- // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. static int get_monitor_event (void *monitor, int *value, char **address) { // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interrupted, presumably assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); if (value) *value = *(uint32_t *) (data + 2); // Second frame in message contains event address zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interrupted, presumably assert (!zmq_msg_more (&msg)); if (address) { uint8_t *data = (uint8_t *) zmq_msg_data (&msg); size_t size = zmq_msg_size (&msg); *address = (char *) malloc (size + 1); memcpy (*address, data, size); (*address)[size] = 0; } return event; } int main (void) { void *ctx = zmq_ctx_new (); assert (ctx); // We'll monitor these two sockets void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); // Socket monitoring only works over inproc:// int rc = zmq_socket_monitor (client, "tcp://127.0.0.1:9999", 0); assert (rc == -1); assert (zmq_errno () == EPROTONOSUPPORT); // Monitor all events on client and server sockets rc = zmq_socket_monitor (client, "inproc://monitor-client", ZMQ_EVENT_ALL); assert (rc == 0); rc = zmq_socket_monitor (server, "inproc://monitor-server", ZMQ_EVENT_ALL); assert (rc == 0); // Create two sockets for collecting monitor events void *client_mon = zmq_socket (ctx, ZMQ_PAIR); assert (client_mon); void *server_mon = zmq_socket (ctx, ZMQ_PAIR); assert (server_mon); // Connect these to the inproc endpoints so they'll get events rc = zmq_connect (client_mon, "inproc://monitor-client"); assert (rc == 0); rc = zmq_connect (server_mon, "inproc://monitor-server"); assert (rc == 0); // Now do a basic ping test rc = zmq_bind (server, "tcp://127.0.0.1:9998"); assert (rc == 0); rc = zmq_connect (client, "tcp://127.0.0.1:9998"); assert (rc == 0); bounce (client, server); // Close client and server close_zero_linger (client); close_zero_linger (server); // Now collect and check events from both sockets int event = get_monitor_event (client_mon, NULL, NULL); if (event == ZMQ_EVENT_CONNECT_DELAYED) event = get_monitor_event (client_mon, NULL, NULL); assert (event == ZMQ_EVENT_CONNECTED); event = get_monitor_event (client_mon, NULL, NULL); assert (event == ZMQ_EVENT_MONITOR_STOPPED); // This is the flow of server events event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_LISTENING); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_ACCEPTED); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_CLOSED); event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_MONITOR_STOPPED); // Close down the sockets close_zero_linger (client_mon); close_zero_linger (server_mon); zmq_ctx_term (ctx); return 0 ; } ---- SEE ALSO -------- linkzmq:zmq[7] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/doc/zmq_poll.30000664000372000037200000001467613255253365016456 0ustar00travistravis00000000000000'\" t .\" Title: zmq_poll .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 .\" Date: 03/23/2018 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.2.5 .\" Language: English .\" .TH "ZMQ_POLL" "3" "03/23/2018" "0MQ 4\&.2\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_poll \- input/output multiplexing .SH "SYNOPSIS" .sp \fBint zmq_poll (zmq_pollitem_t \fR\fB\fI*items\fR\fR\fB, int \fR\fB\fInitems\fR\fR\fB, long \fR\fB\fItimeout\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_poll()\fR function provides a mechanism for applications to multiplex input/output events in a level\-triggered fashion over a set of sockets\&. Each member of the array pointed to by the \fIitems\fR argument is a \fBzmq_pollitem_t\fR structure\&. The \fInitems\fR argument specifies the number of items in the \fIitems\fR array\&. The \fBzmq_pollitem_t\fR structure is defined as follows: .sp .if n \{\ .RS 4 .\} .nf typedef struct { void \fI*socket\fR; int \fIfd\fR; short \fIevents\fR; short \fIrevents\fR; } zmq_pollitem_t; .fi .if n \{\ .RE .\} .sp For each \fBzmq_pollitem_t\fR item, \fIzmq_poll()\fR shall examine either the 0MQ socket referenced by \fIsocket\fR \fBor\fR the standard socket specified by the file descriptor \fIfd\fR, for the event(s) specified in \fIevents\fR\&. If both \fIsocket\fR and \fIfd\fR are set in a single \fBzmq_pollitem_t\fR, the 0MQ socket referenced by \fIsocket\fR shall take precedence and the value of \fIfd\fR shall be ignored\&. .sp For each \fBzmq_pollitem_t\fR item, \fIzmq_poll()\fR shall first clear the \fIrevents\fR member, and then indicate any requested events that have occurred by setting the bit corresponding to the event condition in the \fIrevents\fR member\&. .sp If none of the requested events have occurred on any \fBzmq_pollitem_t\fR item, \fIzmq_poll()\fR shall wait \fItimeout\fR milliseconds for an event to occur on any of the requested items\&. If the value of \fItimeout\fR is 0, \fIzmq_poll()\fR shall return immediately\&. If the value of \fItimeout\fR is \-1, \fIzmq_poll()\fR shall block indefinitely until a requested event has occurred on at least one \fBzmq_pollitem_t\fR\&. .sp The \fIevents\fR and \fIrevents\fR members of \fBzmq_pollitem_t\fR are bit masks constructed by OR\(cqing a combination of the following event flags: .PP \fBZMQ_POLLIN\fR .RS 4 For 0MQ sockets, at least one message may be received from the \fIsocket\fR without blocking\&. For standard sockets this is equivalent to the \fIPOLLIN\fR flag of the \fIpoll()\fR system call and generally means that at least one byte of data may be read from \fIfd\fR without blocking\&. .RE .PP \fBZMQ_POLLOUT\fR .RS 4 For 0MQ sockets, at least one message may be sent to the \fIsocket\fR without blocking\&. For standard sockets this is equivalent to the \fIPOLLOUT\fR flag of the \fIpoll()\fR system call and generally means that at least one byte of data may be written to \fIfd\fR without blocking\&. .RE .PP \fBZMQ_POLLERR\fR .RS 4 For standard sockets, this flag is passed through \fIzmq_poll()\fR to the underlying \fIpoll()\fR system call and generally means that some sort of error condition is present on the socket specified by \fIfd\fR\&. For 0MQ sockets this flag has no effect if set in \fIevents\fR, and shall never be returned in \fIrevents\fR by \fIzmq_poll()\fR\&. .RE .PP \fBZMQ_POLLPRI\fR .RS 4 For 0MQ sockets this flags is of no use\&. For standard sockets this means there is urgent data to read\&. Refer to the POLLPRI flag for more informations\&. For file descriptor, refer to your use case: as an example, GPIO interrupts are signaled through a POLLPRI event\&. This flag has no effect on Windows\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp The \fIzmq_poll()\fR function may be implemented or emulated using operating system interfaces other than \fIpoll()\fR, and as such may be subject to the limits of those interfaces in ways not defined in this documentation\&. .sp .5v .RE .SH "RETURN VALUE" .sp Upon successful completion, the \fIzmq_poll()\fR function shall return the number of \fBzmq_pollitem_t\fR structures with events signaled in \fIrevents\fR or 0 if no events have been signaled\&. Upon failure, \fIzmq_poll()\fR shall return \-1 and set \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBETERM\fR .RS 4 At least one of the members of the \fIitems\fR array refers to a \fIsocket\fR whose associated 0MQ \fIcontext\fR was terminated\&. .RE .PP \fBEFAULT\fR .RS 4 The provided \fIitems\fR was not valid (NULL)\&. .RE .PP \fBEINTR\fR .RS 4 The operation was interrupted by delivery of a signal before any events were available\&. .RE .SH "EXAMPLE" .PP \fBPolling indefinitely for input events on both a 0MQ socket and a standard socket.\fR. .sp .if n \{\ .RS 4 .\} .nf zmq_pollitem_t items [2]; /* First item refers to 0MQ socket \*(Aqsocket\*(Aq */ items[0]\&.socket = socket; items[0]\&.events = ZMQ_POLLIN; /* Second item refers to standard socket \*(Aqfd\*(Aq */ items[1]\&.socket = NULL; items[1]\&.fd = fd; items[1]\&.events = ZMQ_POLLIN; /* Poll for events indefinitely */ int rc = zmq_poll (items, 2, \-1); assert (rc >= 0); /* Returned events will be stored in items[]\&.revents */ .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_socket\fR(3) \fBzmq_send\fR(3) \fBzmq_recv\fR(3) \fBzmq\fR(7) .sp Your operating system documentation for the \fIpoll()\fR system call\&. .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&. zeromq-4.2.5/doc/zmq_bind.html0000664000372000037200000005430713255253325017215 0ustar00travistravis00000000000000 zmq_bind(3)

SYNOPSIS

int zmq_bind (void *socket, const char *endpoint);

DESCRIPTION

The zmq_bind() function binds the socket to a local endpoint and then accepts incoming connections on that endpoint.

The endpoint is a string consisting of a transport:// followed by an address. The transport specifies the underlying protocol to use. The address specifies the transport-specific address to bind to.

ØMQ provides the the following transports:

tcp

unicast transport using TCP, see zmq_tcp(7)

ipc

local inter-process communication transport, see zmq_ipc(7)

inproc

local in-process (inter-thread) communication transport, see zmq_inproc(7)

pgm, epgm

reliable multicast transport using PGM, see zmq_pgm(7)

vmci

virtual machine communications interface (VMCI), see zmq_vmci(7)

Every ØMQ socket type except ZMQ_PAIR supports one-to-many and many-to-one semantics. The precise semantics depend on the socket type and are defined in zmq_socket(3).

The ipc, tcp and vmci transports accept wildcard addresses: see zmq_ipc(7), zmq_tcp(7) and zmq_vmci(7) for details.

Note
the address syntax may be different for zmq_bind() and zmq_connect() especially for the tcp, pgm and epgm transports.
Note
following a zmq_bind(), the socket enters a mute state unless or until at least one incoming or outgoing connection is made, at which point the socket enters a ready state. In the mute state, the socket blocks or drops messages according to the socket type, as defined in zmq_socket(3). By contrast, following a libzmq:zmq_connect[3], the socket enters the ready state.

RETURN VALUE

The zmq_bind() function returns zero if successful. Otherwise it returns -1 and sets errno to one of the values defined below.

ERRORS

EINVAL

The endpoint supplied is invalid.

EPROTONOSUPPORT

The requested transport protocol is not supported.

ENOCOMPATPROTO

The requested transport protocol is not compatible with the socket type.

EADDRINUSE

The requested address is already in use.

EADDRNOTAVAIL

The requested address was not local.

ENODEV

The requested address specifies a nonexistent interface.

ETERM

The ØMQ context associated with the specified socket was terminated.

ENOTSOCK

The provided socket was invalid.

EMTHREAD

No I/O thread is available to accomplish the task.

EXAMPLE

Binding a publisher socket to an in-process and a TCP transport
/* Create a ZMQ_PUB socket */
void *socket = zmq_socket (context, ZMQ_PUB);
assert (socket);
/* Bind it to a in-process transport with the address 'my_publisher' */
int rc = zmq_bind (socket, "inproc://my_publisher");
assert (rc == 0);
/* Bind it to a TCP transport on port 5555 of the 'eth0' interface */
rc = zmq_bind (socket, "tcp://eth0:5555");
assert (rc == 0);

AUTHORS

This page was written by the ØMQ community. To make a change please read the ØMQ Contribution Policy at http://www.zeromq.org/docs:contributing.


zeromq-4.2.5/doc/zmq_atomic_counter_dec.txt0000664000372000037200000000303113255253220021760 0ustar00travistravis00000000000000zmq_atomic_counter_dec(3) ========================= NAME ---- zmq_atomic_counter_dec - decrement an atomic counter SYNOPSIS -------- *int zmq_atomic_counter_dec (void *counter);* DESCRIPTION ----------- The _zmq_atomic_counter_dec_ function decrements an atomic counter in a threadsafe fashion. This function uses platform specific atomic operations. RETURN VALUE ------------ The _zmq_atomic_counter_dec()_ function returns 1 if the counter is greater than zero after decrementing, or zero if the counter reached zero. EXAMPLE ------- .Test code for atomic counters ---- void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; ---- SEE ALSO -------- linkzmq:zmq_atomic_counter_new[3] linkzmq:zmq_atomic_counter_set[3] linkzmq:zmq_atomic_counter_inc[3] linkzmq:zmq_atomic_counter_value[3] linkzmq:zmq_atomic_counter_destroy[3] AUTHORS ------- This page was written by the 0MQ community. To make a change please read the 0MQ Contribution Policy at . zeromq-4.2.5/aclocal.m40000664000372000037200000013523613255253271015620 0ustar00travistravis00000000000000# generated automatically by aclocal 1.14.1 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([config/libtool.m4]) m4_include([config/ltoptions.m4]) m4_include([config/ltsugar.m4]) m4_include([config/ltversion.m4]) m4_include([config/lt~obsolete.m4]) m4_include([acinclude.m4]) zeromq-4.2.5/Makefile.am0000664000372000037200000006732413255253220016010 0ustar00travistravis00000000000000ACLOCAL_AMFLAGS = -I config SUBDIRS = doc DIST_SUBDIRS = doc builds builds/msvc pkgconfig_DATA = src/libzmq.pc AM_CPPFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include # # libraries/binaries # lib_LTLIBRARIES = src/libzmq.la include_HEADERS = \ include/zmq.h \ include/zmq_utils.h src_libzmq_la_SOURCES = \ src/address.cpp \ src/address.hpp \ src/array.hpp \ src/atomic_counter.hpp \ src/atomic_ptr.hpp \ src/blob.hpp \ src/client.cpp \ src/client.hpp \ src/clock.cpp \ src/clock.hpp \ src/command.hpp \ src/condition_variable.hpp \ src/config.hpp \ src/ctx.cpp \ src/ctx.hpp \ src/curve_client.cpp \ src/curve_client.hpp \ src/curve_client_tools.hpp \ src/curve_mechanism_base.cpp \ src/curve_mechanism_base.hpp \ src/curve_server.cpp \ src/curve_server.hpp \ src/dbuffer.hpp \ src/dealer.cpp \ src/dealer.hpp \ src/decoder.hpp \ src/devpoll.cpp \ src/devpoll.hpp \ src/dgram.cpp \ src/dgram.hpp \ src/dish.cpp \ src/dish.hpp \ src/dist.cpp \ src/dist.hpp \ src/encoder.hpp \ src/epoll.cpp \ src/epoll.hpp \ src/err.cpp \ src/err.hpp \ src/fd.hpp \ src/fq.cpp \ src/fq.hpp \ src/gather.cpp \ src/gather.hpp \ src/generic_mtrie.hpp \ src/generic_mtrie_impl.hpp \ src/gssapi_mechanism_base.cpp \ src/gssapi_mechanism_base.hpp \ src/gssapi_client.cpp \ src/gssapi_client.hpp \ src/gssapi_server.cpp \ src/gssapi_server.hpp \ src/i_encoder.hpp \ src/i_engine.hpp \ src/i_decoder.hpp \ src/i_mailbox.hpp \ src/i_poll_events.hpp \ src/io_object.cpp \ src/io_object.hpp \ src/io_thread.cpp \ src/io_thread.hpp \ src/ip.cpp \ src/ip.hpp \ src/ipc_address.cpp \ src/ipc_address.hpp \ src/ipc_connecter.cpp \ src/ipc_connecter.hpp \ src/ipc_listener.cpp \ src/ipc_listener.hpp \ src/kqueue.cpp \ src/kqueue.hpp \ src/lb.cpp \ src/lb.hpp \ src/likely.hpp \ src/macros.hpp \ src/mailbox.cpp \ src/mailbox.hpp \ src/mailbox_safe.cpp \ src/mailbox_safe.hpp \ src/mechanism.cpp \ src/mechanism.hpp \ src/mechanism_base.cpp \ src/mechanism_base.hpp \ src/metadata.cpp \ src/metadata.hpp \ src/msg.cpp \ src/msg.hpp \ src/mtrie.cpp \ src/mtrie.hpp \ src/mutex.hpp \ src/norm_engine.cpp \ src/norm_engine.hpp \ src/null_mechanism.cpp \ src/null_mechanism.hpp \ src/object.cpp \ src/object.hpp \ src/options.cpp \ src/options.hpp \ src/own.cpp \ src/own.hpp \ src/pair.cpp \ src/pair.hpp \ src/pgm_receiver.cpp \ src/pgm_receiver.hpp \ src/pgm_sender.cpp \ src/pgm_sender.hpp \ src/pgm_socket.cpp \ src/pgm_socket.hpp \ src/pipe.cpp \ src/pipe.hpp \ src/plain_client.cpp \ src/plain_client.hpp \ src/plain_server.cpp \ src/plain_server.hpp \ src/platform.hpp \ src/poll.cpp \ src/poll.hpp \ src/poller.hpp \ src/poller_base.cpp \ src/poller_base.hpp \ src/pollset.cpp \ src/pollset.hpp \ src/precompiled.cpp \ src/precompiled.hpp \ src/proxy.cpp \ src/proxy.hpp \ src/pub.cpp \ src/pub.hpp \ src/pull.cpp \ src/pull.hpp \ src/push.cpp \ src/push.hpp \ src/radio.cpp \ src/radio.hpp \ src/random.cpp \ src/random.hpp \ src/raw_decoder.cpp \ src/raw_decoder.hpp \ src/raw_encoder.cpp \ src/raw_encoder.hpp \ src/reaper.cpp \ src/reaper.hpp \ src/rep.cpp \ src/rep.hpp \ src/req.cpp \ src/req.hpp \ src/router.cpp \ src/router.hpp \ src/scatter.cpp \ src/scatter.hpp \ src/select.cpp \ src/select.hpp \ src/server.cpp \ src/server.hpp \ src/session_base.cpp \ src/session_base.hpp \ src/signaler.cpp \ src/signaler.hpp \ src/socket_base.cpp \ src/socket_base.hpp \ src/socks.cpp \ src/socks.hpp \ src/socks_connecter.cpp \ src/socks_connecter.hpp \ src/stdint.hpp \ src/stream.cpp \ src/stream.hpp \ src/stream_engine.cpp \ src/stream_engine.hpp \ src/sub.cpp \ src/sub.hpp \ src/tcp.cpp \ src/tcp.hpp \ src/tcp_address.cpp \ src/tcp_address.hpp \ src/tcp_connecter.cpp \ src/tcp_connecter.hpp \ src/tcp_listener.cpp \ src/tcp_listener.hpp \ src/thread.cpp \ src/thread.hpp \ src/timers.cpp \ src/timers.hpp \ src/tipc_address.cpp \ src/tipc_address.hpp \ src/tipc_connecter.cpp \ src/tipc_connecter.hpp \ src/tipc_listener.cpp \ src/tipc_listener.hpp \ src/trie.cpp \ src/trie.hpp \ src/udp_address.cpp \ src/udp_address.hpp \ src/udp_engine.cpp \ src/udp_engine.hpp \ src/v1_decoder.cpp \ src/v1_decoder.hpp \ src/v2_decoder.cpp \ src/v2_decoder.hpp \ src/v1_encoder.cpp \ src/v1_encoder.hpp \ src/v2_encoder.cpp \ src/v2_encoder.hpp \ src/v2_protocol.hpp \ src/vmci.cpp \ src/vmci.hpp \ src/vmci_address.cpp \ src/vmci_address.hpp \ src/vmci_connecter.cpp \ src/vmci_connecter.hpp \ src/vmci_listener.cpp \ src/vmci_listener.hpp \ src/windows.hpp \ src/wire.hpp \ src/xpub.cpp \ src/xpub.hpp \ src/xsub.cpp \ src/xsub.hpp \ src/ypipe.hpp \ src/ypipe_base.hpp \ src/ypipe_conflate.hpp \ src/yqueue.hpp \ src/zmq.cpp \ src/zmq_utils.cpp \ src/decoder_allocators.cpp \ src/decoder_allocators.hpp \ src/socket_poller.cpp \ src/socket_poller.hpp \ src/zap_client.cpp \ src/zap_client.hpp \ src/zmq_draft.h if USE_TWEETNACL src_libzmq_la_SOURCES += \ src/tweetnacl.c \ src/tweetnacl.h endif if ON_MINGW src_libzmq_la_LDFLAGS = \ -no-undefined \ -avoid-version \ -version-info @LTVER@ \ @LIBZMQ_EXTRA_LDFLAGS@ else if ON_CYGWIN src_libzmq_la_LDFLAGS = \ -no-undefined \ -avoid-version \ -version-info @LTVER@ \ @LIBZMQ_EXTRA_LDFLAGS@ else if ON_ANDROID src_libzmq_la_LDFLAGS = \ -avoid-version \ -version-info @LTVER@ \ @LIBZMQ_EXTRA_LDFLAGS@ else if ON_LINUX src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ @LIBZMQ_EXTRA_LDFLAGS@ \ -Wl,--version-script=$(srcdir)/src/libzmq.vers else src_libzmq_la_LDFLAGS = \ -version-info @LTVER@ \ @LIBZMQ_EXTRA_LDFLAGS@ \ -Wl endif endif endif endif src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \ $(LIBUNWIND_CFLAGS) src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS) if USE_LIBSODIUM src_libzmq_la_CPPFLAGS += ${sodium_CFLAGS} src_libzmq_la_LIBADD += ${sodium_LIBS} endif if HAVE_PGM src_libzmq_la_CPPFLAGS += ${pgm_CFLAGS} src_libzmq_la_LIBADD += ${pgm_LIBS} endif if HAVE_NORM src_libzmq_la_CPPFLAGS += ${norm_CFLAGS} src_libzmq_la_LIBADD += ${norm_LIBS} endif if BUILD_GSSAPI src_libzmq_la_CPPFLAGS += ${gssapi_krb5_CFLAGS} src_libzmq_la_LIBADD += ${gssapi_krb5_LIBS} endif if ENABLE_PERF noinst_PROGRAMS = \ perf/local_lat \ perf/remote_lat \ perf/local_thr \ perf/remote_thr \ perf/inproc_lat \ perf/inproc_thr perf_local_lat_LDADD = src/libzmq.la perf_local_lat_SOURCES = perf/local_lat.cpp perf_remote_lat_LDADD = src/libzmq.la perf_remote_lat_SOURCES = perf/remote_lat.cpp perf_local_thr_LDADD = src/libzmq.la perf_local_thr_SOURCES = perf/local_thr.cpp perf_remote_thr_LDADD = src/libzmq.la perf_remote_thr_SOURCES = perf/remote_thr.cpp perf_inproc_lat_LDADD = src/libzmq.la perf_inproc_lat_SOURCES = perf/inproc_lat.cpp perf_inproc_thr_LDADD = src/libzmq.la perf_inproc_thr_SOURCES = perf/inproc_thr.cpp endif if ENABLE_CURVE_KEYGEN bin_PROGRAMS = tools/curve_keygen tools_curve_keygen_LDADD = src/libzmq.la tools_curve_keygen_SOURCES = tools/curve_keygen.cpp endif # # tests # test_apps = \ tests/test_ancillaries \ tests/test_system \ tests/test_pair_inproc \ tests/test_pair_tcp \ tests/test_reqrep_inproc \ tests/test_reqrep_tcp \ tests/test_hwm \ tests/test_hwm_pubsub \ tests/test_reqrep_device \ tests/test_sub_forward \ tests/test_invalid_rep \ tests/test_msg_flags \ tests/test_msg_ffn \ tests/test_connect_resolve \ tests/test_immediate \ tests/test_last_endpoint \ tests/test_term_endpoint \ tests/test_srcfd \ tests/test_monitor \ tests/test_router_mandatory \ tests/test_router_mandatory_hwm \ tests/test_router_handover \ tests/test_probe_router \ tests/test_stream \ tests/test_stream_empty \ tests/test_stream_disconnect \ tests/test_stream_timeout \ tests/test_disconnect_inproc \ tests/test_unbind_inproc \ tests/test_unbind_wildcard \ tests/test_ctx_options \ tests/test_ctx_destroy \ tests/test_security_null \ tests/test_security_plain \ tests/test_security_zap \ tests/test_iov \ tests/test_spec_req \ tests/test_spec_rep \ tests/test_spec_dealer \ tests/test_spec_router \ tests/test_spec_pushpull \ tests/test_req_correlate \ tests/test_req_relaxed \ tests/test_conflate \ tests/test_inproc_connect \ tests/test_issue_566 \ tests/test_proxy \ tests/test_proxy_single_socket \ tests/test_proxy_terminate \ tests/test_getsockopt_memset \ tests/test_setsockopt \ tests/test_diffserv \ tests/test_connect_rid \ tests/test_bind_src_address \ tests/test_metadata \ tests/test_capabilities \ tests/test_xpub_nodrop \ tests/test_xpub_manual \ tests/test_xpub_welcome_msg \ tests/test_xpub_verbose \ tests/test_atomics \ tests/test_sockopt_hwm \ tests/test_heartbeats \ tests/test_stream_exceeds_buffer \ tests/test_pub_invert_matching \ tests/test_base85 \ tests/test_bind_after_connect_tcp \ tests/test_sodium \ tests/test_reconnect_ivl \ tests/test_socket_null UNITY_CPPFLAGS = -I$(top_srcdir)/external/unity -DUNITY_USE_COMMAND_LINE_ARGS -DUNITY_EXCLUDE_FLOAT UNITY_LIBS = $(top_builddir)/external/unity/libunity.a noinst_LIBRARIES = external/unity/libunity.a external_unity_libunity_a_SOURCES = external/unity/unity.c \ external/unity/unity.h \ external/unity/unity_internals.h tests_test_ancillaries_SOURCES = tests/test_ancillaries.cpp tests_test_ancillaries_LDADD = src/libzmq.la tests_test_system_SOURCES = tests/test_system.cpp tests_test_system_LDADD = src/libzmq.la tests_test_pair_inproc_SOURCES = \ tests/test_pair_inproc.cpp \ tests/testutil.hpp tests_test_pair_inproc_LDADD = src/libzmq.la tests_test_pair_tcp_SOURCES = \ tests/test_pair_tcp.cpp \ tests/testutil.hpp tests_test_pair_tcp_LDADD = src/libzmq.la tests_test_reqrep_inproc_SOURCES = \ tests/test_reqrep_inproc.cpp \ tests/testutil.hpp tests_test_reqrep_inproc_LDADD = src/libzmq.la tests_test_reqrep_tcp_SOURCES = \ tests/test_reqrep_tcp.cpp \ tests/testutil.hpp tests_test_reqrep_tcp_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_reqrep_tcp_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_hwm_SOURCES = tests/test_hwm.cpp tests/testutil_unity.hpp tests_test_hwm_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_hwm_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_hwm_pubsub_SOURCES = tests/test_hwm_pubsub.cpp tests_test_hwm_pubsub_LDADD = src/libzmq.la tests_test_reqrep_device_SOURCES = tests/test_reqrep_device.cpp tests_test_reqrep_device_LDADD = src/libzmq.la tests_test_sub_forward_SOURCES = tests/test_sub_forward.cpp tests_test_sub_forward_LDADD = src/libzmq.la tests_test_invalid_rep_SOURCES = tests/test_invalid_rep.cpp tests_test_invalid_rep_LDADD = src/libzmq.la tests_test_msg_flags_SOURCES = tests/test_msg_flags.cpp tests_test_msg_flags_LDADD = src/libzmq.la tests_test_msg_ffn_SOURCES = tests/test_msg_ffn.cpp tests_test_msg_ffn_LDADD = src/libzmq.la tests_test_connect_resolve_SOURCES = tests/test_connect_resolve.cpp tests_test_connect_resolve_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_connect_resolve_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_immediate_SOURCES = tests/test_immediate.cpp tests_test_immediate_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_immediate_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_last_endpoint_SOURCES = tests/test_last_endpoint.cpp tests_test_last_endpoint_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_last_endpoint_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_term_endpoint_SOURCES = tests/test_term_endpoint.cpp tests_test_term_endpoint_LDADD = src/libzmq.la tests_test_srcfd_SOURCES = tests/test_srcfd.cpp tests_test_srcfd_LDADD = src/libzmq.la tests_test_monitor_SOURCES = tests/test_monitor.cpp tests_test_monitor_LDADD = src/libzmq.la tests_test_router_mandatory_SOURCES = tests/test_router_mandatory.cpp tests/testutil_unity.hpp tests_test_router_mandatory_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_router_mandatory_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_router_mandatory_hwm_SOURCES = tests/test_router_mandatory_hwm.cpp tests_test_router_mandatory_hwm_LDADD = src/libzmq.la tests_test_router_handover_SOURCES = tests/test_router_handover.cpp tests_test_router_handover_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_router_handover_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_probe_router_SOURCES = tests/test_probe_router.cpp tests_test_probe_router_LDADD = src/libzmq.la tests_test_stream_SOURCES = tests/test_stream.cpp tests_test_stream_LDADD = src/libzmq.la tests_test_stream_empty_SOURCES = tests/test_stream_empty.cpp tests_test_stream_empty_LDADD = src/libzmq.la tests_test_stream_timeout_SOURCES = tests/test_stream_timeout.cpp tests_test_stream_timeout_LDADD = src/libzmq.la tests_test_stream_disconnect_SOURCES = tests/test_stream_disconnect.cpp tests_test_stream_disconnect_LDADD = src/libzmq.la tests_test_disconnect_inproc_SOURCES = tests/test_disconnect_inproc.cpp tests_test_disconnect_inproc_LDADD = src/libzmq.la tests_test_unbind_inproc_SOURCES = tests/test_unbind_inproc.cpp tests_test_unbind_inproc_LDADD = src/libzmq.la tests_test_unbind_wildcard_SOURCES = tests/test_unbind_wildcard.cpp tests_test_unbind_wildcard_LDADD = src/libzmq.la tests_test_ctx_options_SOURCES = tests/test_ctx_options.cpp tests_test_ctx_options_LDADD = src/libzmq.la tests_test_iov_SOURCES = tests/test_iov.cpp tests_test_iov_LDADD = src/libzmq.la tests_test_ctx_destroy_SOURCES = tests/test_ctx_destroy.cpp tests_test_ctx_destroy_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_ctx_destroy_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_security_null_SOURCES = tests/test_security_null.cpp tests_test_security_null_LDADD = src/libzmq.la tests_test_security_plain_SOURCES = tests/test_security_plain.cpp tests_test_security_plain_LDADD = src/libzmq.la tests_test_security_zap_SOURCES = \ tests/test_security_zap.cpp \ tests/testutil_security.hpp \ tests/testutil.hpp tests_test_security_zap_LDADD = src/libzmq.la tests_test_spec_req_SOURCES = tests/test_spec_req.cpp tests_test_spec_req_LDADD = src/libzmq.la tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp tests_test_spec_rep_LDADD = src/libzmq.la tests_test_spec_dealer_SOURCES = tests/test_spec_dealer.cpp tests_test_spec_dealer_LDADD = src/libzmq.la tests_test_spec_router_SOURCES = tests/test_spec_router.cpp tests_test_spec_router_LDADD = src/libzmq.la tests_test_spec_pushpull_SOURCES = tests/test_spec_pushpull.cpp tests_test_spec_pushpull_LDADD = src/libzmq.la tests_test_req_correlate_SOURCES = tests/test_req_correlate.cpp tests_test_req_correlate_LDADD = src/libzmq.la tests_test_req_relaxed_SOURCES = tests/test_req_relaxed.cpp tests_test_req_relaxed_LDADD = src/libzmq.la tests_test_conflate_SOURCES = tests/test_conflate.cpp tests_test_conflate_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_conflate_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_inproc_connect_SOURCES = tests/test_inproc_connect.cpp tests_test_inproc_connect_LDADD = src/libzmq.la tests_test_issue_566_SOURCES = tests/test_issue_566.cpp tests_test_issue_566_LDADD = src/libzmq.la tests_test_proxy_SOURCES = tests/test_proxy.cpp tests_test_proxy_LDADD = src/libzmq.la tests_test_proxy_single_socket_SOURCES = tests/test_proxy_single_socket.cpp tests_test_proxy_single_socket_LDADD = src/libzmq.la tests_test_proxy_terminate_SOURCES = tests/test_proxy_terminate.cpp tests_test_proxy_terminate_LDADD = src/libzmq.la tests_test_getsockopt_memset_SOURCES = tests/test_getsockopt_memset.cpp tests_test_getsockopt_memset_LDADD = src/libzmq.la tests_test_many_sockets_SOURCES = tests/test_many_sockets.cpp tests_test_many_sockets_LDADD = src/libzmq.la tests_test_diffserv_SOURCES = tests/test_diffserv.cpp tests_test_diffserv_LDADD = src/libzmq.la tests_test_connect_rid_SOURCES = tests/test_connect_rid.cpp tests_test_connect_rid_LDADD = src/libzmq.la tests_test_bind_src_address_SOURCES = tests/test_bind_src_address.cpp tests_test_bind_src_address_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_bind_src_address_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_metadata_SOURCES = tests/test_metadata.cpp tests_test_metadata_LDADD = src/libzmq.la tests_test_capabilities_SOURCES = tests/test_capabilities.cpp tests_test_capabilities_LDADD = src/libzmq.la tests_test_xpub_nodrop_SOURCES = tests/test_xpub_nodrop.cpp tests_test_xpub_nodrop_LDADD = src/libzmq.la tests_test_xpub_manual_SOURCES = tests/test_xpub_manual.cpp tests_test_xpub_manual_LDADD = src/libzmq.la tests_test_xpub_welcome_msg_SOURCES = tests/test_xpub_welcome_msg.cpp tests_test_xpub_welcome_msg_LDADD = src/libzmq.la tests_test_xpub_verbose_SOURCES = tests/test_xpub_verbose.cpp tests_test_xpub_verbose_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_xpub_verbose_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_atomics_SOURCES = tests/test_atomics.cpp tests_test_atomics_LDADD = src/libzmq.la tests_test_sockopt_hwm_SOURCES = tests/test_sockopt_hwm.cpp tests_test_sockopt_hwm_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_sockopt_hwm_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_setsockopt_SOURCES = tests/test_setsockopt.cpp tests_test_setsockopt_LDADD = src/libzmq.la tests_test_heartbeats_SOURCES = tests/test_heartbeats.cpp tests_test_heartbeats_LDADD = src/libzmq.la tests_test_stream_exceeds_buffer_SOURCES = tests/test_stream_exceeds_buffer.cpp tests_test_stream_exceeds_buffer_LDADD = src/libzmq.la tests_test_pub_invert_matching_SOURCES = tests/test_pub_invert_matching.cpp tests_test_pub_invert_matching_LDADD = src/libzmq.la tests_test_bind_after_connect_tcp_SOURCES = tests/test_bind_after_connect_tcp.cpp tests_test_bind_after_connect_tcp_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_bind_after_connect_tcp_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_base85_SOURCES = tests/test_base85.cpp tests_test_base85_LDADD = src/libzmq.la tests_test_sodium_SOURCES = tests/test_sodium.cpp tests_test_sodium_LDADD = src/libzmq.la tests_test_socket_null_SOURCES = tests/test_socket_null.cpp tests_test_socket_null_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_socket_null_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_reconnect_ivl_SOURCES = tests/test_reconnect_ivl.cpp tests_test_reconnect_ivl_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_reconnect_ivl_CPPFLAGS = ${UNITY_CPPFLAGS} if HAVE_CURVE test_apps += \ tests/test_security_curve tests_test_security_curve_SOURCES = \ tests/test_security_curve.cpp \ tests/testutil_security.hpp \ tests/testutil.hpp \ src/curve_client_tools.hpp \ src/clock.hpp \ src/clock.cpp \ src/random.hpp \ src/random.cpp \ src/err.hpp \ src/err.cpp if USE_TWEETNACL tests_test_security_curve_SOURCES += \ src/tweetnacl.c endif tests_test_security_curve_LDADD = \ src/libzmq.la ${UNITY_LIBS} $(LIBUNWIND_LIBS) tests_test_security_curve_CPPFLAGS = \ ${UNITY_CPPFLAGS} \ ${LIBUNWIND_CFLAGS} if USE_LIBSODIUM tests_test_security_curve_CPPFLAGS += \ ${sodium_CFLAGS} tests_test_security_curve_LDADD += \ ${sodium_LIBS} endif endif if !ON_MINGW if !ON_CYGWIN test_apps += \ tests/test_shutdown_stress \ tests/test_ipc_wildcard \ tests/test_pair_ipc \ tests/test_rebind_ipc \ tests/test_reqrep_ipc \ tests/test_use_fd_ipc \ tests/test_use_fd_tcp \ tests/test_zmq_poll_fd \ tests/test_timeo \ tests/test_filter_ipc tests_test_shutdown_stress_SOURCES = tests/test_shutdown_stress.cpp tests_test_shutdown_stress_LDADD = src/libzmq.la tests_test_ipc_wildcard_SOURCES = tests/test_ipc_wildcard.cpp tests_test_ipc_wildcard_LDADD = src/libzmq.la tests_test_pair_ipc_SOURCES = \ tests/test_pair_ipc.cpp \ tests/testutil.hpp tests_test_pair_ipc_LDADD = src/libzmq.la tests_test_rebind_ipc_SOURCES = tests/test_rebind_ipc.cpp tests_test_rebind_ipc_LDADD = src/libzmq.la tests_test_reqrep_ipc_SOURCES = \ tests/test_reqrep_ipc.cpp \ tests/testutil.hpp tests_test_reqrep_ipc_LDADD = src/libzmq.la tests_test_timeo_SOURCES = tests/test_timeo.cpp tests_test_timeo_LDADD = src/libzmq.la tests_test_filter_ipc_SOURCES = tests/test_filter_ipc.cpp tests_test_filter_ipc_LDADD = src/libzmq.la tests_test_use_fd_ipc_SOURCES = \ tests/test_use_fd_ipc.cpp \ tests/testutil.hpp tests_test_use_fd_ipc_LDADD = src/libzmq.la tests_test_use_fd_tcp_SOURCES = \ tests/test_use_fd_tcp.cpp \ tests/testutil.hpp tests_test_use_fd_tcp_LDADD = src/libzmq.la tests_test_zmq_poll_fd_SOURCES = tests/test_zmq_poll_fd.cpp tests_test_zmq_poll_fd_LDADD = src/libzmq.la if HAVE_FORK if !VALGRIND_ENABLED test_apps += tests/test_fork tests_test_fork_SOURCES = tests/test_fork.cpp tests_test_fork_LDADD = src/libzmq.la endif endif endif endif if BUILD_TIPC test_apps += \ tests/test_connect_delay_tipc \ tests/test_pair_tipc \ tests/test_reqrep_device_tipc \ tests/test_reqrep_tipc \ tests/test_router_mandatory_tipc \ tests/test_shutdown_stress_tipc \ tests/test_sub_forward_tipc \ tests/test_term_endpoint_tipc \ tests/test_address_tipc tests_test_connect_delay_tipc_SOURCES = tests/test_connect_delay_tipc.cpp tests_test_connect_delay_tipc_LDADD = src/libzmq.la tests_test_pair_tipc_SOURCES = tests/test_pair_tipc.cpp tests_test_pair_tipc_LDADD = src/libzmq.la tests_test_reqrep_device_tipc_SOURCES = tests/test_reqrep_device_tipc.cpp tests_test_reqrep_device_tipc_LDADD = src/libzmq.la tests_test_reqrep_tipc_SOURCES = tests/test_reqrep_tipc.cpp tests_test_reqrep_tipc_LDADD = src/libzmq.la tests_test_router_mandatory_tipc_SOURCES = tests/test_router_mandatory_tipc.cpp tests_test_router_mandatory_tipc_LDADD = src/libzmq.la tests_test_shutdown_stress_tipc_SOURCES = tests/test_shutdown_stress_tipc.cpp tests_test_shutdown_stress_tipc_LDADD = src/libzmq.la tests_test_sub_forward_tipc_SOURCES = tests/test_sub_forward_tipc.cpp tests_test_sub_forward_tipc_LDADD = src/libzmq.la tests_test_term_endpoint_tipc_SOURCES = tests/test_term_endpoint_tipc.cpp tests_test_term_endpoint_tipc_LDADD = src/libzmq.la tests_test_address_tipc_SOURCES = tests/test_address_tipc.cpp tests_test_address_tipc_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_address_tipc_CPPFLAGS = ${UNITY_CPPFLAGS} endif if BUILD_GSSAPI test_apps += tests/test_security_gssapi tests_test_security_gssapi_SOURCES = tests/test_security_gssapi.cpp tests_test_security_gssapi_LDADD = src/libzmq.la endif if ON_LINUX test_apps += tests/test_abstract_ipc \ tests/test_many_sockets tests_test_abstract_ipc_SOURCES = tests/test_abstract_ipc.cpp tests_test_abstract_ipc_LDADD = src/libzmq.la endif if HAVE_VMCI test_apps += test_pair_vmci test_reqrep_vmci test_pair_vmci_SOURCES = tests/test_pair_vmci.cpp test_pair_vmci_LDADD = libzmq.la test_pair_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ test_pair_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ test_reqrep_vmci_SOURCES = tests/test_reqrep_vmci.cpp test_reqrep_vmci_LDADD = libzmq.la test_reqrep_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ test_reqrep_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ endif if ENABLE_DRAFTS test_apps += tests/test_poller \ tests/test_client_server \ tests/test_thread_safe \ tests/test_timers \ tests/test_radio_dish \ tests/test_scatter_gather \ tests/test_dgram \ tests/test_app_meta tests_test_poller_SOURCES = tests/test_poller.cpp tests_test_poller_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_poller_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_client_server_SOURCES = tests/test_client_server.cpp tests_test_client_server_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_client_server_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_thread_safe_SOURCES = tests/test_thread_safe.cpp tests_test_thread_safe_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_thread_safe_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_timers_SOURCES = tests/test_timers.cpp tests_test_timers_LDADD = src/libzmq.la tests_test_radio_dish_SOURCES = tests/test_radio_dish.cpp tests_test_radio_dish_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_radio_dish_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_scatter_gather_SOURCES = tests/test_scatter_gather.cpp tests_test_scatter_gather_LDADD = src/libzmq.la tests_test_dgram_SOURCES = tests/test_dgram.cpp tests_test_dgram_LDADD = src/libzmq.la tests_test_app_meta_SOURCES = tests/test_app_meta.cpp tests_test_app_meta_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_app_meta_CPPFLAGS = ${UNITY_CPPFLAGS} endif if ENABLE_STATIC # unit tests - these include individual source files and test the internal functions test_apps += \ unittests/unittest_poller \ unittests/unittest_ypipe \ unittests/unittest_mtrie unittests_unittest_poller_SOURCES = unittests/unittest_poller.cpp unittests_unittest_poller_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) unittests_unittest_poller_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) unittests_unittest_poller_LDADD = $(top_builddir)/src/.libs/libzmq.a \ ${src_libzmq_la_LIBADD} \ ${UNITY_LIBS} \ $(CODE_COVERAGE_LDFLAGS) unittests_unittest_ypipe_SOURCES = unittests/unittest_ypipe.cpp unittests_unittest_ypipe_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) unittests_unittest_ypipe_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) unittests_unittest_ypipe_LDADD = $(top_builddir)/src/.libs/libzmq.a \ ${src_libzmq_la_LIBADD} \ ${UNITY_LIBS} \ $(CODE_COVERAGE_LDFLAGS) unittests_unittest_mtrie_SOURCES = unittests/unittest_mtrie.cpp unittests_unittest_mtrie_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) unittests_unittest_mtrie_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) unittests_unittest_mtrie_LDADD = $(top_builddir)/src/.libs/libzmq.a \ ${src_libzmq_la_LIBADD} \ ${UNITY_LIBS} \ $(CODE_COVERAGE_LDFLAGS) endif check_PROGRAMS = ${test_apps} # Run the test cases TESTS = $(test_apps) XFAIL_TESTS = if !ON_LINUX XFAIL_TESTS += tests/test_abstract_ipc endif if ON_GNU XFAIL_TESTS += test_ipc_wildcard \ test_term_endpoint endif EXTRA_DIST = \ external/unity/license.txt \ external/unity/version.txt \ CMakeLists.txt \ autogen.sh \ version.sh \ src/libzmq.pc.cmake.in \ src/libzmq.vers \ src/version.rc.in \ tests/CMakeLists.txt \ unittests/CMakeLists.txt \ tools/curve_keygen.cpp MAINTAINERCLEANFILES = \ $(srcdir)/aclocal.m4 \ $(srcdir)/autom4te.cache \ $(srcdir)/configure \ `find "$(srcdir)" -type f -name Makefile.in -print` if WITH_CLANG_FORMAT ALL_SOURCE_FILES = $(wildcard \ $(top_srcdir)/src/*.c \ $(top_srcdir)/src/*.cc \ $(top_srcdir)/src/*.cpp \ $(top_srcdir)/src/*.h \ $(top_srcdir)/src/*.hpp \ $(top_srcdir)/tests/*.c \ $(top_srcdir)/tests/*.cc \ $(top_srcdir)/tests/*.cpp \ $(top_srcdir)/tests/*.h \ $(top_srcdir)/tests/*.hpp \ $(top_srcdir)/perf/*.c \ $(top_srcdir)/perf/*.cc \ $(top_srcdir)/perf/*.cpp \ $(top_srcdir)/perf/*.h \ $(top_srcdir)/perf/*.hpp \ $(top_srcdir)/tools/*.c \ $(top_srcdir)/tools/*.cc \ $(top_srcdir)/tools/*.cpp \ $(top_srcdir)/tools/*.h \ $(top_srcdir)/tools/*.hpp \ $(top_srcdir)/include/*.h \ ) # Check if any sources need to be fixed, report the filenames and an error code clang-format-check: $(ALL_SOURCE_FILES) @FAILED=0 ; IFS=";" ; IDS="`printf '\n\b'`" ; export IFS IDS; \ for FILE in $(ALL_SOURCE_FILES) ; do \ test -s $$FILE || continue ; \ $(CLANG_FORMAT) -style=file -output-replacements-xml "$$FILE" | grep "/dev/null && \ { echo "$$FILE is not correctly formatted" >&2 ; FAILED=1; } ; \ done; \ if test "$$FAILED" != 0 ; then \ exit 1 ; \ fi # Change source formatting clang-format: $(ALL_SOURCE_FILES) $(CLANG_FORMAT) -style=file -i $(ALL_SOURCE_FILES) # Change source formatting AND report the diff clang-format-diff: clang-format git diff $(ALL_SOURCE_FILES) else clang-format clang-format-check clang-format-diff: @echo "Install the clang-format program, reconfigure and re-run this request" @exit 1 endif @CODE_COVERAGE_RULES@ dist-hook: -rm $(distdir)/src/platform.hpp @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generated by Makefile. Do not edit.'; echo; \ $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi maintainer-clean-local: -rm -rf $(top_srcdir)/config @VALGRIND_CHECK_RULES@ VALGRIND_SUPPRESSIONS_FILES = builds/valgrind/valgrind.supp zeromq-4.2.5/NEWS0000664000372000037200000015600313255253220014444 0ustar00travistravis000000000000000MQ version 4.2.5 stable, released on 2018/03/23 ================================================ * Fixed #3018 - fix backward-incompatible change in the NULL auth mechanism that slipped in 4.2.3 and made connections with a ZAP domain set on a socket but without a working ZAP handler fail. See ZMQ_ZAP_ENFORCE_DOMAIN and RFC27. * Fixed #3016 - clarify in zmq_close manpage that the operation will complete asynchronously. * Fixed #3012 - fix CMake build problem when using LIBZMQ_WERROR and a compiler other than GCC. 0MQ version 4.2.4 stable, released on 2018/03/21 ================================================ * New DRAFT (see NEWS for 4.2.0) socket options: - ZMQ_LOOPBACK_FASTPATH to enable faster TCP loopback on Windows - ZMQ_METADATA to set application-specific metadata on a socket See doc/zmq_setsockopt.txt and doc/zmq_getsockopt.txt for details. * New DRAFT (see NEWS for 4.2.0) context options: - ZMQ_ZERO_COPY_RECV to disable zero-copy receive to save memory at the expense of slower performance See doc/zmq_ctx_set.txt and doc/zmq_ctx_get.txt for details. * New DRAFT API zmq_stopwatch_intermediate which returns the time elapsed without stopping the stopwatch. * TIPC: support addressing TIPC Port Identity addresses. * Added CMake option to disable tests: BUILD_TESTS * Added CMake and autotools make targets to support clang-formatter: make clang-format, clang-format-check and clang-format-diff to help developers make sure their code conforms to the style guidelines * For distributors: a new test framework has been added, which includes a copy of the Unity source code. This source code library is distributed under the MIT license and thus is compatible with libzmq's LGPL3. * Fixed #2867 - add ZeroMQConfig.cmake.in to distributable tarball * Fixed #2868 - fix OpenBSD build * Fixed #2870 - fix VC++ 11.0 (VS2012) build * Fixed #2879 - prevent duplicate connections on PUB sockets * Fixed #2872 - fix CMake tests on Windows * Fixed #2895 - fix assert on Windows with POLL * Fixed #2920 - fix Windows build with Intel compiler * Fixed #2930 - use std::atomic when available with VC++ and VS2015 * Fixed #2910 - fix race condition with ZMQ_LINGER socket option * Fixed #2927 - add support for ZMQ_XPUB_NODROP on ZMQ_RADIO * Fixed #2820 - further clarify ZMQ_XPUB_VERBOSE(R) documentation. * Fixed #2911 - ZMQ_DISH over UDP triggers errno_assert() after hitting watermark * Fixed #2942 - ZMQ_PUB crash when due to high volume of subscribe and unsubscribe messages, an unmatched unsubscribe message is received in certain conditions * Fixed #2946 - fix Windows CMake build when BUILD_SHARED is off * Fixed #2960 - fix build with GCC 8 * Fixed #2967 - fix race condition on thread safe sockets due to pthread condvar timeouts on OSX * Fixed #2977 - fix TIPC build-time availability check to be more relaxed * Fixed #2966 - add support for WindRiver VxWorks 6.x * Fixed #2963 - fix some PVS Studio static analysis warnings * Fixed #2983 - fix MinGW cross-compilation * Fixed #2991 - fix mutex assert at shutdown when the zmq context is part of a class declared as a global static 0MQ version 4.2.3 stable, released on 2017/12/13 ================================================ * API change: previously ZMQ_POLLOUT on a ZMQ_ROUTER socket returned always true due to how the type works. When ZMQ_ROUTER_MANDATORY is set, sending fails when the peer is not available, but ZMQ_POLLOUT always returns true anyway, which does not make sense. Now when ZMQ_ROUTER_MANDATORY is set, ZMQ_POLLOUT on a ZMQ_ROUTER will return true only if at least one peer is available. Given ZMQ_POLLOUT with ZMQ_ROUTER was not usable at all previously, we do not consider this a breakage warranting a major or minor version increase. * ZMQ_IDENTITY has been renamed to ZMQ_ROUTING_ID and ZMQ_CONNECT_RID has been renamed to ZMQ_CONNTECT_ROUTING_ID to disambiguate. ZMQ_IDENTITY and ZMQ_CONNECT_RID are still available to keep backward compatibility, and will be removed in a future release after further advance notice. * DRAFT API change: zmq_poller_wait, zmq_poller_wait_all and zmq_poller_poll have been changed to be inline with other existing APIs that have a timeout to return EAGAIN instead of ETIMEDOUT as the errno value. See #2713 for details. * Existing non-DRAFT socket types ZMQ_REP/REQ, ZMQ_ROUTER/DEALER and ZMQPUB/SUB, that were previously declared deprecated, have been reinstated as stable and supported. See #2699 for details. * Tweetnacl: add support for, and use preferably if available, getrandom() as a simpler and less error-prone alternative to /dev/urandom on OSes where it is available (eg: Linux 3.18 with glibc 2.25). * Curve: all remaining traces of debug output to console are now removed, and new DRAFT events are available to properly debug CURVE, PLAIN, GSSAPI and ZAP events and failures. See below for details on the new events. * New DRAFT (see NEWS for 4.2.0) socket options: - ZMQ_GSSAPI_PRINCIPAL_NAMETYPE and ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE, for the corresponding GSSAPI features. Additional definitions for principal name types: - ZMQ_GSSAPI_NT_HOSTBASED - ZMQ_GSSAPI_NT_USER_NAME - ZMQ_GSSAPI_NT_KRB5_PRINCIPAL See doc/zmq_gssapi.txt for details. - ZMQ_BINDTODEVICE (Linux only), which will bind the socket(s) to the specified interface. Allows to use Linux VRF, see: https://www.kernel.org/doc/Documentation/networking/vrf.txt NOTE: requires the program to be ran as root OR with CAP_NET_RAW - ZMQ_ZAP_ENFORCE_DOMAIN, enables strict RFC 27 compatibility mode and makes the ZAP Domain mandatory when using security. See: https://rfc.zeromq.org/spec:27/ZAP See doc/zmq_setsockopt.txt and doc/zmq_getsockopt.txt for details. * New DRAFT (see NEWS for 4.2.0) context options: - ZMQ_THREAD_AFFINITY_CPU_ADD and ZMQ_THREAD_AFFINITY_CPU_REMOVE (Posix only), to add and remove CPUs to the affinity set of the I/O threads. Useful to pin the background threads to specific CPUs. - ZMQ_THREAD_NAME_PREFIX (Posix only), to add a specific integer prefix to the background threads names, to easily identify them for debugging purposes. See doc/zmq_ctx_set.txt and doc/zmq_ctx_get.txt for details. * New DRAFT (see NEWS for 4.2.0) message property name definitions to facilitate the use of zmq_msg_gets: - ZMQ_MSG_PROPERTY_ROUTING_ID - ZMQ_MSG_PROPERTY_SOCKET_TYPE - ZMQ_MSG_PROPERTY_USER_ID - ZMQ_MSG_PROPERTY_PEER_ADDRESS See doc/zmq_msg_gets.txt for details. * New DRAFT (see NEWS for 4.2.0) API zmq_socket_get_peer_state, to be used to query the state of a specific peer (via routing-id) of a ZMQ_ROUTER socket. * New DRAFT (see NEWS for 4.2.0) Socket Monitor events: - ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL, unknown system error and returns errno - ZMQ_EVENT_HANDSHAKE_SUCCEEDED, handshake was successful - ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, protocol errors between peers or server and ZAP handler. Returns one of ZMQ_PROTOCOL_ERROR_* - see manpage for list - ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, failed authentication, returns ZAP status These events trigger when the ZMTP security mechanism handshake is completed or failed. See doc/zmq_socket_monitor.txt for more information. * New DRAFT (see NEWS for 4.2.0) zmq_proxy_steerable command 'STATISTICS' to retrieve stats about the amount of messages and bytes sent and received by the proxy. See doc/zmq_proxy_steerable.txt for more information. * Add new autoconf --disable-libunwind option to stop building with libunwind even if it is available. * Add new autoconf --disable-Werror option to avoid building with the Werror flag. * Use pkg-config as the first method for finding and building with external optional dependencies such as libnorm, libpgm and gssapi. * On Posix platform where the feature is available, name the ZMQ background threads to simplify debugging: "ZMQbg/" * Improve performance of zmq_poller_* (and zmq_poll and zmq_proxy when building with DRAFT APIs enabled). * The TCP unit tests have been refactored to bind and connect to random ports rather than hard-coded ones, to allow running tests in parallel. There are 6 exceptions where it is necessary to use an hard-coded port to test specific code paths that would not be exercised when binding to a wildcard port. These are listed in tests/testutil.hpp so that distributions can easily patch them if they wish to and so that they can be unique across all the tests, allowing parallel runs. The IPC unit tests have been changed as well to use unique socket file names per test, where before there were some clashes. * Fixed #2349 - fix building with libsodium when using CMake * Fixed #2334 - do not assert when tuning socket options fails due to network errors, but simply retry again when connecting or send a socket monitor ZMQ_EVENT_ACCEPT_FAILED event when binding * Fixed #2341 - fix source files path in VS2015 solution * Fixed #2344 - Note that on Windows with VS2012 it is mandatory to increase the default stack size to at least 2MB * Fixed #2348 - ZMQ_ROUTER send with ZMQ_ROUTER_MANDATORY can be stuck in case of network problem * Fixed #2358 - occasional abort on zmq_connect on Windows * Fixed #2370 - zmq_curve_keypair should return an error on failure rather than ignoring them and always returning 0 * Fixed #2452 - __STDC_LIMIT_MACROS before precompiled headers causes VC++ warning * Fixed #2457 - fix building with libsodium in Visual Studio solutions * Fixed #2466 - add const qualifier to internal and public API that does not modify parameters * Fixed #2471 - do more checks for OOM conditions when dynamic allocations is used * Fixed #2476 - assertion causes abort after ZAP stop at shutdown * Fixed #2479 - improve zmq_poller performance on Windows * Fixed #2481 - potential memory leaks due to ZMTP handshake failures * Fixed #2531 - ZMQ_GSSAPI_PRINCIPAL sockopt has no effect on client side * Fixed #2535 - add BUILD_SHARED and BUILD_STATIC options to CMake, both on by default, to toggle shared and static library builds * Fixed #2537 - use SYSTEM_CLOCK on OSX and CLOCK_MONOTONIC elsewhere for internal timers to avoid races * Fixed #2540 - new zmq_poller used by zmq_poll without DRAFTs * Fixed #2552 - Fix WITH_DOC CMake build to avoid checking for asciidoc if the option is disabled * Fixed #2567 - Memory leak in REP socket handling * Fixed #2579 - Compilation issue on Windows with CMake + ninja * Fixed #2588 - SIGBUS under 64-bit SunOS Sparc * Fixed #2590 - crash when using ZMQ_IMMEDIATE and ZMQ_LINGER to non-zero * Fixed #2601 - XPUB_MANUAL subscriptions not removed on peer term * Fixed #2602 - intermittent memory leak for ZMQ_REQ/REP send/recv * Fixed #2608 - CURVE server (connect) fails when client rebinds * Fixed #2610 - print backtraces in mutual exclusion to avoid mixing different traces * Fixed #2621 - add missing CMake files to distributable tarball * Fixed #2630 - improve compatibility with OpenBSD w.r.t. IPV6_V6ONLY * Fixed #2638 - note in INSTALL that when using Windows builds on Linux with Wine it is necessary to increase the minimum TCP buffers * Fixed #2632 - Fix file descriptor leak when using Tweetnacl (internal NACL implementation) instead of Libsodium, and fix race condition when using multiple ZMQ contexts with Tweetnacl * Fixed #2681 - Possible buffer overflow in CURVE mechanism handshake. NOTE: this was protected by an assert previously, so there is no security risk. * Fixed #2704 - test_sockopt_hwm fails occasionally on Windows * Fixed #2701 - pgm build via cmake doesn't link libzmq with libpgm * Fixed #2711 - ZAP handler communication errors should be handled consistently * Fixed #2723 - assertion in src\select.cpp:111 or hang on zmq_ctx_destroy on Windows * Fixed #2728 - fix support O_CLOEXEC when building with CMake * Fixed #2761 - improve compatibility with TrueOS (FreeBSD 12) * Fixed #2764 - do not unlink IPC socket files when closing a socket to avoid race conditions * Fixed #2770 - support lcov 1.13 and newer * Fixed #2787 - add libiphlpapi to PKGCFG_LIBS_PRIVATE for static mingw builds * Fixed #2788 - document that adding -DZMQ_STATIC is required for Windows static builds with Mingw * Fixed #2789 - description of zmq_atomic_counter_value return value is cloned from zmq_atomic_counter_new * Fixed #2791 - fix building with DRAFT APIs on CentOS 6 * Fixed #2794 - router_t methods should not allocate memory for lookup in outpipes * Fixed #2809 - optimize select() usage on Windows * Fixed #2816 - add CMake and autoconf check for accept4, as it is not available on old Linux releases, and fallback to accept + FD_CLOEXEC * Fixed #2824 - ZMQ_REQ socket does not report ZMQ_POLLOUT when ZMQ_REQ_RELAXED is set * Fixed #2827 - add support for Haiku * Fixed #2840 - fix building with VS2008 * Fixed #2845 - correct the ZMQ_LINGER documentation to accurately reflect that the default value is -1 (infinite). It never was 30 second in any released version, it was only changed briefly and then changed back, but the manpage was not reverted. * Fixed #2861 - CMake/MSVC: export ZMQ_STATIC when needed. 0MQ version 4.2.2 stable, released on 2017/02/18 ============================================= * Improve compatibility with GNU Hurd * Fixed #2286 - improve CMake on Windows documentation * Fixed #1235 - improved compatibility with mingw64 * Improve zmq_proxy documentation to state it can return ETERM as well * Fixed #1442 - SO_NOSIGPIPE and connection closing by peer race condition * Improve CMake functionality on Windows: ZeroMQConfig.cmake generation CPack option, correct static library filename, ship FindSodium.cmake in tarball * Fixed #2228 - setting HWM after connect on inproc transport leads to infinite HWM * Add support for Visual Studio 2017 * New DRAFT (see NEWS for 4.2.0) zmq_has option "draft" option that returns true if the library was built with DRAFT enabled. Useful for FFI bindings. See doc/zmq_has.txt for more information * Fixed #2321 - zmq_z85_decode does not validate its input. The function has been fixed to correctly follow RFC32 and return NULL if the input is invalid * Fixed #2323 - clock_t related crash on Apple iOS 9.3.2 and 9.3.5 * Fixed #1801 - OSX: Cmake installs libzmq in a weird PATH * Fixed potential divide by zero in zmq::lb_t::sendpipe * Improve compatibility with OpenIndiana by skipping epoll and using poll/select * Fix IPv4-in-IPv6 mapped addresses parsing error 0MQ version 4.2.1 stable, released on 2016/12/31 ============================================= * New DRAFT (see NEWS for 4.2.0) Socket Monitor events: - ZMQ_EVENT_HANDSHAKE_SUCCEED - ZMQ_EVENT_HANDSHAKE_FAILED These events trigger when the ZMTP security mechanism handshake is completed. See doc/zmq_socket_monitor.txt for more information. * New DRAFT (see NEWS for 4.2.0) Context options: - ZMQ_MSG_T_SIZE See doc/zmq_ctx_get.txt for more information. * Fixed #2268 - improved compatibility with mingw32 * Fixed #2254 - ZMQ_PUB compatibility with libzmq 2.x broken * Fixed #2245 - added support for VS2017, Windows SDK 10.0.14393.0, toolset v141 * Fixed #2242 - file descriptors leaks on fork+exec * Fixed #2239 - retired poller item crash from reaper thread * Fixed #2234 - improved compatibility with AIX 7.1 * Fixed #2225 - cannot pick select for poller * Fixed #2217 - CMake build uses library version as the ABI version * Fixed #2208 - added support for ZMQ_TOS on IPv6 * Fixed #2200 - no documentation for ZMQ_SOCKS_PROXY * Fixed #2199 - no documentation for zmq_curve_public * Fixed #2196 - fixed build and runtime errors on kFreeBSD 0MQ version 4.2.0 stable, released on 2016/11/04 ============================================= * For Pieter. Thanks for making all of this possible. "Tell them I was a writer. A maker of software. A humanist. A father. And many things. But above all, a writer. Thank You. :)" - Pieter Hintjens * This release introduces new APIs, but it is ABI compatible with libzmq 4.1.2 and up. * Note for ARM and SPARC users: an alignment problem in zmq_msg_t that could in some cases and on some CPUs cause a SIGBUS error was solved, but it requires a rebuild of your application against the 4.2.0 version of include/zmq.h. To clarify, this change does not affect the internals of the library but only the public definition of zmq_msg_t, so there is no ABI incompatibility. * Security with Curve is now available by default thanks to Tweetnacl sources: https://tweetnacl.cr.yp.to/index.html Libsodium is still fully supported but has to be enabled with the build flag --with-libsodium. Distribution and package maintainers are encouraged to use libsodium so that the security implementation can be audited and maintained separately. * New Context options: - ZMQ_MAX_MSGSZ - ZMQ_BLOCKY See doc/zmq_ctx_set.txt and doc/zmq_ctx_get.txt for details. * New Socket options: - ZMQ_HANDSHAKE_IVL - ZMQ_SOCKS_PROXY - ZMQ_XPUB_NODROP - ZMQ_XPUB_MANUAL - ZMQ_XPUB_WELCOME_MSG - ZMQ_STREAM_NOTIFY - ZMQ_INVERT_MATCHING - ZMQ_HEARTBEAT_IVL - ZMQ_HEARTBEAT_TTL - ZMQ_HEARTBEAT_TIMEOUT - ZMQ_XPUB_VERBOSER - ZMQ_CONNECT_TIMEOUT - ZMQ_TCP_MAXRT - ZMQ_THREAD_SAFE - ZMQ_MULTICAST_MAXTPDU - ZMQ_VMCI_BUFFER_SIZE - ZMQ_VMCI_BUFFER_MIN_SIZE - ZMQ_VMCI_BUFFER_MAX_SIZE - ZMQ_VMCI_CONNECT_TIMEOUT - ZMQ_USE_FD See doc/zmq_setsockopt.txt and doc/zmq_getsockopt.txt for details. * New CURVE helper function to derive z85 public key from secret key: zmq_curve_public * New cross-platform atomic counter helper functions: zmq_atomic_counter_new, zmq_atomic_counter_set, zmq_atomic_counter_inc, zmq_atomic_counter_dec, zmq_atomic_counter_value, zmq_atomic_counter_destroy See doc/zmq_atomic_*.txt for details. * New DRAFT APIs early-release mechanism. New APIs will be introduced early in public releases, and until they are stabilized and guaranteed not to change anymore they will be unavailable unless the new build flag --enable-drafts is used. This will allow developers and early adopters to test new APIs before they are finalized. NOTE: as the name implies, NO GUARANTEE is made on the stability of these APIs. They might change or disappear entirely. Distributions are recommended NOT to build with them. New socket types have been introduced in DRAFT state: ZMQ_SERVER, ZMQ_CLIENT, ZMQ_RADIO, ZMQ_DISH, ZMQ_GATHER, ZMQ_SCATTER, ZMQ_DGRAM All these sockets are THREAD SAFE, unlike the existing socket types. They do NOT support multipart messages (ZMQ_SNDMORE/ZMQ_RCVMORE). ZMQ_RADIO, ZMQ_DISH and ZMQ_DGRAM also support UDP as transport, both unicast and multicast. See doc/zmq_udp.txt for more details. New methods to support the new socket types functionality: zmq_join, zmq_leave, zmq_msg_set_routing_id, zmq_msg_routing_id, zmq_msg_set_group, zmq_msg_group See doc/zmq_socket.txt for more details. New poller mechanism and APIs have been introduced in DRAFT state: zmq_poller_new, zmq_poller_destroy, zmq_poller_add, zmq_poller_modify, zmq_poller_remove, zmq_poller_wait, zmq_poller_wait_all, zmq_poller_add_fd zmq_poller_modify_fd, zmq_poller_remove_fd and a new supporting struct typedef: zmq_poller_event_t They support existing socket type, new thread-safe socket types and file descriptors (cross-platform). Documentation will be made available in the future before these APIs are declared stable. New cross-platform timers helper functions have been introduced in DRAFT state: zmq_timers_new, zmq_timers_destroy, zmq_timers_add, zmq_timers_cancel, zmq_timers_set_interval, zmq_timers_reset, zmq_timers_timeout, zmq_timers_execute and a new supporting callback typedef: zmq_timer_fn * Many, many bug fixes. The most important fixes are backported and captured in the 4.1.x and 4.0.x changelogs. 0MQ version 4.2.0 rc1, released on 2016/11/01 ============================================= * Many changes, see ChangeLog. 0MQ version 4.1.6 stable, released on 2016/11/01 ================================================ * Fixed #2051 - getifaddrs can fail with ECONNREFUSED * Fixed #2091 - testutil.hpp fails to build on Windows XP * Fixed #2096 - add tests/CMakeLists.in and version.rc.in to dist tar * Fixed #2107 - zmq_connect with IPv6 "source:port;dest:port" broken * Fixed #2117 - ctx_term assert with inproc zmq_router connect-before-bind * Fixed #2158 - Socket monitor uses internal Pair from multiple threads * Fixed #2161 - messages dropped due to HWM race * Fixed #1325 - alignment issue with zmq_msg_t causes SIGBUS on SPARC and ARM 0MQ version 4.1.5 stable, released on 2016/06/17 ================================================ * Fixed #1673 - CMake on Windows put PDB in wrong directory. * Fixed #1723 - Family is not set when resolving NIC on Android. * Fixed #1608 - Windows 7 TCP slow start issue. * Fixed #1806 - uninitialised read in curve getsockopt. * Fixed #1807 - build broken with GCC 6. * Fixed #1831 - potential assertion failure with latest libsodium. * Fixed #1850 - detection issues with tweetnacl/libsodium. * Fixed #1877 - Avoid terminating connections prematurely * Fixed #1887 - zmq_bind IPv4 fallback still tries IPv6 * Fixed #1866 - fails to build on SunOS 5.10 / Solaris 10 * Fixed #919 - ZMQ_LINGER (related to #1877) * Fixed #114 - cannot unbind with same endpoint with IPv6 enabled. * Fixed #1952 - CMake scripts not part of release tarballs * Fixed #1542 - Fix a crash on Windows when port 5905 is in use. * Fixed #2021 - Fix building on sparc32. 0MQ version 4.1.4 stable, released on 2015/12/18 ================================================ * Fixed #1315 - socket monitor hangs if bind/setsockopt failed. * Fixed #1399 - assertion failure in tcp.cpp after network reconnect. * Fixed #1632 - build failure using latest libsodium. * Fixed #1644 - assertion failure in msg.cpp:390 on STREAM sockets. * Fixed #1661 - does not handle IPv6 link local addresses. 0MQ version 4.1.3 stable, released on 2015/08/17 ================================================ * Fixed #1532 - getsockopt ZMQ_RCVMORE now resets all bits instead of only 32 * Fixed #1445 - zmq::socket_base_t::connect fails on tcp ipv6 address 0MQ version 4.1.2 stable, released on 2015/06/15 ================================================ * Added explicit reference to static link exception in every source file. * Bumped ABI version to 5:0:0 since 4.1.x changed the ABI. * Fixed STDINT event interface macros to work with CZMQ 3.0. * Fixed installation of man pages when BUILD_DOC is not set. * Fixed #1428 - regression on single-socket proxies. 0MQ version 4.1.1 stable, released on 2015/06/02 ================================================ * Fixed #1208 - fix recursion in automake packaging. * Fixed #1224 - crash when processing empty unsubscribe message. * Fixed #1213 - properties files were missing from source packages. * Fixed #1273 - V3 protocol handler vulnerable to downgrade attacks. * Fixed #1347 - lack way to get peer address. * Fixed #1362 - SUB socket sometimes fails to resubscribe properly. * Fixed #1377, #1144 - failed with WSANOTINITIALISED in some cases. * Fixed #1389 - PUB, PUSH sockets had slow memory leak. * Fixed #1382 - zmq_proxy did not terminate if there were no readers. 0MQ version 4.1.0 rc1, released on 2014/10/14 ============================================= * All issues that were fixed in 4.0.x * Improved client reconnection strategy on errors * GSSAPI security mechanism * SOCKS5 support (ZMQ_SOCKS_PROXY) * ZMQ_ROUTER_HANDOVER * ZMQ_TOS * ZMQ_CONNECT_RID * ZMQ_HANDSHAKE_IVL * ZMQ_IDENTITY_FD * ZMQ_XPUB_NODROP * ZMQ_SRCFD and ZMQ_SHARED message options * Message metadata -- zmq_msg_gets () * Probe library configuration -- zmq_has () 0MQ version 4.0.8 stable, released on 2016/06/17 ================================================ * Fixed LIBZMQ-949 - zmq_unbind fails for inproc and wildcard endpoints * Fixed #1806 - uninitialised read in curve getsockopt. * Fixed #1807 - build broken with GCC 6. * Fixed #1877 - Avoid terminating connections prematurely * Fixed #1887 - zmq_bind IPv4 fallback still tries IPv6 * Fixed #98 - don't require libssp without libsodium on Solaris * Fixed #919 - ZMQ_LINGER (related to #1877) * Fixed #139 - "tempnam" is deprecated. 0MQ version 4.0.7 stable, released on 2015/06/15 ================================================ * Fixed #1428 - regression on single-socket proxies. 0MQ version 4.0.6 stable, released on 2015/06/02 ================================================ * Fixed #1273 - V3 protocol handler vulnerable to downgrade attacks. * Fixed #1362 - SUB socket sometimes fails to resubscribe properly. * Fixed #1377, #1144 - failed with WSANOTINITIALISED in some cases. * Fixed #1389 - PUB, PUSH sockets had slow memory leak. * Fixed #1382 - zmq_proxy did not terminate if there were no readers. 0MQ version 4.0.5 stable, released on 2014/10/14 ================================================ * Fixed #1191; CURVE mechanism does not verify short term nonces. * Fixed #1190; stream_engine is vulnerable to downgrade attacks. * Fixed #1088; assertion failure for WSAENOTSOCK on Windows. * Fixed #1015; race condition while connecting inproc sockets. * Fixed #994; bump so library number to 4.0.0 * Fixed #939, assertion failed: !more (fq.cpp:99) after many ZAP requests. * Fixed #872; lost first part of message over inproc://. * Fixed #797, keep-alive on Windows. 0MQ version 4.0.4 stable, released on 2014/03/10 ================================================ Bug Fixes --------- * Fixed #909; out of tree build issue on Linux. * Fixed #888; hangs on terminate when inproc connected but never bound. * Fixed #868; assertion failure at ip.cpp:137 when using port scanner. * Fixed #818; fix timestamp counter on s390/s390x. * Fixed #817; only export zmq_* symbols. * Fixed #797; fixed setting TCP keepalive on Windows. * Fixed #775; compile error on Windows. * Fixed #763; when talking to a ZMTP v1 peer (libzmq 2.2), a socket would send an extra identity frame at the start of the connection. * Fixed LIBZMQ-576 - Crash closing a socket after zmq_msg_send returns EAGAIN (reverts LIBZMQ-497) * Fixed LIBZMQ-584; subscription filters getting lost on reconnection. 0MQ version 4.0.3 stable, released on 2013/11/24 ================================================ Bug Fixes --------- * Fixed test_many_sockets case, which failed when process socket limit was 1024. 0MQ version 4.0.2 stable, released on 2013/11/24 ================================================ Bug Fixes --------- * Fixed LIBZMQ-583 - improved low-res timer for Windows * Fixed LIBZMQ-578 - z85_decode was extremely slow * Fixed LIBZMQ-577 - fault in man pages. * Fixed LIBZMQ-574 - assertion failure when ran out of system file handles * Fixed LIBZMQ-571 - test_stream failing in some cases * Fixed LIBZMQ-569 - Socket server crashes with random client data and when talking to 2.2 versions * Fixed LIBZMQ-39 - Bad file descriptor during shutdown * Pulled expected failing test_linger.cpp from release * Reduced pause time in tests to allow "make check" to run faster 0MQ version 4.0.1 stable, released on 2013/10/08 ================================================ Changes ------- * Updated CURVE mechanism to track revised RFC 27 (INITIATE vouch). The INITIATE command vouch box is Box[C',S](C->S') instead of Box[C'](C->S), to reduce the risk of client impersonation, as per https://codesinchaos.wordpress.com/2012/09/09/curvecp-1/. * Fixed LIBZMQ-567, adding abstract namespaces for IPC sockets on Linux. Converts an initial strudel or "at sign" (@) in the Unix socket path to a NULL character ('\0') indicating that the socket uses the abstract namespace instead of the filesystem namespace. For instance, binding a socket to 'ipc://@/tmp/tester' will not create a file associated with the socket whereas binding to 'ipc:///tmp/tester' will create the file /tmp/tester. See issue 567 for more information. * Added zmq_z85_encode and zmq_z85_decode to core libzmq API. * Added zmq_curve_keypair to core libzmq API. * Bumped library ABI version to 4:0:1. Bug fixes --------- * Fixed some build/test errors on OS/X + Clang++. * Fixed LIBZMQ-565, typo in code. * Fixed LIBZMQ-566, dealer-to-router connections sometimes failing. * Fixed builds for AIX, MSVC 2008, OS/X with clang++, Solaris. * Improved CURVE handshake error handling. 0MQ version 4.0.0 (RC1), released on 2013/09/20 =============================================== Major changes ------------- * New wire level protocol, ZMTP/3.0, see http://rfc.zeromq.org/spec:23. Does not yet implement the SUBSCRIBE, CANCEL, PING, and PONG commands. * New security framework, from plain user+password to strong encryption, see section below. See http://hintjens.com/blog:49 for a tutorial. * New ZMQ_STREAM socket type for working as a TCP client or server. See: tests/test_stream.cpp. Improvements ------------ * You can now connect to an inproc:// endpoint that does not already exist. This means inproc:// no longer needs careful set-up, but it may break code that relied on the old behaviour. See: tests/test_inproc_connect.cpp. * Libzmq now checks socket types at connection time, so that trying to connect a 'wrong' socket type will fail. * New zmq_ctx_shutdown API method will shutdown a context and send ETERM to blocking calls, without blocking. Use zmq_ctx_term to finalise the process. * The regression test suite has been significantly extended and improved. * Contexts can now be terminated in forked child processes. See: tests/test_fork.cpp. * zmq_disconnect now respects the linger setting on sockets. * New zmq_send_const API method to send constant data (without copying). See: tests/test_inproc_connect.cpp. * Added CMake support for static libraries. * Added test cases for socket semantics as defined in RFCs 28, 29, 30, 31. See: tests/test_spec_*.cpp. * New socket option, ZMQ_PROBE_ROUTER triggers an empty message on connect. See: tests/test_probe_router.cpp. * New socket option, ZMQ_REQ_CORRELATE allows for correlation of replies from a REP socket. See: tests/test_req_correlate.cpp. * New socket option, ZMQ_REQ_RELAXED, lets you disable the state machine on a REQ socket, so you can send multiple requests without waiting for replies, and without getting an EFSM error. See: tests/test_req_relaxed.cpp. * New socket option, ZMQ_CONFLATE restricts the outgoing and incoming socket buffers to a single message. See: tests/test_conflate.cpp. Deprecated Options ------------------ * ZMQ_IPV4ONLY deprecated and renamed to ZMQ_IPV6 so that options are consistently "off" by default. * ZMQ_DELAY_ATTACH_ON_CONNECT deprecated, and renamed to ZMQ_IMMEDIATE. See: tests/test_immediate.cpp. Security Framework ------------------ Based on new ZMTP wire level protocol that negotiates a security "mechanism" between client and server before exchanging any other data. Security mechanisms are extensible. ZMTP defines three by default: * NULL - classic ZeroMQ, with no authentication. See http://rfc.zeromq.org/spec:23. * PLAIN - plain-text username + password authentication. See http://rfc.zeromq.org/spec:24. * CURVE - secure authentication and encryption based on elliptic curve cryptography, using the Curve25519 algorithm from Daniel Bernstein and based on CurveCP's security handshake. See http://rfc.zeromq.org/spec:25, http://rfc.zeromq.org/spec:26, and http://curvecp.org. Authentication is done by pluggable "authenticators" that connect to libzmq over an inproc endpoint, see http://rfc.zeromq.org/spec:27. Socket options to configure PLAIN security on client or server: * ZMQ_PLAIN_SERVER, ZMQ_PLAIN_USERNAME, ZMQ_PLAIN_PASSWORD. See tests/test_security_plain. Socket options to configure CURVE security on client or server: * ZMQ_CURVE_SERVER, ZMQ_CURVE_PUBLICKEY, ZMQ_CURVE_SECRETKEY, ZMQ_CURVE_SERVERKEY. See tests/test_security_curve.cpp. Socket options to configure "domain" for ZAP handler: * ZMQ_ZAP_DOMAIN, see tests/test_security_null.cpp. Support for encoding/decoding CURVE binary keys to ASCII: * zmq_z85_encode, zmq_z85_decode. Other issues addressed in this release -------------------------------------- * LIBZMQ-525 Multipart upstreaming from XSUB to XPUB 0MQ version 3.2.4 stable, released on 2013/09/20 ================================================ * LIBZMQ-84 (Windows) Assertion failed: Address already in use at signaler.cpp:80 * LIBZMQ-456 ZMQ_XPUB_VERBOSE does not propagate in a tree of XPUB/XSUB devices * LIBZMQ-532 (Windows) critical section not released on error * LIBZMQ-569 Detect OpenPGM 5.2 system library * LIBZMQ-563 Subscribers sometimes stopped receiving messages (aka LIBZMQ-541) * LIBZMQ-XXX Added support for Travis Continuous Integration * LIBZMQ-XXX Several improvements to MSVC support 0MQ version 3.2.3 stable, released on 2013/05/02 ================================================ Issues addressed in this release -------------------------------- * LIBZMQ-526 Assertion failure "Invalid argument (tcp_connecter.cpp:285)" * LIBZMQ-446 Setting the DSCP bits by default causes CAP_NET_ADMIN error * LIBZMQ-496 Crash on heavy socket opening/closing: Device or resource busy (mutex.hpp:90) * LIBZMQ-462 test_connect_delay fails at test_connect_delay.cpp:80 * LIBZMQ-497 Messages getting dropped * LIBZMQ-488 signaler.cpp leaks the win32 Event Handle * LIBZMQ-476 zmq_disconnect has no effect for inproc sockets * LIBZMQ-475 zmq_disconnect does not sent unsubscribe messages 0MQ version 3.2.2 stable, released on 2012/11/23 ================================================ Issues addressed in this release -------------------------------- * LIBZMQ-384 No meta data for ZMQ_EVENT_DISCONNECTED monitor event * LIBZMQ-414 Error in ARM/Thumb2 assembly (atomic_ptr.hpp) * LIBZMQ-417 zmq_assert (!incomplete_in) in session_base.cpp 228 * LIBZMQ-447 socket_base_t::recv() packet loss and memory leak at high receiving rate * LIBZMQ-448 Builds fail on older versions of GCC * LIBZMQ-449 Builds fail on AIX * LIBZMQ-450 lt-test_monitor: fails with assertion at test_monitor.cpp:81 * LIBZMQ-451 ZMQ_ROUTER_MANDATORY blocks forever * LIBZMQ-452 test_connect_delay.cpp:175:12: error: 'sleep' was not declared in this scope * LIBZMQ-458 lt-test_router_mandatory fails with assertion at test_router_mandatory.cpp:53 * LIBZMQ-459 Assertion failed: encoder (stream_engine.cpp:266 * LIBZMQ-464 PUB socket with HWM set leaks memory * LIBZMQ-465 PUB/SUB results in 80-90% of CPU load * LIBZMQ-468 ZMQ_XPUB_VERBOSE & unsubscribe * LIBZMQ-472 Segfault in zmq_poll in REQ to ROUTER dialog 0MQ version 3.2.1 (RC2), released on 2012/10/15 =============================================== Issues addressed in this release -------------------------------- * Fixed issue xxx - handle insufficient resources on accept() properly. * Fixed issue 443 - added ZMQ_XPUB_VERBOSE setsocket option. * Fixed issue 433 - ZeroMQ died on receiving EPIPE * Fixed issue 423 - test_pair_tcp hangs * Fixed issue 416 - socket_base: fix 'va_list' has not been declared error * Fixed issue 409 - Pub-sub interoperability between 2.x and 3.x. * Fixed issue 404 - zmq_term can not safely be re-entered with pgm transport * Fixed issue 399 - zmq_ctx_set_monitor callback is not works properly * Fixed issue 393 - libzmq does not build on Android (socklen_t signed comparison) * Fixed issue 392 - Interaction with pyzmq on Android * Fixed issue 389 - Assertion failure in mtrie.cpp:317 * Fixed issue 388 - tests/test_monitor.cpp has no newline at EOF (causes compile error) * Fixed issue 387 - "sa_family_t sa_family;" in pgm_socket.cpp is unused variable * Fixed issue 385 - Rework ZMQ_FAIL_UNROUTABLE socket option to actually work * Fixed issue 382 - Current libzmq doesn't compile on Android NDK * Fixed issue 377 - ZeroMQ will not build on Windows with OpenPGM * Fixed issue 375 - error: unused variable 'sa_family' * Fixed issue 373 - Unable to build libzmq/zeromq3.x on AIX7 * Fixed issue 372 - Unable to build libzmq/zeromq3.x on HPUX 11iv3 * Fixed issue 371 - Unable to build libzmq/zeromq3.x on RHEL5/SLES10 * Fixed issue 329 - wsa_error_to_errno() calls abort() on WSAEACCES * Fixed issue 309 - Assertion failed: options.recv_identity (socket_base.cpp:864) * Fixed issue 211 - Assertion failed: msg_->flags & ZMQ_MSG_MORE (rep.cpp:81) API changes ----------- * zmq_device () deprecated and replaced by zmq_proxy (). * zmq_ctx_set_monitor () replaced by zmq_socket_monitor (). * ZMQ_ROUTER_BEHAVIOR/ZMQ_FAIL_UNROUTABLE renamed experimentally to ZMQ_ROUTER_MANDATORY. 0MQ version 3.2.0 (RC1), released on 2012/06/05 =============================================== Bug fixes --------- * Fixed issue 264 - Potential bug with linger, messages dropped during socket close. * Fixed issue 293 - libzmq doesn't follow the ZMTP/1.0 spec (did not set reserved bits to 0). * Fixed issue 303 - Assertion failure in pgm_sender.cpp:102. * Fixed issue 320 - Assertion failure in connect_session.cpp:96 when connecting epgm to an invalid endpoint. * Fixed issue 325 - Assertion failure in xrep.cpp:93, when two sockets connect using the same identity. * Fixed issue 327 - Assertion failure in mtrie.cpp:246, when unsubscribing from channel. * Fixed issue 346 - Assertion failure in signaler.cpp:155, when using a closed socket. * Fixed issue 328 - unsubscribe wrongly clears multiple subscriptions. * Fixed issue 330 - IPC listener does not remove unix domain stream file when terminated. * Fixed issue 334 - Memory leak in session_base.cpp:59. * Fixed issue 369 - ROUTER cannot close/reopen while DEALER connected. Operating systems ----------------- * Fixed issue 301 - HPUX 11iv2 - build fails, CLOCK_MONOTONIC undefined. * Fixed issue 324 - OS/X - build fails, ECANTROUTE undefined. * Fixed issue 368 - Solaris / Sun C++ - build fails, no insert method in multimap classes. * Fixed issue 366 - Windows - ports not freed after crash. * Fixed issue 355 - Windows - build fails, MSVC solution file is out of date. * Fixed issue 331 - FreeBSD 8 and 9 - getaddrinfo fails with EAI_BADFLAGS on AI_V4MAPPED flag. * Fixed issue xxx - Added support for WinCE. Performance ----------- * Fixed issue xxx - Implemented atomic operations for ARMv7a (runs 15-20% faster). API changes ----------- * Fixed issue 337 - Cleaned-up context API: zmq_ctx_new() - create new context (will deprecate zmq_init) zmq_ctx_destroy() - destroy context (will deprecate zmq_term) zmq_ctx_set() - set context property zmq_ctx_get() - get context property * Fixed issue xxx - Cleaned-up message API: zmq_msg_send() - send a message (will deprecate zmq_sendmsg) zmq_msg_recv() - receive a message (will deprecate zmq_recvmsg) zmq_msg_more() - indicate whether this is final part of message zmq_msg_get() - get message property zmq_msg_set() - set message property * Fixed issue xxx - Added context monitoring API: zmq_ctx_set_monitor() - configure monitor callback. * Fixed issue xxx - Added unbind/disconnect API: zmq_unbind() - unbind socket. zmq_disconnect() - disconnect socket. * Fixed issue xxx - Added ZMQ_TCP_ACCEPT_FILTER setsockopt() for listening TCP sockets. * Fixed issue 336 - Removed sys: transport. * Fixed issue 333 - Added zmq_device function back to API (was removed in 3.0). * Fixed issue 340 - Add support for MAX_SOCKETS to new context API. OMQ version 3.1.0 (beta), released on 2011/12/18 ================================================ General information ------------------- Based on community consensus, the 0MQ 3.1.x release reverts a number of features introduced in version 3.0. The major reason for these changes is improving backward compatibility with 0MQ 2.1.x. Development of the 0MQ 3.0.x series will be discontinued, and users are encouraged to upgrade to 3.1. The 0MQ 3.1.x releases use ABI version 3. Reverted functionality ---------------------- The following functionality present in 0MQ 3.0 has been reverted: * Wire format changes. The 0MQ 3.1 wire format is identical to that of 0MQ 2.1. * LABELs and COMMANDs have been removed. * Explicit identies are re-introduced, however they can be used only for explicit routing, not for durable sockets. * The ZMQ_ROUTER and ZMQ_DEALER socket types are once again aliases for ZMQ_XREQ and ZMQ_XREP. New functionality ----------------- * The zmq_getmsgopt() function has been introduced. * Experimental IPv6 support has been introduced. This is disabled by default, see the zmq_setsockopt() documentation for enabling it. Other changes ------------- * The default HWM for all socket types has been set to 1000. * Many bug fixes. Building -------- * The dependency on libuuid has been removed. * Support for building on Android, and with MSVC 10 has been added. 0MQ version 3.0.0 (alpha), released on 2011/07/12 ================================================= New functionality ----------------- * A zmq_ctx_set_monitor() API to register a callback / event sink for changes in socket state. * POSIX-compliant zmq_send and zmq_recv introduced (uses raw buffer instead of message object). * ZMQ_MULTICAST_HOPS socket option added. Sets the appropriate field in IP headers of PGM packets. * Subscription forwarding. Instead of filtering on consumer, the subscription is moved as far as possible towards the publisher and filtering is done there. * ZMQ_XPUB, ZMQ_XSUB introduced. Allow to create subscription- forwarding-friendly intermediate devices. * Add sockopt ZMQ_RCVTIMEO/ZMQ_SNDTIMEO. Allow to set timeout for blocking send/recv calls. * A new LABEL flag was added to the wire format. The flag distinguishes message parts used by 0MQ (labels) from user payload message parts. * There is a new wire format for the REQ/REP pattern. First, the empty bottom-of-the-stack message part is not needed any more, the LABEL flag is used instead. Secondly, peer IDs are 32-bit integers rather than 17-byte UUIDs. * The REQ socket now drops duplicate replies. * Outstanding requests & replies associated with a client are dropped when the clients dies. This is a performance optimisation. * Introduced ZMQ_ROUTER and ZMQ_DEALER sockets. These mimic the functionality of ZMQ_ROUTER and ZMQ_DEALER in 0MQ/2.1.x. Guarantees backward compatibility for exsiting code. * Removed dependency on OS socketpair buffer size. No more asserts in mailbox.cpp because of low system limit of sockepair buffer size. API improvements ---------------- * Obsolete constants ZMQ_UPSTREAM and ZMQ_DOWNSTREAM removed. Use ZMQ_PUSH and ZMQ_PULL instead. * Timeout in zmq_poll is in milliseconds instead of microseconds. This makes zmq_poll() compliant with POSIX poll() * ZMQ_MCAST_LOOP removed. There's no support for multicast over loopback any more. Use IPC or TCP isntead. * zmq_send/zmq_recv was renamed zmq_sendmsg/zmq_recvmsg. * ZMQ_RECOVERY_IVL and ZMQ_RECOVERY_IVL_MSEC reconciled. The new option is named ZMQ_RECOVERY_IVL and the unit is milliseconds. * Option types changed. Most of the numeric types are now represented as 'int'. * ZMQ_HWM split into ZMQ_SNDHWM and ZMQ_RCVHWM. This makes it possible to control message flow separately for each direction. * ZMQ_NOBLOCK renamed ZMQ_DONTWAIT. That makes it POSIX-compliant. Less is More ------------ * Pre-built devices and zmq_device() removed. Should be made available as a separate project(s). * ZMQ_SWAP removed. Writing data to disk should be done on top of 0MQ, on inside it. * C++ binding removed from the core. Now it's a separate project, same as any other binding. Bug fixes --------- * Many. Building -------- * Make pkg-config dependency conditional. Distribution ------------ * Removed Debian packaging, which is now available at packages.debian.org or via apt-get. 0MQ version 2.2.0 (Stable), released on 2012/04/04 ================================================== Changes ------- * Fixed issue 349, add send/recv timeout socket options. Bug fixes --------- * Fixed issue 301, fix builds on HP-UX 11iv3 when using either gcc or aCC. * Fixed issue 305, memory leakage when using dynamic subscriptions. * Fixed issue 332, libzmq doesn't compile on Android NDK. * Fixed issue 293, libzmq doesn't follow ZMTP/1.0 spec. * Fixed issue 342, cannot build against zmq.hpp under C++11. 0MQ version 2.1.11 (Stable), released on 2011/12/18 =================================================== Bug fixes --------- * Fixed issue 290, zmq_poll was using system time instead of monotonic clock (Mika Fischer). * Fixed issue 281, crash on heavy socket creation - assertion failure in mutex.hpp:91. (Mika Fischer). * Fixed issue 273, O_CLOEXEC flag used in ip.cpp:192 is supported only on Linux kernels 2.6.27+ * Fixed issue 261, assertion failure in kqueue.cpp:76. * Fixed issue 269, faulty diagnostic code in 2.1.10. * Fixed issue 254, assertion failure at tcp_socket.cpp:229 on ENOTCONN. Changes ------- * Now builds properly on AIX 6.1 (AJ Lewis). * Builds using libdcekt on HP-UX (AJ Lewis). * New upstream OpenPGM maintenance release 5.1.118. * Enabled debugging on assertion failure on Windows (Paul Betts). 0MQ version 2.1.10 (Stable), released on 2011/10/03 =================================================== Bug fixes --------- * Fixed issue 140, SWAP failed with assertion failure in pipe.cpp:187 if the current directory was not writeable. Behavior now is to return -1 at zmq_setsockopt in this situation. * Fixed issue 207, assertion failure in zmq_connecter.cpp:48, when an invalid zmq_connect() string was used, or the hostname could not be resolved. The zmq_connect() call now returns -1 in both those cases. * Fixed issue 218, sockets not opened with SOCK_CLOEXEC, causing fork/exec to sit on sockets unnecessarily. * Fixed issue 250, build errors on Windows (Mikko Koppanen). * Fixed issue 252, assertion failure in req.cpp:87 and req.cpp:88 (Mikko Koppanen). 0MQ version 2.1.9 (Stable), released on 2011/08/29 ================================================== Bug fixes --------- * Fixed issue 240, assertion failure in pgm_socket.cpp:437. * Fixed issue 238, assertion failure in zmq.cpp:655, when zmq_poll is used on an empty set, on Windows. * Fixed issue 239, assertion failure in zmq.cpp:223, when ZMQ_SWAP was used with explicit identities and multiple SUB sockets. * Fixed issue 236, zmq_send() and zmq_recv() did not always return error conditions such as EFSM properly. This bug was introduced in version 2.1.8 by the backport of changes for issue 231. Building -------- * 0MQ support for Android added (Bill Roberts, Mikko Koppanen). 0MQ version 2.1.8 (RC), released on 2011/07/28 ============================================== Bug fixes --------- * Fixed issue 223, assertion failure in tcp_connecter.cpp:300 when connecting to a server that is on an unreachable network (errno is equal to ENETUNREACH). * Fixed issue 228, assertion failure at rep.cpp:88 when HWM was reached. * Fixed issue 231, assertion failure at mailbox.cpp:183 when too many pending socketpair operations were queued (major backport from 3.0). * Fixed issue 234, assertion failure at mailbox.cpp:77 when Ctrl-C was used (only affected git master following backport for 231). * Fixed issue 230, SIGPIPE killing servers when client disconnected, hit OS/X only. Note: this release was renamed "release candidate" due to issue 236, fixed in 2.1.9. 0MQ version 2.1.7 (Stable), released on 2011/05/12 ================================================== Bug fixes --------- * Fixed issue 188, assert when closing socket that had unread multipart data still on it (affected PULL, SUB, ROUTER, and DEALER sockets). * Fixed issue 191, message atomicity issue with PUB sockets (an old issue). * Fixed issue 199 (affected ROUTER/XREP sockets, an old issue). * Fixed issue 206, assertion failure in zmq.cpp:223, affected all sockets (bug was introduced in 2.1.6 as part of message validity checking). * Fixed issue 211, REP socket asserted if sent malformed envelope (old issue due to abuse of assertions for error checking). * Fixed issue 212, reconnect failing after resume from sleep on Windows (due to not handling WSAENETDOWN). * Properly handle WSAENETUNREACH on Windows (e.g. if client connects before server binds). * Fixed memory leak with threads on Windows. Changes ------- * Checks zmq_msg_t validity at each operation. * Inproc performance tests now work on Windows. * PGM wire format specification improved in zmq_pgm(7) * Added thread latency/throughput performance examples. * Added "--with-system-pgm" configure option to use already installed OpenPGM. * Runtime checking of socket and context validity, to catch e.g. using a socket after closing it, or passing an invalid pointer to context/socket methods. * Test cases moved off port 5555, which conflicts with other services. * Clarified zmq_poll man page that the resolution of the timeout is 1msec. 0MQ version 2.1.6 (Broken), released on 2011/04/26 ================================================== Note that this version contained a malformed patch and is not usable. It is not available for download, but is available in the git via the 2.1.6 tag. 0MQ version 2.1.5 (Broken), released on 2011/04/20 ================================================== Note that this version contained a malformed patch and is not usable. It is not available for download, but is available in the git via the 2.1.5 tag. 0MQ version 2.1.4 (Stable), released on 2011/03/30 ================================================== Bug fixes --------- * Fix to OpenPGM which was asserting on small messages (Steven McCoy). Changes ------- * Upgraded OpenPGM to version 5.1.115 (Pieter Hintjens). * OpenPGM build changed to not install OpenPGM artifacts. 0MQ version 2.1.3 (Stable), released on 2011/03/21 ================================================== Bug fixes --------- * Fix to PUSH sockets, which would sometimes deliver tail frames of a multipart message to new subscribers (Martin Sustrik). * Fix to PUB sockets, which would sometimes deliver tail frames of a multipart message to new subscribers (Martin Sustrik). * Windows build was broken due to EPROTONOSUPPORT not being defined. This has now been fixed (Martin Sustrik). * Various fixes to make OpenVMS port work (Brett Cameron). * Corrected Reference Manual to note that ZMQ_LINGER socket option may be set at any time, not just before connecting/binding (Pieter Hintjens). * Fix to C++ binding to properly close sockets (Guido Goldstein). * Removed obsolete assert from pgm_socket.cpp (Martin Sustrik). Changes ------- * Removed stand-alone devices (/devices subdirectory) from distribution. These undocumented programs remain available in older packages (Pieter Hintjens). * OpenPGM default rate raised to 40mbps by default (Steven McCoy). * ZMQ_DEALER and ZMQ_ROUTER macros provided to ease upgrade to 0MQ/3.0. These are scheduled to replace ZMQ_XREQ and ZMQ_XREP (Pieter Hintjens). * Added man page for zmq_device(3) which was hereto undocumented (Pieter Hintjens). * Removed zmq_queue(3), zmq_forwarder(3), zmq_streamer(3) man pages (Pieter Hintjens). OpenPGM Integration ------------------- * Upgraded OpenPGM to version 5.1.114 (Steven McCoy, Mikko Koppanen). * Build system now calls OpenPGM build process directly, allowing easier future upgrades of OpenPGM (Mikko Koppanen). * Build system allows configuration with arbitrary versions of OpenPGM (./configure --with-pgm=libpgm-x.y.z) (Mikko Koppanen). * OpenPGM uses new PGM_ODATA_MAX_RTE controlling original data instead of PGM_TXW_MAX_RTE covering entire channel (Steven McCoy). Building -------- * 0MQ builds properly on FreeBSD (Mikko Koppanen). 0MQ version 2.1.2 (rc2), released on 2011/03/06 =============================================== Bug fixes --------- * 0MQ now correctly handles durable inproc sockets; previously it ignored explicit identities on inproc sockets. * Various memory leaks were fixed. * OpenPGM sender/receiver creation fixed. 0MQ version 2.1.1 (rc1), released on 2011/02/23 =============================================== New functionality ----------------- * New socket option ZMQ_RECONNECT_IVL_MAX added, allows for exponential back-off strategy when reconnecting. * New socket option ZMQ_RECOVERY_IVL_MSEC added, as a fine-grained counterpart to ZMQ_RECOVERY_IVL (for multicast transports). * If memory is exhausted, 0MQ warns with an explicit message before aborting the process. * Size of inproc HWM and SWAP is sum of peers' HWMs and SWAPs (Douglas Greager, Martin Sustrik). Bug fixes --------- * 0MQ no longer asserts in mailbox.cpp when multiple peers connect with the same identity. * 0MQ no longer asserts when rejecting an oversized message. * 0MQ no longer asserts in pipe.cpp when the swap fills up. * zmq_poll now works correctly with an empty poll set. * Many more. Building -------- * 0MQ now builds correctly on CentOS, Debian 6, and SunOS/gcc3. * Added WithOpenPGM configuration into MSVC builds. Known issues ------------ * OpenPGM integration is still not fully stable. 0MQ version 2.1.0 (Beta), released on 2010/12/01 ================================================ New functionality ----------------- * New semantics for zmq_close () and zmq_term () ensure that all messages are sent before the application terminates. This behaviour may be modified using the new ZMQ_LINGER socket option; for further details refer to the reference manual. * The new socket options ZMQ_FD and ZMQ_EVENTS provide a way to integrate 0MQ sockets into existing poll/event loops. * Sockets may now be migrated between OS threads, as long as the application ensures that a full memory barrier is issued. * The 0MQ ABI exported by libzmq.so has been formalised; DSO symbol visibility is used on supported platforms to ensure that only public ABI symbols are exported. The library ABI version has been set to 1.0.0 for this release. * OpenPGM has been updated to version 5.0.92. This version no longer depends on GLIB, and integration with 0MQ should be much improved. * zmq_poll() now honors timeouts precisely, and no longer returns if no events are signaled. * Blocking calls now return EINTR if interrupted by the delivery of a signal; this also means that language bindings which previously had problems with handling SIGINT/^C should now work correctly. * The ZMQ_TYPE socket option was added; this allows retrieval of the socket type after creation. * Added a ZMQ_VERSION macro to zmq.h for compile-time API version detection. * The ZMQ_RECONNECT_IVL and ZMQ_BACKLOG socket options have been added. Bug fixes --------- * Forwarder and streamer devices now handle multi-part messages correctly. * 0MQ no longer asserts when malformed data is received on the wire. * 0MQ internal timers now work correctly if the TSC jumps backwards. * The internal signalling functionality (mailbox) has been improved to automatically resize socket buffers on POSIX systems. * Many more. Building -------- * 0MQ now builds correctly with many more non-GCC compilers (Sun Studio, Intel ICC, CLang). * AIX and HP-UX builds should work now. * FD_SETSIZE has been set to 1024 by default for MSVC builds. * Windows builds using GCC (MinGW) now work out of the box. Distribution ------------ * A simple framework for regression tests has been added, along with a few basic self-tests. The tests can be run using "make check". zeromq-4.2.5/include/0000775000372000037200000000000013255253302015364 5ustar00travistravis00000000000000zeromq-4.2.5/include/zmq.h0000664000372000037200000006657013255253220016361 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . ************************************************************************* NOTE to contributors. This file comprises the principal public contract for ZeroMQ API users. Any change to this file supplied in a stable release SHOULD not break existing applications. In practice this means that the value of constants must not change, and that old values may not be reused for new constants. ************************************************************************* */ #ifndef __ZMQ_H_INCLUDED__ #define __ZMQ_H_INCLUDED__ /* Version macros for compile-time API version detection */ #define ZMQ_VERSION_MAJOR 4 #define ZMQ_VERSION_MINOR 2 #define ZMQ_VERSION_PATCH 5 #define ZMQ_MAKE_VERSION(major, minor, patch) \ ((major) *10000 + (minor) *100 + (patch)) #define ZMQ_VERSION \ ZMQ_MAKE_VERSION (ZMQ_VERSION_MAJOR, ZMQ_VERSION_MINOR, ZMQ_VERSION_PATCH) #ifdef __cplusplus extern "C" { #endif #if !defined _WIN32_WCE #include #endif #include #include #if defined _WIN32 // Set target version to Windows Server 2008, Windows Vista or higher. // Windows XP (0x0501) is supported but without client & server socket types. #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0600 #endif #ifdef __MINGW32__ // Require Windows XP or higher with MinGW for getaddrinfo(). #if (_WIN32_WINNT >= 0x0501) #else #error You need at least Windows XP target #endif #endif #include #endif /* Handle DSO symbol visibility */ #if defined _WIN32 #if defined ZMQ_STATIC #define ZMQ_EXPORT #elif defined DLL_EXPORT #define ZMQ_EXPORT __declspec(dllexport) #else #define ZMQ_EXPORT __declspec(dllimport) #endif #else #if defined __SUNPRO_C || defined __SUNPRO_CC #define ZMQ_EXPORT __global #elif (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER #define ZMQ_EXPORT __attribute__ ((visibility ("default"))) #else #define ZMQ_EXPORT #endif #endif /* Define integer types needed for event interface */ #define ZMQ_DEFINED_STDINT 1 #if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS #include #elif defined _MSC_VER && _MSC_VER < 1600 #ifndef int32_t typedef __int32 int32_t; #endif #ifndef uint32_t typedef unsigned __int32 uint32_t; #endif #ifndef uint16_t typedef unsigned __int16 uint16_t; #endif #ifndef uint8_t typedef unsigned __int8 uint8_t; #endif #else #include #endif // 32-bit AIX's pollfd struct members are called reqevents and rtnevents so it // defines compatibility macros for them. Need to include that header first to // stop build failures since zmq_pollset_t defines them as events and revents. #ifdef ZMQ_HAVE_AIX #include #endif /******************************************************************************/ /* 0MQ errors. */ /******************************************************************************/ /* A number random enough not to collide with different errno ranges on */ /* different OSes. The assumption is that error_t is at least 32-bit type. */ #define ZMQ_HAUSNUMERO 156384712 /* On Windows platform some of the standard POSIX errnos are not defined. */ #ifndef ENOTSUP #define ENOTSUP (ZMQ_HAUSNUMERO + 1) #endif #ifndef EPROTONOSUPPORT #define EPROTONOSUPPORT (ZMQ_HAUSNUMERO + 2) #endif #ifndef ENOBUFS #define ENOBUFS (ZMQ_HAUSNUMERO + 3) #endif #ifndef ENETDOWN #define ENETDOWN (ZMQ_HAUSNUMERO + 4) #endif #ifndef EADDRINUSE #define EADDRINUSE (ZMQ_HAUSNUMERO + 5) #endif #ifndef EADDRNOTAVAIL #define EADDRNOTAVAIL (ZMQ_HAUSNUMERO + 6) #endif #ifndef ECONNREFUSED #define ECONNREFUSED (ZMQ_HAUSNUMERO + 7) #endif #ifndef EINPROGRESS #define EINPROGRESS (ZMQ_HAUSNUMERO + 8) #endif #ifndef ENOTSOCK #define ENOTSOCK (ZMQ_HAUSNUMERO + 9) #endif #ifndef EMSGSIZE #define EMSGSIZE (ZMQ_HAUSNUMERO + 10) #endif #ifndef EAFNOSUPPORT #define EAFNOSUPPORT (ZMQ_HAUSNUMERO + 11) #endif #ifndef ENETUNREACH #define ENETUNREACH (ZMQ_HAUSNUMERO + 12) #endif #ifndef ECONNABORTED #define ECONNABORTED (ZMQ_HAUSNUMERO + 13) #endif #ifndef ECONNRESET #define ECONNRESET (ZMQ_HAUSNUMERO + 14) #endif #ifndef ENOTCONN #define ENOTCONN (ZMQ_HAUSNUMERO + 15) #endif #ifndef ETIMEDOUT #define ETIMEDOUT (ZMQ_HAUSNUMERO + 16) #endif #ifndef EHOSTUNREACH #define EHOSTUNREACH (ZMQ_HAUSNUMERO + 17) #endif #ifndef ENETRESET #define ENETRESET (ZMQ_HAUSNUMERO + 18) #endif /* Native 0MQ error codes. */ #define EFSM (ZMQ_HAUSNUMERO + 51) #define ENOCOMPATPROTO (ZMQ_HAUSNUMERO + 52) #define ETERM (ZMQ_HAUSNUMERO + 53) #define EMTHREAD (ZMQ_HAUSNUMERO + 54) /* This function retrieves the errno as it is known to 0MQ library. The goal */ /* of this function is to make the code 100% portable, including where 0MQ */ /* compiled with certain CRT library (on Windows) is linked to an */ /* application that uses different CRT library. */ ZMQ_EXPORT int zmq_errno (void); /* Resolves system errors and 0MQ errors to human-readable string. */ ZMQ_EXPORT const char *zmq_strerror (int errnum); /* Run-time API version detection */ ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch); /******************************************************************************/ /* 0MQ infrastructure (a.k.a. context) initialisation & termination. */ /******************************************************************************/ /* Context options */ #define ZMQ_IO_THREADS 1 #define ZMQ_MAX_SOCKETS 2 #define ZMQ_SOCKET_LIMIT 3 #define ZMQ_THREAD_PRIORITY 3 #define ZMQ_THREAD_SCHED_POLICY 4 #define ZMQ_MAX_MSGSZ 5 /* Default for new contexts */ #define ZMQ_IO_THREADS_DFLT 1 #define ZMQ_MAX_SOCKETS_DFLT 1023 #define ZMQ_THREAD_PRIORITY_DFLT -1 #define ZMQ_THREAD_SCHED_POLICY_DFLT -1 ZMQ_EXPORT void *zmq_ctx_new (void); ZMQ_EXPORT int zmq_ctx_term (void *context); ZMQ_EXPORT int zmq_ctx_shutdown (void *context); ZMQ_EXPORT int zmq_ctx_set (void *context, int option, int optval); ZMQ_EXPORT int zmq_ctx_get (void *context, int option); /* Old (legacy) API */ ZMQ_EXPORT void *zmq_init (int io_threads); ZMQ_EXPORT int zmq_term (void *context); ZMQ_EXPORT int zmq_ctx_destroy (void *context); /******************************************************************************/ /* 0MQ message definition. */ /******************************************************************************/ /* Some architectures, like sparc64 and some variants of aarch64, enforce pointer * alignment and raise sigbus on violations. Make sure applications allocate * zmq_msg_t on addresses aligned on a pointer-size boundary to avoid this issue. */ typedef struct zmq_msg_t { #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) __declspec(align (8)) unsigned char _[64]; #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_ARM_ARMV7VE)) __declspec(align (4)) unsigned char _[64]; #elif defined(__GNUC__) || defined(__INTEL_COMPILER) \ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \ || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590) unsigned char _[64] __attribute__ ((aligned (sizeof (void *)))); #else unsigned char _[64]; #endif } zmq_msg_t; typedef void(zmq_free_fn) (void *data, void *hint); ZMQ_EXPORT int zmq_msg_init (zmq_msg_t *msg); ZMQ_EXPORT int zmq_msg_init_size (zmq_msg_t *msg, size_t size); ZMQ_EXPORT int zmq_msg_init_data ( zmq_msg_t *msg, void *data, size_t size, zmq_free_fn *ffn, void *hint); ZMQ_EXPORT int zmq_msg_send (zmq_msg_t *msg, void *s, int flags); ZMQ_EXPORT int zmq_msg_recv (zmq_msg_t *msg, void *s, int flags); ZMQ_EXPORT int zmq_msg_close (zmq_msg_t *msg); ZMQ_EXPORT int zmq_msg_move (zmq_msg_t *dest, zmq_msg_t *src); ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src); ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg); ZMQ_EXPORT size_t zmq_msg_size (const zmq_msg_t *msg); ZMQ_EXPORT int zmq_msg_more (const zmq_msg_t *msg); ZMQ_EXPORT int zmq_msg_get (const zmq_msg_t *msg, int property); ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int property, int optval); ZMQ_EXPORT const char *zmq_msg_gets (const zmq_msg_t *msg, const char *property); /******************************************************************************/ /* 0MQ socket definition. */ /******************************************************************************/ /* Socket types. */ #define ZMQ_PAIR 0 #define ZMQ_PUB 1 #define ZMQ_SUB 2 #define ZMQ_REQ 3 #define ZMQ_REP 4 #define ZMQ_DEALER 5 #define ZMQ_ROUTER 6 #define ZMQ_PULL 7 #define ZMQ_PUSH 8 #define ZMQ_XPUB 9 #define ZMQ_XSUB 10 #define ZMQ_STREAM 11 /* Deprecated aliases */ #define ZMQ_XREQ ZMQ_DEALER #define ZMQ_XREP ZMQ_ROUTER /* Socket options. */ #define ZMQ_AFFINITY 4 #define ZMQ_ROUTING_ID 5 #define ZMQ_SUBSCRIBE 6 #define ZMQ_UNSUBSCRIBE 7 #define ZMQ_RATE 8 #define ZMQ_RECOVERY_IVL 9 #define ZMQ_SNDBUF 11 #define ZMQ_RCVBUF 12 #define ZMQ_RCVMORE 13 #define ZMQ_FD 14 #define ZMQ_EVENTS 15 #define ZMQ_TYPE 16 #define ZMQ_LINGER 17 #define ZMQ_RECONNECT_IVL 18 #define ZMQ_BACKLOG 19 #define ZMQ_RECONNECT_IVL_MAX 21 #define ZMQ_MAXMSGSIZE 22 #define ZMQ_SNDHWM 23 #define ZMQ_RCVHWM 24 #define ZMQ_MULTICAST_HOPS 25 #define ZMQ_RCVTIMEO 27 #define ZMQ_SNDTIMEO 28 #define ZMQ_LAST_ENDPOINT 32 #define ZMQ_ROUTER_MANDATORY 33 #define ZMQ_TCP_KEEPALIVE 34 #define ZMQ_TCP_KEEPALIVE_CNT 35 #define ZMQ_TCP_KEEPALIVE_IDLE 36 #define ZMQ_TCP_KEEPALIVE_INTVL 37 #define ZMQ_IMMEDIATE 39 #define ZMQ_XPUB_VERBOSE 40 #define ZMQ_ROUTER_RAW 41 #define ZMQ_IPV6 42 #define ZMQ_MECHANISM 43 #define ZMQ_PLAIN_SERVER 44 #define ZMQ_PLAIN_USERNAME 45 #define ZMQ_PLAIN_PASSWORD 46 #define ZMQ_CURVE_SERVER 47 #define ZMQ_CURVE_PUBLICKEY 48 #define ZMQ_CURVE_SECRETKEY 49 #define ZMQ_CURVE_SERVERKEY 50 #define ZMQ_PROBE_ROUTER 51 #define ZMQ_REQ_CORRELATE 52 #define ZMQ_REQ_RELAXED 53 #define ZMQ_CONFLATE 54 #define ZMQ_ZAP_DOMAIN 55 #define ZMQ_ROUTER_HANDOVER 56 #define ZMQ_TOS 57 #define ZMQ_CONNECT_ROUTING_ID 61 #define ZMQ_GSSAPI_SERVER 62 #define ZMQ_GSSAPI_PRINCIPAL 63 #define ZMQ_GSSAPI_SERVICE_PRINCIPAL 64 #define ZMQ_GSSAPI_PLAINTEXT 65 #define ZMQ_HANDSHAKE_IVL 66 #define ZMQ_SOCKS_PROXY 68 #define ZMQ_XPUB_NODROP 69 #define ZMQ_BLOCKY 70 #define ZMQ_XPUB_MANUAL 71 #define ZMQ_XPUB_WELCOME_MSG 72 #define ZMQ_STREAM_NOTIFY 73 #define ZMQ_INVERT_MATCHING 74 #define ZMQ_HEARTBEAT_IVL 75 #define ZMQ_HEARTBEAT_TTL 76 #define ZMQ_HEARTBEAT_TIMEOUT 77 #define ZMQ_XPUB_VERBOSER 78 #define ZMQ_CONNECT_TIMEOUT 79 #define ZMQ_TCP_MAXRT 80 #define ZMQ_THREAD_SAFE 81 #define ZMQ_MULTICAST_MAXTPDU 84 #define ZMQ_VMCI_BUFFER_SIZE 85 #define ZMQ_VMCI_BUFFER_MIN_SIZE 86 #define ZMQ_VMCI_BUFFER_MAX_SIZE 87 #define ZMQ_VMCI_CONNECT_TIMEOUT 88 #define ZMQ_USE_FD 89 /* Message options */ #define ZMQ_MORE 1 #define ZMQ_SHARED 3 /* Send/recv options. */ #define ZMQ_DONTWAIT 1 #define ZMQ_SNDMORE 2 /* Security mechanisms */ #define ZMQ_NULL 0 #define ZMQ_PLAIN 1 #define ZMQ_CURVE 2 #define ZMQ_GSSAPI 3 /* RADIO-DISH protocol */ #define ZMQ_GROUP_MAX_LENGTH 15 /* Deprecated options and aliases */ #define ZMQ_IDENTITY ZMQ_ROUTING_ID #define ZMQ_CONNECT_RID ZMQ_CONNECT_ROUTING_ID #define ZMQ_TCP_ACCEPT_FILTER 38 #define ZMQ_IPC_FILTER_PID 58 #define ZMQ_IPC_FILTER_UID 59 #define ZMQ_IPC_FILTER_GID 60 #define ZMQ_IPV4ONLY 31 #define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE #define ZMQ_NOBLOCK ZMQ_DONTWAIT #define ZMQ_FAIL_UNROUTABLE ZMQ_ROUTER_MANDATORY #define ZMQ_ROUTER_BEHAVIOR ZMQ_ROUTER_MANDATORY /* Deprecated Message options */ #define ZMQ_SRCFD 2 /******************************************************************************/ /* 0MQ socket events and monitoring */ /******************************************************************************/ /* Socket transport events (TCP, IPC and TIPC only) */ #define ZMQ_EVENT_CONNECTED 0x0001 #define ZMQ_EVENT_CONNECT_DELAYED 0x0002 #define ZMQ_EVENT_CONNECT_RETRIED 0x0004 #define ZMQ_EVENT_LISTENING 0x0008 #define ZMQ_EVENT_BIND_FAILED 0x0010 #define ZMQ_EVENT_ACCEPTED 0x0020 #define ZMQ_EVENT_ACCEPT_FAILED 0x0040 #define ZMQ_EVENT_CLOSED 0x0080 #define ZMQ_EVENT_CLOSE_FAILED 0x0100 #define ZMQ_EVENT_DISCONNECTED 0x0200 #define ZMQ_EVENT_MONITOR_STOPPED 0x0400 #define ZMQ_EVENT_ALL 0xFFFF ZMQ_EXPORT void *zmq_socket (void *, int type); ZMQ_EXPORT int zmq_close (void *s); ZMQ_EXPORT int zmq_setsockopt (void *s, int option, const void *optval, size_t optvallen); ZMQ_EXPORT int zmq_getsockopt (void *s, int option, void *optval, size_t *optvallen); ZMQ_EXPORT int zmq_bind (void *s, const char *addr); ZMQ_EXPORT int zmq_connect (void *s, const char *addr); ZMQ_EXPORT int zmq_unbind (void *s, const char *addr); ZMQ_EXPORT int zmq_disconnect (void *s, const char *addr); ZMQ_EXPORT int zmq_send (void *s, const void *buf, size_t len, int flags); ZMQ_EXPORT int zmq_send_const (void *s, const void *buf, size_t len, int flags); ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags); ZMQ_EXPORT int zmq_socket_monitor (void *s, const char *addr, int events); /******************************************************************************/ /* Deprecated I/O multiplexing. Prefer using zmq_poller API */ /******************************************************************************/ #define ZMQ_POLLIN 1 #define ZMQ_POLLOUT 2 #define ZMQ_POLLERR 4 #define ZMQ_POLLPRI 8 typedef struct zmq_pollitem_t { void *socket; #if defined _WIN32 SOCKET fd; #else int fd; #endif short events; short revents; } zmq_pollitem_t; #define ZMQ_POLLITEMS_DFLT 16 ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout); /******************************************************************************/ /* Message proxying */ /******************************************************************************/ ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture); ZMQ_EXPORT int zmq_proxy_steerable (void *frontend, void *backend, void *capture, void *control); /******************************************************************************/ /* Probe library capabilities */ /******************************************************************************/ #define ZMQ_HAS_CAPABILITIES 1 ZMQ_EXPORT int zmq_has (const char *capability); /* Deprecated aliases */ #define ZMQ_STREAMER 1 #define ZMQ_FORWARDER 2 #define ZMQ_QUEUE 3 /* Deprecated methods */ ZMQ_EXPORT int zmq_device (int type, void *frontend, void *backend); ZMQ_EXPORT int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags); ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags); struct iovec; ZMQ_EXPORT int zmq_sendiov (void *s, struct iovec *iov, size_t count, int flags); ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov, size_t *count, int flags); /******************************************************************************/ /* Encryption functions */ /******************************************************************************/ /* Encode data with Z85 encoding. Returns encoded data */ ZMQ_EXPORT char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size); /* Decode data with Z85 encoding. Returns decoded data */ ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, const char *string); /* Generate z85-encoded public and private keypair with tweetnacl/libsodium. */ /* Returns 0 on success. */ ZMQ_EXPORT int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key); /* Derive the z85-encoded public key from the z85-encoded secret key. */ /* Returns 0 on success. */ ZMQ_EXPORT int zmq_curve_public (char *z85_public_key, const char *z85_secret_key); /******************************************************************************/ /* Atomic utility methods */ /******************************************************************************/ ZMQ_EXPORT void *zmq_atomic_counter_new (void); ZMQ_EXPORT void zmq_atomic_counter_set (void *counter, int value); ZMQ_EXPORT int zmq_atomic_counter_inc (void *counter); ZMQ_EXPORT int zmq_atomic_counter_dec (void *counter); ZMQ_EXPORT int zmq_atomic_counter_value (void *counter); ZMQ_EXPORT void zmq_atomic_counter_destroy (void **counter_p); /******************************************************************************/ /* These functions are not documented by man pages -- use at your own risk. */ /* If you need these to be part of the formal ZMQ API, then (a) write a man */ /* page, and (b) write a test case in tests. */ /******************************************************************************/ /* Helper functions are used by perf tests so that they don't have to care */ /* about minutiae of time-related functions on different OS platforms. */ /* Starts the stopwatch. Returns the handle to the watch. */ ZMQ_EXPORT void *zmq_stopwatch_start (void); #ifdef ZMQ_BUILD_DRAFT_API /* Returns the number of microseconds elapsed since the stopwatch was */ /* started, but does not stop or deallocate the stopwatch. */ ZMQ_EXPORT unsigned long zmq_stopwatch_intermediate (void *watch_); #endif /* Stops the stopwatch. Returns the number of microseconds elapsed since */ /* the stopwatch was started, and deallocates that watch. */ ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_); /* Sleeps for specified number of seconds. */ ZMQ_EXPORT void zmq_sleep (int seconds_); typedef void(zmq_thread_fn) (void *); /* Start a thread. Returns a handle to the thread. */ ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn *func, void *arg); /* Wait for thread to complete then free up resources. */ ZMQ_EXPORT void zmq_threadclose (void *thread); /******************************************************************************/ /* These functions are DRAFT and disabled in stable releases, and subject to */ /* change at ANY time until declared stable. */ /******************************************************************************/ #ifdef ZMQ_BUILD_DRAFT_API /* DRAFT Socket types. */ #define ZMQ_SERVER 12 #define ZMQ_CLIENT 13 #define ZMQ_RADIO 14 #define ZMQ_DISH 15 #define ZMQ_GATHER 16 #define ZMQ_SCATTER 17 #define ZMQ_DGRAM 18 /* DRAFT Socket options. */ #define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90 #define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91 #define ZMQ_BINDTODEVICE 92 #define ZMQ_ZAP_ENFORCE_DOMAIN 93 #define ZMQ_LOOPBACK_FASTPATH 94 #define ZMQ_METADATA 95 /* DRAFT 0MQ socket events and monitoring */ /* Unspecified system errors during handshake. Event value is an errno. */ #define ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL 0x0800 /* Handshake complete successfully with successful authentication (if * * enabled). Event value is unused. */ #define ZMQ_EVENT_HANDSHAKE_SUCCEEDED 0x1000 /* Protocol errors between ZMTP peers or between server and ZAP handler. * * Event value is one of ZMQ_PROTOCOL_ERROR_* */ #define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL 0x2000 /* Failed authentication requests. Event value is the numeric ZAP status * * code, i.e. 300, 400 or 500. */ #define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH 0x4000 #define ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED 0x10000000 #define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND 0x10000001 #define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE 0x10000002 #define ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE 0x10000003 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED 0x10000011 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE 0x10000012 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO 0x10000013 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE 0x10000014 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR 0x10000015 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY 0x10000016 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME 0x10000017 #define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA 0x10000018 // the following two may be due to erroneous configuration of a peer #define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC 0x11000001 #define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH 0x11000002 #define ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED 0x20000000 #define ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY 0x20000001 #define ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID 0x20000002 #define ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION 0x20000003 #define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE 0x20000004 #define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA 0x20000005 /* DRAFT Context options */ #define ZMQ_MSG_T_SIZE 6 #define ZMQ_THREAD_AFFINITY_CPU_ADD 7 #define ZMQ_THREAD_AFFINITY_CPU_REMOVE 8 #define ZMQ_THREAD_NAME_PREFIX 9 #define ZMQ_ZERO_COPY_RECV 10 /* DRAFT Socket methods. */ ZMQ_EXPORT int zmq_join (void *s, const char *group); ZMQ_EXPORT int zmq_leave (void *s, const char *group); /* DRAFT Msg methods. */ ZMQ_EXPORT int zmq_msg_set_routing_id (zmq_msg_t *msg, uint32_t routing_id); ZMQ_EXPORT uint32_t zmq_msg_routing_id (zmq_msg_t *msg); ZMQ_EXPORT int zmq_msg_set_group (zmq_msg_t *msg, const char *group); ZMQ_EXPORT const char *zmq_msg_group (zmq_msg_t *msg); /* DRAFT Msg property names. */ #define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id" #define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type" #define ZMQ_MSG_PROPERTY_USER_ID "User-Id" #define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address" /******************************************************************************/ /* Poller polling on sockets,fd and thread-safe sockets */ /******************************************************************************/ #define ZMQ_HAVE_POLLER typedef struct zmq_poller_event_t { void *socket; #if defined _WIN32 SOCKET fd; #else int fd; #endif void *user_data; short events; } zmq_poller_event_t; ZMQ_EXPORT void *zmq_poller_new (void); ZMQ_EXPORT int zmq_poller_destroy (void **poller_p); ZMQ_EXPORT int zmq_poller_add (void *poller, void *socket, void *user_data, short events); ZMQ_EXPORT int zmq_poller_modify (void *poller, void *socket, short events); ZMQ_EXPORT int zmq_poller_remove (void *poller, void *socket); ZMQ_EXPORT int zmq_poller_wait (void *poller, zmq_poller_event_t *event, long timeout); ZMQ_EXPORT int zmq_poller_wait_all (void *poller, zmq_poller_event_t *events, int n_events, long timeout); #if defined _WIN32 ZMQ_EXPORT int zmq_poller_add_fd (void *poller, SOCKET fd, void *user_data, short events); ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, SOCKET fd, short events); ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, SOCKET fd); #else ZMQ_EXPORT int zmq_poller_add_fd (void *poller, int fd, void *user_data, short events); ZMQ_EXPORT int zmq_poller_modify_fd (void *poller, int fd, short events); ZMQ_EXPORT int zmq_poller_remove_fd (void *poller, int fd); #endif ZMQ_EXPORT int zmq_socket_get_peer_state (void *socket, const void *routing_id, size_t routing_id_size); /******************************************************************************/ /* Scheduling timers */ /******************************************************************************/ #define ZMQ_HAVE_TIMERS typedef void(zmq_timer_fn) (int timer_id, void *arg); ZMQ_EXPORT void *zmq_timers_new (void); ZMQ_EXPORT int zmq_timers_destroy (void **timers_p); ZMQ_EXPORT int zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg); ZMQ_EXPORT int zmq_timers_cancel (void *timers, int timer_id); ZMQ_EXPORT int zmq_timers_set_interval (void *timers, int timer_id, size_t interval); ZMQ_EXPORT int zmq_timers_reset (void *timers, int timer_id); ZMQ_EXPORT long zmq_timers_timeout (void *timers); ZMQ_EXPORT int zmq_timers_execute (void *timers); /******************************************************************************/ /* GSSAPI definitions */ /******************************************************************************/ /* GSSAPI principal name types */ #define ZMQ_GSSAPI_NT_HOSTBASED 0 #define ZMQ_GSSAPI_NT_USER_NAME 1 #define ZMQ_GSSAPI_NT_KRB5_PRINCIPAL 2 #endif // ZMQ_BUILD_DRAFT_API #undef ZMQ_EXPORT #ifdef __cplusplus } #endif #endif zeromq-4.2.5/include/zmq_utils.h0000664000372000037200000000454113255253220017567 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ /* This file is deprecated, and all its functionality provided by zmq.h */ /* Note that -Wpedantic compilation requires GCC to avoid using its custom extensions such as #warning, hence the trick below. Also, pragmas for warnings or other messages are not standard, not portable, and not all compilers even have an equivalent concept. So in the worst case, this include file is treated as silently empty. */ #if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) \ || defined(_MSC_VER) #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic push #pragma GCC diagnostic warning "-Wcpp" #pragma GCC diagnostic ignored "-Werror" #pragma GCC diagnostic ignored "-Wall" #endif #pragma message( \ "Warning: zmq_utils.h is deprecated. All its functionality is provided by zmq.h.") #if defined(__GNUC__) || defined(__GNUG__) #pragma GCC diagnostic pop #endif #endif zeromq-4.2.5/COPYING0000664000372000037200000010451513255253220015001 0ustar00travistravis00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . zeromq-4.2.5/config/0000775000372000037200000000000013255253302015206 5ustar00travistravis00000000000000zeromq-4.2.5/config/lt~obsolete.m40000644000372000037200000001375613255253266020045 0ustar00travistravis00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) zeromq-4.2.5/config/depcomp0000755000372000037200000005601613255253274016601 0ustar00travistravis00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: zeromq-4.2.5/config/test-driver0000755000372000037200000001027713255253274017421 0ustar00travistravis00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2013-07-13.22; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: zeromq-4.2.5/config/ltsugar.m40000644000372000037200000001042413255253266017141 0ustar00travistravis00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) zeromq-4.2.5/config/compile0000755000372000037200000001624513255253273016601 0ustar00travistravis00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: zeromq-4.2.5/config/missing0000755000372000037200000001533013255253274016615 0ustar00travistravis00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: zeromq-4.2.5/config/config.guess0000755000372000037200000013036113255253273017537 0ustar00travistravis00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: zeromq-4.2.5/config/ltversion.m40000644000372000037200000000126213255253266017505 0ustar00travistravis00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) zeromq-4.2.5/config/ltmain.sh0000644000372000037200000105204413255253265017042 0ustar00travistravis00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 zeromq-4.2.5/config/config.sub0000755000372000037200000010535413255253273017206 0ustar00travistravis00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: zeromq-4.2.5/config/install-sh0000755000372000037200000003325513255253274017230 0ustar00travistravis00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: zeromq-4.2.5/config/libtool.m40000644000372000037200000106011113255253266017123 0ustar00travistravis00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS zeromq-4.2.5/config/ltoptions.m40000644000372000037200000003007313255253266017515 0ustar00travistravis00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) zeromq-4.2.5/autogen.sh0000775000372000037200000000325213255253220015743 0ustar00travistravis00000000000000#!/bin/sh # Copyright (c) 2007-2009 iMatix Corporation # Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file # # This file is part of 0MQ. # # 0MQ is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # 0MQ is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . # Script to generate all required files from fresh git checkout. # Debian and Ubuntu do not ship libtool anymore, but OSX does not ship libtoolize. command -v libtoolize >/dev/null 2>&1 if [ $? -ne 0 ]; then command -v libtool >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "autogen.sh: error: could not find libtool. libtool is required to run autogen.sh." 1>&2 exit 1 fi fi command -v autoreconf >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "autogen.sh: error: could not find autoreconf. autoconf and automake are required to run autogen.sh." 1>&2 exit 1 fi mkdir -p ./config if [ $? -ne 0 ]; then echo "autogen.sh: error: could not create directory: ./config." 1>&2 exit 1 fi autoreconf --install --force --verbose -I config if [ $? -ne 0 ]; then echo "autogen.sh: error: autoreconf exited with status $?" 1>&2 exit 1 fi zeromq-4.2.5/m4/0000775000372000037200000000000013255253302014261 5ustar00travistravis00000000000000zeromq-4.2.5/m4/ax_code_coverage.m40000664000372000037200000002707413255253220020011 0ustar00travistravis00000000000000# =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html # =========================================================================== # # SYNOPSIS # # AX_CODE_COVERAGE() # # DESCRIPTION # # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every # build target (program or library) which should be built with code # coverage support. Also defines CODE_COVERAGE_RULES which should be # substituted in your Makefile; and $enable_code_coverage which can be # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined # and substituted, and corresponds to the value of the # --enable-code-coverage option, which defaults to being disabled. # # Test also for gcov program and create GCOV variable that could be # substituted. # # Note that all optimization flags in CFLAGS must be disabled when code # coverage is enabled. # # Usage example: # # configure.ac: # # AX_CODE_COVERAGE # # Makefile.am: # # @CODE_COVERAGE_RULES@ # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... # # This results in a "check-code-coverage" rule being added to any # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module # has been configured with --enable-code-coverage). Running `make # check-code-coverage` in that directory will run the module's test suite # (`make check`) and build a code coverage report detailing the code which # was touched, then print the URI for the report. # # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is # deprecated. They have the same value. # # This code was derived from Makefile.decl in GLib, originally licenced # under LGPLv2.1+. # # LICENSE # # Copyright (c) 2012, 2016 Philip Withnall # Copyright (c) 2012 Xan Lopez # Copyright (c) 2012 Christian Persch # Copyright (c) 2012 Paolo Borelli # Copyright (c) 2012 Dan Winship # Copyright (c) 2015 Bastien ROUCARIES # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or (at # your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . #serial 25 AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage AC_REQUIRE([AC_PROG_SED]) # allow to override gcov location AC_ARG_WITH([gcov], [AS_HELP_STRING([--with-gcov[=GCOV]], [use given GCOV for coverage (GCOV=gcov).])], [_AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov], [_AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov]) AC_MSG_CHECKING([whether to build with code coverage support]) AC_ARG_ENABLE([code-coverage], AS_HELP_STRING([--enable-code-coverage], [Whether to enable code coverage support]),, enable_code_coverage=no) AM_CONDITIONAL([CODE_COVERAGE_ENABLED], [test x$enable_code_coverage = xyes]) AC_SUBST([CODE_COVERAGE_ENABLED], [$enable_code_coverage]) AC_MSG_RESULT($enable_code_coverage) AS_IF([ test "$enable_code_coverage" = "yes" ], [ # check for gcov AC_CHECK_TOOL([GCOV], [$_AX_CODE_COVERAGE_GCOV_PROG_WITH], [:]) AS_IF([test "X$GCOV" = "X:"], [AC_MSG_ERROR([gcov is needed to do coverage])]) AC_SUBST([GCOV]) dnl Check if gcc is being used AS_IF([ test "$GCC" = "no" ], [ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) ]) AC_CHECK_PROG([LCOV], [lcov], [lcov]) AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) AS_IF([ test -z "$LCOV" ], [ AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) ]) AS_IF([ test -z "$GENHTML" ], [ AC_MSG_ERROR([Could not find genhtml from the lcov package]) ]) dnl Build the code coverage flags dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_LIBS="-lgcov" CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS]) AC_SUBST([CODE_COVERAGE_CXXFLAGS]) AC_SUBST([CODE_COVERAGE_LIBS]) AC_SUBST([CODE_COVERAGE_LDFLAGS]) [CODE_COVERAGE_RULES_CHECK=' -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture '] [CODE_COVERAGE_RULES_CAPTURE=' $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" '] [CODE_COVERAGE_RULES_CLEAN=' clean: code-coverage-clean distclean: code-coverage-clean code-coverage-clean: -$(LCOV) --directory $(top_builddir) -z -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete '] ], [ [CODE_COVERAGE_RULES_CHECK=' @echo "Need to reconfigure with --enable-code-coverage" '] CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" CODE_COVERAGE_RULES_CLEAN='' ]) [CODE_COVERAGE_RULES=' # Code coverage # # Optional: # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. # Multiple directories may be specified, separated by whitespace. # (Default: $(top_builddir)) # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated # by lcov for code coverage. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage # reports to be created. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, # set to 0 to disable it and leave empty to stay with the default. # (Default: empty) # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering # lcov instance. (Default: empty) # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore # # The generated report will be titled using the $(PACKAGE_NAME) and # $(PACKAGE_VERSION). In order to add the current git hash to the title, # use the git-version-gen script, available online. # Optional variables CODE_COVERAGE_DIRECTORY ?= $(top_builddir) CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage CODE_COVERAGE_BRANCH_COVERAGE ?= CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) CODE_COVERAGE_IGNORE_PATTERN ?= GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ $(CODE_COVERAGE_OUTPUT_FILE); code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ $(CODE_COVERAGE_IGNORE_PATTERN); code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); code_coverage_quiet = $(code_coverage_quiet_$(V)) code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) code_coverage_quiet_0 = --quiet # sanitizes the test-name: replaces with underscores: dashes and dots code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: '"$CODE_COVERAGE_RULES_CLEAN"' A''M_DISTCHECK_CONFIGURE_FLAGS ?= A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean '] AC_SUBST([CODE_COVERAGE_RULES]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([CODE_COVERAGE_RULES])]) ]) zeromq-4.2.5/m4/ax_check_compile_flag.m40000664000372000037200000000640213255253220020772 0ustar00travistravis00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 4 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) AS_VAR_IF(CACHEVAR,yes, [m4_default([$2], :)], [m4_default([$3], :)]) AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS zeromq-4.2.5/m4/ax_cxx_compile_stdcxx_11.m40000664000372000037200000000321113255253220021417 0ustar00travistravis00000000000000# ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 16 m4_include([m4/ax_cxx_compile_stdcxx.m4]) AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) zeromq-4.2.5/m4/ax_cxx_compile_stdcxx.m40000664000372000037200000003300013255253220021115 0ustar00travistravis00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) # or '14' (for the C++14 standard). # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 4 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl m4_if([$1], [11], [], [$1], [14], [], [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])], [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$2], [], [], [$2], [ext], [], [$2], [noext], [], [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], [$3], [optional], [ax_cxx_compile_cxx$1_required=false], [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) AC_LANG_PUSH([C++])dnl ac_success=no AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, ax_cv_cxx_compile_cxx$1, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [ax_cv_cxx_compile_cxx$1=yes], [ax_cv_cxx_compile_cxx$1=no])]) if test x$ax_cv_cxx_compile_cxx$1 = xyes; then ac_success=yes fi m4_if([$2], [noext], [], [dnl if test x$ac_success = xno; then for switch in -std=gnu++$1 -std=gnu++0x; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi]) m4_if([$2], [ext], [], [dnl if test x$ac_success = xno; then dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, [ac_save_CXX="$CXX" CXX="$CXX $switch" AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], [eval $cachevar=yes], [eval $cachevar=no]) CXX="$ac_save_CXX"]) if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi]) AC_LANG_POP([C++]) if test x$ax_cxx_compile_cxx$1_required = xtrue; then if test x$ac_success = xno; then AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) fi fi if test x$ac_success = xno; then HAVE_CXX$1=0 AC_MSG_NOTICE([No compiler with C++$1 support was found]) else HAVE_CXX$1=1 AC_DEFINE(HAVE_CXX$1,1, [define if the compiler supports basic C++$1 syntax]) fi AC_SUBST(HAVE_CXX$1) ]) dnl Test body for checking C++11 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) dnl Test body for checking C++14 support m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) dnl Tests for new features in C++11 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L ]]) dnl Tests for new features in C++14 m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ // If the compiler admits that it is not ready for C++14, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201402L #error "This is not a C++14 compiler" #else namespace cxx14 { namespace test_polymorphic_lambdas { int test() { const auto lambda = [](auto&&... args){ const auto istiny = [](auto x){ return (sizeof(x) == 1UL) ? 1 : 0; }; const int aretiny[] = { istiny(args)... }; return aretiny[0]; }; return lambda(1, 1L, 1.0f, '1'); } } namespace test_binary_literals { constexpr auto ivii = 0b0000000000101010; static_assert(ivii == 42, "wrong value"); } namespace test_generalized_constexpr { template < typename CharT > constexpr unsigned long strlen_c(const CharT *const s) noexcept { auto length = 0UL; for (auto p = s; *p; ++p) ++length; return length; } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("x") == 1UL, ""); static_assert(strlen_c("test") == 4UL, ""); static_assert(strlen_c("another\0test") == 7UL, ""); } namespace test_lambda_init_capture { int test() { auto x = 0; const auto lambda1 = [a = x](int b){ return a + b; }; const auto lambda2 = [a = lambda1(x)](){ return a; }; return lambda2(); } } namespace test_digit_seperators { constexpr auto ten_million = 100'000'000; static_assert(ten_million == 100000000, ""); } namespace test_return_type_deduction { auto f(int& x) { return x; } decltype(auto) g(int& x) { return x; } template < typename T1, typename T2 > struct is_same { static constexpr auto value = false; }; template < typename T > struct is_same { static constexpr auto value = true; }; int test() { auto x = 0; static_assert(is_same::value, ""); static_assert(is_same::value, ""); return x; } } } // namespace cxx14 #endif // __cplusplus >= 201402L ]]) zeromq-4.2.5/m4/ax_valgrind_check.m40000664000372000037200000001714113255253220020161 0ustar00travistravis00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html # =========================================================================== # # SYNOPSIS # # AX_VALGRIND_CHECK() # # DESCRIPTION # # Checks whether Valgrind is present and, if so, allows running `make # check` under a variety of Valgrind tools to check for memory and # threading errors. # # Defines VALGRIND_CHECK_RULES which should be substituted in your # Makefile; and $enable_valgrind which can be used in subsequent configure # output. VALGRIND_ENABLED is defined and substituted, and corresponds to # the value of the --enable-valgrind option, which defaults to being # enabled if Valgrind is installed and disabled otherwise. # # If unit tests are written using a shell script and automake's # LOG_COMPILER system, the $(VALGRIND) variable can be used within the # shell scripts to enable Valgrind, as described here: # # https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html # # Usage example: # # configure.ac: # # AX_VALGRIND_CHECK # # Makefile.am: # # @VALGRIND_CHECK_RULES@ # VALGRIND_SUPPRESSIONS_FILES = my-project.supp # EXTRA_DIST = my-project.supp # # This results in a "check-valgrind" rule being added to any Makefile.am # which includes "@VALGRIND_CHECK_RULES@" (assuming the module has been # configured with --enable-valgrind). Running `make check-valgrind` in # that directory will run the module's test suite (`make check`) once for # each of the available Valgrind tools (out of memcheck, helgrind, drd and # sgcheck), and will output results to test-suite-$toolname.log for each. # The target will succeed if there are zero errors and fail otherwise. # # Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in # memcheck, helgrind, drd and sgcheck. These are useful because often only # some of those tools can be ran cleanly on a codebase. # # The macro supports running with and without libtool. # # LICENSE # # Copyright (c) 2014, 2015, 2016 Philip Withnall # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 9 AC_DEFUN([AX_VALGRIND_CHECK],[ dnl Check for --enable-valgrind AC_ARG_ENABLE([valgrind], [AS_HELP_STRING([--enable-valgrind], [Whether to enable Valgrind on the unit tests])], [enable_valgrind=$enableval],[enable_valgrind=]) AS_IF([test "$enable_valgrind" != "no"],[ # Check for Valgrind. AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind]) AS_IF([test "$VALGRIND" = ""],[ AS_IF([test "$enable_valgrind" = "yes"],[ AC_MSG_ERROR([Could not find valgrind; either install it or reconfigure with --disable-valgrind]) ],[ enable_valgrind=no ]) ],[ enable_valgrind=yes ]) ]) AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"]) AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind]) # Check for Valgrind tools we care about. m4_define([valgrind_tool_list],[[memcheck], [helgrind], [drd], [exp-sgcheck]]) AS_IF([test "$VALGRIND" != ""],[ m4_foreach([vgtool],[valgrind_tool_list],[ m4_define([vgtooln],AS_TR_SH(vgtool)) m4_define([ax_cv_var],[ax_cv_valgrind_tool_]vgtooln) AC_CACHE_CHECK([for Valgrind tool ]vgtool,ax_cv_var,[ ax_cv_var= AS_IF([`$VALGRIND --tool=vgtool --help >/dev/null 2>&1`],[ ax_cv_var="vgtool" ]) ]) AC_SUBST([VALGRIND_HAVE_TOOL_]vgtooln,[$ax_cv_var]) ]) ]) [VALGRIND_CHECK_RULES=' # Valgrind check # # Optional: # - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions # files to load. (Default: empty) # - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. # (Default: --num-callers=30) # - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: # memcheck, helgrind, drd, sgcheck). (Default: various) # Optional variables VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) VALGRIND_FLAGS ?= --num-callers=30 VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no VALGRIND_helgrind_FLAGS ?= --history-level=approx VALGRIND_drd_FLAGS ?= VALGRIND_sgcheck_FLAGS ?= # Internal use valgrind_tools = memcheck helgrind drd sgcheck valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) valgrind_quiet = $(valgrind_quiet_$(V)) valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) valgrind_quiet_0 = --quiet # Support running with and without libtool. ifneq ($(LIBTOOL),) valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute else valgrind_lt = endif # Use recursive makes in order to ignore errors during check check-valgrind: ifeq ($(VALGRIND_ENABLED),yes) -$(foreach tool,$(valgrind_tools), \ $(if $(VALGRIND_HAVE_TOOL_$(tool))$(VALGRIND_HAVE_TOOL_exp_$(tool)), \ $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-tool VALGRIND_TOOL=$(tool); \ ) \ ) else @echo "Need to reconfigure with --enable-valgrind" endif # Valgrind running VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env VALGRIND=$(VALGRIND) \ G_SLICE=always-malloc,debug-blocks \ G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly VALGRIND_LOG_COMPILER = \ $(valgrind_lt) \ $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) check-valgrind-tool: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_$(VALGRIND_TOOL)_flags)" \ TEST_SUITE_LOG=test-suite-$(VALGRIND_TOOL).log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-memcheck: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_memcheck_flags)" \ TEST_SUITE_LOG=test-suite-memcheck.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-helgrind: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_helgrind_flags)" \ TEST_SUITE_LOG=test-suite-helgrind.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-drd: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_drd_flags)" \ TEST_SUITE_LOG=test-suite-drd.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-sgcheck: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_sgcheck_flags)" \ TEST_SUITE_LOG=test-suite-sgcheck.log else @echo "Need to reconfigure with --enable-valgrind" endif A''M_DISTCHECK_CONFIGURE_FLAGS ?= A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind MOSTLYCLEANFILES ?= MOSTLYCLEANFILES += $(valgrind_log_files) .PHONY: check-valgrind check-valgrind-tool '] AC_SUBST([VALGRIND_CHECK_RULES]) m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([VALGRIND_CHECK_RULES])]) ]) zeromq-4.2.5/COPYING.LESSER0000664000372000037200000002047013255253220015772 0ustar00travistravis00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. -------------------------------------------------------------------------------- SPECIAL EXCEPTION GRANTED BY COPYRIGHT HOLDERS As a special exception, copyright holders give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. Note: this exception relieves you of any obligations under sections 4 and 5 of this license, and section 6 of the GNU General Public License. zeromq-4.2.5/perf/0000775000372000037200000000000013255253302014675 5ustar00travistravis00000000000000zeromq-4.2.5/perf/inproc_thr.cpp0000664000372000037200000001510513255253220017551 0ustar00travistravis00000000000000/* Copyright (c) 2007-2012 iMatix Corporation Copyright (c) 2009-2011 250bpm s.r.o. Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include #include #include "platform.hpp" #if defined ZMQ_HAVE_WINDOWS #include #include #else #include #endif static int message_count; static size_t message_size; #if defined ZMQ_HAVE_WINDOWS static unsigned int __stdcall worker (void *ctx_) #else static void *worker (void *ctx_) #endif { void *s; int rc; int i; zmq_msg_t msg; s = zmq_socket (ctx_, ZMQ_PUSH); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_connect (s, "inproc://thr_test"); if (rc != 0) { printf ("error in zmq_connect: %s\n", zmq_strerror (errno)); exit (1); } for (i = 0; i != message_count; i++) { rc = zmq_msg_init_size (&msg, message_size); if (rc != 0) { printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno)); exit (1); } #if defined ZMQ_MAKE_VALGRIND_HAPPY memset (zmq_msg_data (&msg), 0, message_size); #endif rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); exit (1); } } rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); exit (1); } #if defined ZMQ_HAVE_WINDOWS return 0; #else return NULL; #endif } int main (int argc, char *argv[]) { #if defined ZMQ_HAVE_WINDOWS HANDLE local_thread; #else pthread_t local_thread; #endif void *ctx; void *s; int rc; int i; zmq_msg_t msg; void *watch; unsigned long elapsed; unsigned long throughput; double megabits; if (argc != 3) { printf ("usage: inproc_thr \n"); return 1; } message_size = atoi (argv[1]); message_count = atoi (argv[2]); ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_PULL); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_bind (s, "inproc://thr_test"); if (rc != 0) { printf ("error in zmq_bind: %s\n", zmq_strerror (errno)); return -1; } #if defined ZMQ_HAVE_WINDOWS local_thread = (HANDLE) _beginthreadex (NULL, 0, worker, ctx, 0, NULL); if (local_thread == 0) { printf ("error in _beginthreadex\n"); return -1; } #else rc = pthread_create (&local_thread, NULL, worker, ctx); if (rc != 0) { printf ("error in pthread_create: %s\n", zmq_strerror (rc)); return -1; } #endif rc = zmq_msg_init (&msg); if (rc != 0) { printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno)); return -1; } printf ("message size: %d [B]\n", (int) message_size); printf ("message count: %d\n", (int) message_count); rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } watch = zmq_stopwatch_start (); for (i = 0; i != message_count - 1; i++) { rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } } elapsed = zmq_stopwatch_stop (watch); if (elapsed == 0) elapsed = 1; rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } #if defined ZMQ_HAVE_WINDOWS DWORD rc2 = WaitForSingleObject (local_thread, INFINITE); if (rc2 == WAIT_FAILED) { printf ("error in WaitForSingleObject\n"); return -1; } BOOL rc3 = CloseHandle (local_thread); if (rc3 == 0) { printf ("error in CloseHandle\n"); return -1; } #else rc = pthread_join (local_thread, NULL); if (rc != 0) { printf ("error in pthread_join: %s\n", zmq_strerror (rc)); return -1; } #endif rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } throughput = (unsigned long) ((double) message_count / (double) elapsed * 1000000); megabits = (double) (throughput * message_size * 8) / 1000000; printf ("mean throughput: %d [msg/s]\n", (int) throughput); printf ("mean throughput: %.3f [Mb/s]\n", (double) megabits); return 0; } zeromq-4.2.5/perf/local_lat.cpp0000664000372000037200000000661613255253220017343 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include int main (int argc, char *argv[]) { const char *bind_to; int roundtrip_count; size_t message_size; void *ctx; void *s; int rc; int i; zmq_msg_t msg; if (argc != 4) { printf ("usage: local_lat " "\n"); return 1; } bind_to = argv[1]; message_size = atoi (argv[2]); roundtrip_count = atoi (argv[3]); ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_REP); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_bind (s, bind_to); if (rc != 0) { printf ("error in zmq_bind: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_msg_init (&msg); if (rc != 0) { printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno)); return -1; } for (i = 0; i != roundtrip_count; i++) { rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); return -1; } } rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } zmq_sleep (1); rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } return 0; } zeromq-4.2.5/perf/remote_lat.cpp0000664000372000037200000000755513255253220017547 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include #include int main (int argc, char *argv[]) { const char *connect_to; int roundtrip_count; size_t message_size; void *ctx; void *s; int rc; int i; zmq_msg_t msg; void *watch; unsigned long elapsed; double latency; if (argc != 4) { printf ("usage: remote_lat " "\n"); return 1; } connect_to = argv[1]; message_size = atoi (argv[2]); roundtrip_count = atoi (argv[3]); ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_REQ); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_connect (s, connect_to); if (rc != 0) { printf ("error in zmq_connect: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_msg_init_size (&msg, message_size); if (rc != 0) { printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno)); return -1; } memset (zmq_msg_data (&msg), 0, message_size); watch = zmq_stopwatch_start (); for (i = 0; i != roundtrip_count; i++) { rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } } elapsed = zmq_stopwatch_stop (watch); rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } latency = (double) elapsed / (roundtrip_count * 2); printf ("message size: %d [B]\n", (int) message_size); printf ("roundtrip count: %d\n", (int) roundtrip_count); printf ("average latency: %.3f [us]\n", (double) latency); rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } return 0; } zeromq-4.2.5/perf/remote_thr.cpp0000664000372000037200000001064513255253220017556 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include #include // keys are arbitrary but must match local_lat.cpp const char server_pubkey[] = "DX4nh=yUn{-9ugra0X3Src4SU-4xTgqxcYY.+ " " []\n"); return 1; } connect_to = argv[1]; message_size = atoi (argv[2]); message_count = atoi (argv[3]); if (argc >= 5 && atoi (argv[4])) { curve = 1; } ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_PUSH); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } // Add your socket options here. // For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM. if (curve) { rc = zmq_setsockopt (s, ZMQ_CURVE_SECRETKEY, client_prvkey, sizeof (client_prvkey)); if (rc != 0) { printf ("error in zmq_setsockoopt: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_setsockopt (s, ZMQ_CURVE_PUBLICKEY, client_pubkey, sizeof (client_pubkey)); if (rc != 0) { printf ("error in zmq_setsockoopt: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_setsockopt (s, ZMQ_CURVE_SERVERKEY, server_pubkey, sizeof (server_pubkey)); if (rc != 0) { printf ("error in zmq_setsockoopt: %s\n", zmq_strerror (errno)); return -1; } } rc = zmq_connect (s, connect_to); if (rc != 0) { printf ("error in zmq_connect: %s\n", zmq_strerror (errno)); return -1; } for (i = 0; i != message_count; i++) { rc = zmq_msg_init_size (&msg, message_size); if (rc != 0) { printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } } rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } return 0; } zeromq-4.2.5/perf/local_thr.cpp0000664000372000037200000001163113255253220017351 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include // keys are arbitrary but must match remote_lat.cpp const char server_prvkey[] = "{X}#>t#jRGaQ}gMhv=30r(Mw+87YGs+5%kh=i@f8"; int main (int argc, char *argv[]) { const char *bind_to; int message_count; size_t message_size; void *ctx; void *s; int rc; int i; zmq_msg_t msg; void *watch; unsigned long elapsed; double throughput; double megabits; int curve = 0; if (argc != 4 && argc != 5) { printf ("usage: local_thr " "[]\n"); return 1; } bind_to = argv[1]; message_size = atoi (argv[2]); message_count = atoi (argv[3]); if (argc >= 5 && atoi (argv[4])) { curve = 1; } ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_PULL); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } // Add your socket options here. // For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM. if (curve) { rc = zmq_setsockopt (s, ZMQ_CURVE_SECRETKEY, server_prvkey, sizeof (server_prvkey)); if (rc != 0) { printf ("error in zmq_setsockoopt: %s\n", zmq_strerror (errno)); return -1; } int server = 1; rc = zmq_setsockopt (s, ZMQ_CURVE_SERVER, &server, sizeof (int)); if (rc != 0) { printf ("error in zmq_setsockoopt: %s\n", zmq_strerror (errno)); return -1; } } rc = zmq_bind (s, bind_to); if (rc != 0) { printf ("error in zmq_bind: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_msg_init (&msg); if (rc != 0) { printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } watch = zmq_stopwatch_start (); for (i = 0; i != message_count - 1; i++) { rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } } elapsed = zmq_stopwatch_stop (watch); if (elapsed == 0) elapsed = 1; rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } throughput = ((double) message_count / (double) elapsed * 1000000); megabits = ((double) throughput * message_size * 8) / 1000000; printf ("message size: %d [B]\n", (int) message_size); printf ("message count: %d\n", (int) message_count); printf ("mean throughput: %d [msg/s]\n", (int) throughput); printf ("mean throughput: %.3f [Mb/s]\n", (double) megabits); rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } return 0; } zeromq-4.2.5/perf/inproc_lat.cpp0000664000372000037200000001433213255253220017535 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include #include #include "platform.hpp" #if defined ZMQ_HAVE_WINDOWS #include #include #else #include #endif static size_t message_size; static int roundtrip_count; #if defined ZMQ_HAVE_WINDOWS static unsigned int __stdcall worker (void *ctx_) #else static void *worker (void *ctx_) #endif { void *s; int rc; int i; zmq_msg_t msg; s = zmq_socket (ctx_, ZMQ_REP); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_connect (s, "inproc://lat_test"); if (rc != 0) { printf ("error in zmq_connect: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_msg_init (&msg); if (rc != 0) { printf ("error in zmq_msg_init: %s\n", zmq_strerror (errno)); exit (1); } for (i = 0; i != roundtrip_count; i++) { rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); exit (1); } } rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); exit (1); } rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); exit (1); } #if defined ZMQ_HAVE_WINDOWS return 0; #else return NULL; #endif } int main (int argc, char *argv[]) { #if defined ZMQ_HAVE_WINDOWS HANDLE local_thread; #else pthread_t local_thread; #endif void *ctx; void *s; int rc; int i; zmq_msg_t msg; void *watch; unsigned long elapsed; double latency; if (argc != 3) { printf ("usage: inproc_lat \n"); return 1; } message_size = atoi (argv[1]); roundtrip_count = atoi (argv[2]); ctx = zmq_init (1); if (!ctx) { printf ("error in zmq_init: %s\n", zmq_strerror (errno)); return -1; } s = zmq_socket (ctx, ZMQ_REQ); if (!s) { printf ("error in zmq_socket: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_bind (s, "inproc://lat_test"); if (rc != 0) { printf ("error in zmq_bind: %s\n", zmq_strerror (errno)); return -1; } #if defined ZMQ_HAVE_WINDOWS local_thread = (HANDLE) _beginthreadex (NULL, 0, worker, ctx, 0, NULL); if (local_thread == 0) { printf ("error in _beginthreadex\n"); return -1; } #else rc = pthread_create (&local_thread, NULL, worker, ctx); if (rc != 0) { printf ("error in pthread_create: %s\n", zmq_strerror (rc)); return -1; } #endif rc = zmq_msg_init_size (&msg, message_size); if (rc != 0) { printf ("error in zmq_msg_init_size: %s\n", zmq_strerror (errno)); return -1; } memset (zmq_msg_data (&msg), 0, message_size); printf ("message size: %d [B]\n", (int) message_size); printf ("roundtrip count: %d\n", (int) roundtrip_count); watch = zmq_stopwatch_start (); for (i = 0; i != roundtrip_count; i++) { rc = zmq_sendmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_sendmsg: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_recvmsg (s, &msg, 0); if (rc < 0) { printf ("error in zmq_recvmsg: %s\n", zmq_strerror (errno)); return -1; } if (zmq_msg_size (&msg) != message_size) { printf ("message of incorrect size received\n"); return -1; } } elapsed = zmq_stopwatch_stop (watch); rc = zmq_msg_close (&msg); if (rc != 0) { printf ("error in zmq_msg_close: %s\n", zmq_strerror (errno)); return -1; } latency = (double) elapsed / (roundtrip_count * 2); #if defined ZMQ_HAVE_WINDOWS DWORD rc2 = WaitForSingleObject (local_thread, INFINITE); if (rc2 == WAIT_FAILED) { printf ("error in WaitForSingleObject\n"); return -1; } BOOL rc3 = CloseHandle (local_thread); if (rc3 == 0) { printf ("error in CloseHandle\n"); return -1; } #else rc = pthread_join (local_thread, NULL); if (rc != 0) { printf ("error in pthread_join: %s\n", zmq_strerror (rc)); return -1; } #endif printf ("average latency: %.3f [us]\n", (double) latency); rc = zmq_close (s); if (rc != 0) { printf ("error in zmq_close: %s\n", zmq_strerror (errno)); return -1; } rc = zmq_ctx_term (ctx); if (rc != 0) { printf ("error in zmq_ctx_term: %s\n", zmq_strerror (errno)); return -1; } return 0; } zeromq-4.2.5/acinclude.m40000664000372000037200000012623313255253220016140 0ustar00travistravis00000000000000dnl ############################################################################## dnl # LIBZMQ_CONFIG_LIBTOOL # dnl # Configure libtool. Requires AC_CANONICAL_HOST # dnl ############################################################################## AC_DEFUN([LIBZMQ_CONFIG_LIBTOOL], [{ AC_REQUIRE([AC_CANONICAL_HOST]) # Libtool configuration for different targets case "${host_os}" in *mingw*|*cygwin*|*msys*) # Disable static build by default AC_DISABLE_STATIC ;; *) # Everything else with static enabled AC_ENABLE_STATIC ;; esac }]) dnl ############################################################################## dnl # LIBZMQ_CHECK_LANG_ICC([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using ICC # dnl # Adapted from http://software.intel.com/en-us/forums/showthread.php?t=67984 # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_LANG_ICC], [AC_CACHE_CHECK([whether we are using Intel _AC_LANG compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __INTEL_COMPILER error if not ICC #endif ]])], [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler="no" ; $2]) ])]) dnl ############################################################################## dnl # LIBZMQ_CHECK_LANG_SUN_STUDIO([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using Sun Studio # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_LANG_SUN_STUDIO], [AC_CACHE_CHECK([whether we are using Sun Studio _AC_LANG compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) error if not sun studio #endif ]])], [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler="no" ; $2]) ])]) dnl ############################################################################## dnl # LIBZMQ_CHECK_LANG_CLANG([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using clang # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_LANG_CLANG], [AC_CACHE_CHECK([whether we are using clang _AC_LANG compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __clang__ error if not clang #endif ]])], [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler="no" ; $2]) ])]) dnl ############################################################################## dnl # LIBZMQ_CHECK_LANG_GCC4([action-if-found], [action-if-not-found]) # dnl # Check if the current language is compiled using clang # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_LANG_GCC4], [AC_CACHE_CHECK([whether we are using gcc >= 4 _AC_LANG compiler], [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler], [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if (!defined __GNUC__ || __GNUC__ < 4) error if not gcc4 or higher #endif ]])], [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler="no" ; $2]) ])]) dnl ############################################################################## dnl # LIBZMQ_CHECK_DOC_BUILD # dnl # Check whether to build documentation and install man-pages # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_DOC_BUILD], [{ # Man pages are built/installed if asciidoc and xmlto are present # --with-docs=no overrides this AC_ARG_WITH([docs], AS_HELP_STRING([--without-docs], [Don't build and install man pages [default=build]]), [with_docs=$withval]) AC_ARG_WITH([documentation], [AS_HELP_STRING([--without-documentation], [Don't build and install man pages [default=build] DEPRECATED: use --without-docs])]) if test "x$with_documentation" = "xno"; then AC_MSG_WARN([--without-documentation is DEPRECATED and will be removed in the next release, use --without-docs]) fi if test "x$with_docs" = "xno" || test "x$with_documentation" = "xno"; then libzmq_build_doc="no" libzmq_install_man="no" else # Determine whether or not documentation should be built and installed. libzmq_build_doc="yes" libzmq_install_man="yes" # Check for asciidoc and xmlto and don't build the docs if these are not installed. AC_CHECK_PROG(libzmq_have_asciidoc, asciidoc, yes, no) AC_CHECK_PROG(libzmq_have_xmlto, xmlto, yes, no) if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then libzmq_build_doc="no" # Tarballs built with 'make dist' ship with prebuilt documentation. if ! test -f doc/zmq.7; then libzmq_install_man="no" AC_MSG_WARN([You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed.]) AC_MSG_WARN([Documentation will not be built and manual pages will not be installed.]) fi fi # Do not install man pages if on mingw if test "x$libzmq_on_mingw" = "xyes"; then libzmq_install_man="no" fi fi AC_MSG_CHECKING([whether to build documentation]) AC_MSG_RESULT([$libzmq_build_doc]) AC_MSG_CHECKING([whether to install manpages]) AC_MSG_RESULT([$libzmq_install_man]) AM_CONDITIONAL(BUILD_DOC, test "x$libzmq_build_doc" = "xyes") AM_CONDITIONAL(INSTALL_MAN, test "x$libzmq_install_man" = "xyes") }]) dnl ############################################################################## dnl # LIBZMQ_CHECK_LANG_COMPILER([action-if-found], [action-if-not-found]) # dnl # Check that compiler for the current language actually works # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_LANG_COMPILER], [{ # Test that compiler for the current language actually works AC_CACHE_CHECK([whether the _AC_LANG compiler works], [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works], [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="yes" ; $1], [libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works="no" ; $2]) ]) if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_compiler_works" != "xyes"; then AC_MSG_ERROR([Unable to find a working _AC_LANG compiler]) fi }]) dnl ############################################################################## dnl # LIBZMQ_CHECK_COMPILERS # dnl # Check compiler characteristics. This is so that we can AC_REQUIRE checks # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_COMPILERS], [{ # For that the compiler works and try to come up with the type AC_LANG_PUSH([C]) LIBZMQ_CHECK_LANG_COMPILER LIBZMQ_CHECK_LANG_ICC LIBZMQ_CHECK_LANG_SUN_STUDIO LIBZMQ_CHECK_LANG_CLANG LIBZMQ_CHECK_LANG_GCC4 AC_LANG_POP([C]) AC_LANG_PUSH(C++) LIBZMQ_CHECK_LANG_COMPILER LIBZMQ_CHECK_LANG_ICC LIBZMQ_CHECK_LANG_SUN_STUDIO LIBZMQ_CHECK_LANG_CLANG LIBZMQ_CHECK_LANG_GCC4 AC_LANG_POP([C++]) # Set GCC and GXX variables correctly if test "x$GCC" = "xyes"; then if test "xyes" = "x$libzmq_cv_c_intel_compiler"; then GCC="no" fi fi if test "x$GXX" = "xyes"; then if test "xyes" = "x$libzmq_cv_cxx_intel_compiler"; then GXX="no" fi fi }]) dnl ############################################################################ dnl # LIBZMQ_CHECK_LANG_FLAG([flag], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given flag. Works for C and C++ # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl ############################################################################ AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG], [{ AC_REQUIRE([AC_PROG_GREP]) AC_MSG_CHECKING([whether _AC_LANG compiler supports $1]) libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" case "x[]_AC_LANG_ABBREV" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $1" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $1" ;; *) AC_MSG_WARN([testing compiler characteristic on an unknown language]) ;; esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on [if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no" else eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="yes" fi], [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)="no"]) case "x[]_AC_LANG_ABBREV" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save # Call the action as the flags are restored AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [AC_MSG_RESULT(yes) ; $2], [AC_MSG_RESULT(no) ; $3]) }]) dnl #################################################################################### dnl # LIBZMQ_CHECK_LANG_FLAG_PREPEND([flag], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given flag. Works for C and C++ # dnl # This macro prepends the flag to CFLAGS or CPPFLAGS accordingly # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_[FLAG]=yes/no # dnl #################################################################################### AC_DEFUN([LIBZMQ_CHECK_LANG_FLAG_PREPEND], [{ LIBZMQ_CHECK_LANG_FLAG([$1]) case "x[]_AC_LANG_ABBREV" in xc) AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [CFLAGS="$1 $CFLAGS"; $2], $3) ;; xcxx) AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_flag_$1)[ = "xyes"], [CPPFLAGS="$1 $CPPFLAGS"; $2], $3) ;; esac }]) dnl ############################################################################## dnl # LIBZMQ_CHECK_ENABLE_DEBUG([action-if-found], [action-if-not-found]) # dnl # Check whether to enable debug build and set compiler flags accordingly # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_ENABLE_DEBUG], [{ # Require compiler specifics AC_REQUIRE([LIBZMQ_CHECK_COMPILERS]) # This flag is checked also in AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [enable debugging information [default=disabled]])]) AC_MSG_CHECKING(whether to enable debugging information) if test "x$enable_debug" = "xyes"; then # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ "x$libzmq_cv_c_intel_compiler" = "xyes" -o \ "x$libzmq_cv_c_clang_compiler" = "xyes"; then CFLAGS="-g -O0 " elif test "x$libzmq_cv_c_sun_studio_compiler" = "xyes"; then CFLAGS="-g0 " fi # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then CPPFLAGS="-g -O0 " CXXFLAGS="-g -O0 " # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then CPPFLAGS="-g0 " CXXFLAGS="-g0 " fi if test "x$ZMQ_ORIG_CFLAGS" != "xnone"; then CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" fi if test "x$ZMQ_ORIG_CPPFLAGS" != "xnone"; then CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" fi if test "x$ZMQ_ORIG_CXXFLAGS" != "xnone"; then CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" fi AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi }]) dnl ############################################################################## dnl # LIBZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) # dnl # Check whether to build with code coverage # dnl ############################################################################## AC_DEFUN([LIBZMQ_WITH_GCOV], [{ # Require compiler specifics AC_REQUIRE([LIBZMQ_CHECK_COMPILERS]) AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no], [with GCC Code Coverage reporting.])], [ZMQ_GCOV="$withval"]) AC_MSG_CHECKING(whether to enable code coverage) if test "x$ZMQ_GCOV" = "xyes"; then if test "x$GXX" != "xyes"; then AC_MSG_ERROR([--with-gcov=yes works only with GCC]) fi CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" fi CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" fi CXXFLAGS="-fprofile-arcs" if test "x${ZMQ_ORIG_CXXFLAGS}" != "xnone"; then CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" fi LIBS="-lgcov ${LIBS}" fi AS_IF([test "x$ZMQ_GCOV" = "xyes"], [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2]) }]) dnl ############################################################################## dnl # LIBZMQ_CHECK_WITH_FLAG([flags], [macro]) # dnl # Runs a normal autoconf check with compiler flags # dnl ############################################################################## AC_DEFUN([LIBZMQ_CHECK_WITH_FLAG], [{ libzmq_check_with_flag_save_CFLAGS="$CFLAGS" libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS $1" CPPFLAGS="$CPPFLAGS $1" # Execute the macro $2 CFLAGS="$libzmq_check_with_flag_save_CFLAGS" CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS" }]) dnl ############################################################################## dnl # LIBZMQ_LANG_WALL([action-if-found], [action-if-not-found]) # dnl # How to define -Wall for the current compiler # dnl # Sets libzmq_cv_[]_AC_LANG_ABBREV[]__wall_flag variable to found style # dnl ############################################################################## AC_DEFUN([LIBZMQ_LANG_WALL], [{ AC_MSG_CHECKING([how to enable additional warnings for _AC_LANG compiler]) libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-v" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="-Wall" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag="+w" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" != "x"; then AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag]) $1 else AC_MSG_RESULT([not found]) $2 fi }]) dnl #################################################################### dnl # LIBZMQ_LANG_STRICT([action-if-found], [action-if-not-found]) # dnl # Check how to turn on strict standards compliance # dnl #################################################################### AC_DEFUN([LIBZMQ_LANG_STRICT], [{ AC_MSG_CHECKING([how to enable strict standards compliance in _AC_LANG compiler]) libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-Xc" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-pedantic" elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-strict-ansi" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag="-compat=5" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag" != "x"; then AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag]) $1 else AC_MSG_RESULT([not found]) $2 fi }]) dnl ######################################################################## dnl # LIBZMQ_LANG_WERROR([action-if-found], [action-if-not-found]) # dnl # Check how to turn warnings to errors # dnl ######################################################################## AC_DEFUN([LIBZMQ_LANG_WERROR], [{ AC_MSG_CHECKING([how to turn warnings to errors in _AC_LANG compiler]) libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="" # C compilers case "x[]_AC_LANG_ABBREV" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-Werror" # Sun studio elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag="-errwarn=%all" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag" != "x"; then AC_MSG_RESULT([$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag]) $1 else AC_MSG_RESULT([not found]) $2 fi }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_LANG_PRAGMA([pragma], [action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports given pragma # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_LANG_PRAGMA], [{ # Need to know how to enable all warnings LIBZMQ_LANG_WALL AC_MSG_CHECKING([whether _AC_LANG compiler supports pragma $1]) # Save flags libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save=$ac_[]_AC_LANG_ABBREV[]_werror_flag ac_[]_AC_LANG_ABBREV[]_werror_flag="yes" if test "x[]_AC_LANG_ABBREV" = "xc"; then libzmq_cv_check_lang_pragma_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then libzmq_cv_check_lang_pragma_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag" else AC_MSG_WARN([testing compiler characteristic on an unknown language]) fi AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#pragma $1]])], [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="yes" ; AC_MSG_RESULT(yes)], [eval AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)="no" ; AC_MSG_RESULT(no)]) if test "x[]_AC_LANG_ABBREV" = "xc"; then CFLAGS="$libzmq_cv_check_lang_pragma_save_CFLAGS" elif test "x[]_AC_LANG_ABBREV" = "xcxx"; then CPPFLAGS="$libzmq_cv_check_lang_pragma_save_CPPFLAGS" fi ac_[]_AC_LANG_ABBREV[]_werror_flag=$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag_save # Call the action as the flags are restored AS_IF([eval test x$]AS_TR_SH(libzmq_cv_[]_AC_LANG_ABBREV[]_supports_pragma_$1)[ = "xyes"], [$2], [$3]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_LANG_VISIBILITY([action-if-found], [action-if-not-found]) # dnl # Check if the compiler supports dso visibility # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_LANG_VISIBILITY], [{ libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="" if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_clang_compiler" = "xyes" -o \ "x$libzmq_cv_[]_AC_LANG_ABBREV[]_gcc4_compiler" = "xyes"; then LIBZMQ_CHECK_LANG_FLAG([-fvisibility=hidden], [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-fvisibility=hidden"]) elif test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" = "xyes"; then LIBZMQ_CHECK_LANG_FLAG([-xldscope=hidden], [libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag="-xldscope=hidden"]) fi AC_MSG_CHECKING(whether _AC_LANG compiler supports dso visibility) AS_IF([test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag" != "x"], [AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found]) # dnl # Check if SOCK_CLOEXEC is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{ AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [libzmq_cv_sock_cloexec], [AC_TRY_RUN([/* SOCK_CLOEXEC test */ #include #include int main (int argc, char *argv []) { int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); return (s == -1); } ], [libzmq_cv_sock_cloexec="yes"], [libzmq_cv_sock_cloexec="no"], [libzmq_cv_sock_cloexec="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_sock_cloexec" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_O_CLOEXEC([action-if-found], [action-if-not-found]) # dnl # Check if O_CLOEXEC is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_O_CLOEXEC], [{ AC_CACHE_CHECK([whether O_CLOEXEC is supported], [libzmq_cv_o_cloexec], [AC_TRY_RUN([/* O_CLOEXEC test */ #include #include #include int main (int argc, char *argv []) { int s = open ("/dev/null", O_CLOEXEC | O_RDONLY); return (s == -1); } ], [libzmq_cv_o_cloexec="yes"], [libzmq_cv_o_cloexec="no"], [libzmq_cv_o_cloexec="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_o_cloexec" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_EVENTFD_CLOEXEC([action-if-found], [action-if-not-found]) # dnl # Check if EFD_CLOEXEC is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_EVENTFD_CLOEXEC], [{ AC_CACHE_CHECK([whether EFD_CLOEXEC is supported], [libzmq_cv_efd_cloexec], [AC_TRY_RUN([/* EFD_CLOEXEC test */ #include int main (int argc, char *argv []) { int s = eventfd (0, EFD_CLOEXEC); return (s == -1); } ], [libzmq_cv_efd_cloexec="yes"], [libzmq_cv_efd_cloexec="no"], [libzmq_cv_efd_cloexec="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_efd_cloexec" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_ATOMIC_INSTRINSICS([action-if-found], [action-if-not-found]) # dnl # Check if compiler supoorts __atomic_Xxx intrinsics # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_ATOMIC_INTRINSICS], [{ AC_MSG_CHECKING(whether compiler supports __atomic_Xxx intrinsics) AC_COMPILE_IFELSE([AC_LANG_SOURCE([ /* atomic intrinsics test */ int v = 0; int main (int, char **) { int t = __atomic_add_fetch (&v, 1, __ATOMIC_ACQ_REL); return t; } ])], [AC_MSG_RESULT(yes) ; libzmq_cv_has_atomic_instrisics="yes" ; $1], [AC_MSG_RESULT(no) ; libzmq_cv_has_atomic_instrisics="no" ; $2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_SO_BINDTODEVICE([action-if-found], [action-if-not-found]) # dnl # Check if SO_BINDTODEVICE is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_SO_BINDTODEVICE], [{ AC_CACHE_CHECK([whether SO_BINDTODEVICE is supported], [libzmq_cv_so_bindtodevice], [AC_TRY_RUN([/* SO_BINDTODEVICE test */ #include int main (int argc, char *argv []) { /* Actually making the setsockopt() call requires CAP_NET_RAW */ #ifndef SO_BINDTODEVICE return 1; #else return 0; #endif } ], [libzmq_cv_so_bindtodevice="yes"], [libzmq_cv_so_bindtodevice="no"], [libzmq_cv_so_bindtodevice="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_so_bindtodevice" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found]) # dnl # Check if SO_KEEPALIVE is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{ AC_CACHE_CHECK([whether SO_KEEPALIVE is supported], [libzmq_cv_so_keepalive], [AC_TRY_RUN([/* SO_KEEPALIVE test */ #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ); } ], [libzmq_cv_so_keepalive="yes"], [libzmq_cv_so_keepalive="no"], [libzmq_cv_so_keepalive="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_so_keepalive" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found]) # dnl # Check if TCP_KEEPCNT is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{ AC_CACHE_CHECK([whether TCP_KEEPCNT is supported], [libzmq_cv_tcp_keepcnt], [AC_TRY_RUN([/* TCP_KEEPCNT test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1) ); } ], [libzmq_cv_tcp_keepcnt="yes"], [libzmq_cv_tcp_keepcnt="no"], [libzmq_cv_tcp_keepcnt="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_tcp_keepcnt" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found]) # dnl # Check if TCP_KEEPIDLE is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{ AC_CACHE_CHECK([whether TCP_KEEPIDLE is supported], [libzmq_cv_tcp_keepidle], [AC_TRY_RUN([/* TCP_KEEPIDLE test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1) ); } ], [libzmq_cv_tcp_keepidle="yes"], [libzmq_cv_tcp_keepidle="no"], [libzmq_cv_tcp_keepidle="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_tcp_keepidle" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found]) # dnl # Check if TCP_KEEPINTVL is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{ AC_CACHE_CHECK([whether TCP_KEEPINTVL is supported], [libzmq_cv_tcp_keepintvl], [AC_TRY_RUN([/* TCP_KEEPINTVL test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1) ); } ], [libzmq_cv_tcp_keepintvl="yes"], [libzmq_cv_tcp_keepintvl="no"], [libzmq_cv_tcp_keepintvl="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_tcp_keepintvl" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found]) # dnl # Check if TCP_KEEPALIVE is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{ AC_CACHE_CHECK([whether TCP_KEEPALIVE is supported], [libzmq_cv_tcp_keepalive], [AC_TRY_RUN([/* TCP_KEEPALIVE test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ); } ], [libzmq_cv_tcp_keepalive="yes"], [libzmq_cv_tcp_keepalive="no"], [libzmq_cv_tcp_keepalive="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_tcp_keepalive" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_GETRANDOM([action-if-found], [action-if-not-found]) # dnl # Checks if getrandom is supported # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_GETRANDOM], [{ AC_CACHE_CHECK([whether getrandom is supported], [libzmq_cv_getrandom], [AC_TRY_RUN([/* thread-local storage test */ #include int main (int argc, char *argv []) { char buf[4]; getrandom(buf, 4, 0); } ], [libzmq_cv_getrandom="yes"], [libzmq_cv_getrandom="no"], [libzmq_cv_getrandom="not during cross-compile"] )] ) AS_IF([test "x$libzmq_cv_getrandom" = "xyes"], [$1], [$2]) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_KQUEUE([action-if-found], [action-if-not-found]) # dnl # Checks kqueue polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_KQUEUE], [{ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include #include #include ],[[ struct kevent t_kev; kqueue(); ]])], [$1], [$2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_EPOLL_RUN([action-if-found], [action-if-not-found]) # dnl # LIBZMQ_CHECK_POLLER_EPOLL_CLOEXEC([action-if-found], [action-if-not-found]) # dnl # Checks epoll polling system can actually run # dnl # For cross-compile, only requires that epoll can link # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_EPOLL], [{ AC_RUN_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct epoll_event t_ev; int r; r = epoll_create(10); return(r < 0); ]])], [$1],[$2],[ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct epoll_event t_ev; epoll_create(10); ]])], [$1], [$2] ) ] ) }]) AC_DEFUN([LIBZMQ_CHECK_POLLER_EPOLL_CLOEXEC], [{ AC_RUN_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct epoll_event t_ev; int r; r = epoll_create1(EPOLL_CLOEXEC); return(r < 0); ]])], [$1],[$2],[ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct epoll_event t_ev; epoll_create1(EPOLL_CLOEXEC); ]])], [$1], [$2] ) ] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_DEVPOLL([action-if-found], [action-if-not-found]) # dnl # Checks devpoll polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_DEVPOLL], [{ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct pollfd t_devpoll; int fd = open("/dev/poll", O_RDWR); ]])], [$1], [$2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_POLLSET([action-if-found], [action-if-not-found]) # dnl # Checks pollset polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_POLLSET], [{ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include #include ],[[ pollset_t ps = pollset_create(-1); ]])], [$1], [$2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_POLL([action-if-found], [action-if-not-found]) # dnl # Checks poll polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_POLL], [{ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include ],[[ struct pollfd t_poll; poll(&t_poll, 1, 1); ]])], [$1], [$2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER_SELECT([action-if-found], [action-if-not-found]) # dnl # Checks select polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_SELECT], [{ AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #ifdef ZMQ_HAVE_WINDOWS #include "winsock2.h" #elif defined ZMQ_HAVE_OPENVMS #include #include #else #include #endif ],[[ fd_set t_rfds; struct timeval tv; FD_ZERO(&t_rfds); FD_SET(0, &t_rfds); tv.tv_sec = 5; tv.tv_usec = 0; select(1, &t_rfds, 0, 0, &tv); ]])], [$1],[$2] ) }]) dnl ################################################################################ dnl # LIBZMQ_CHECK_POLLER([action-if-found], [action-if-not-found]) # dnl # Choose polling system # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{ # Allow user to override poller autodetection AC_ARG_WITH([poller], [AS_HELP_STRING([--with-poller], [choose polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'pollset', 'poll', 'select', or 'auto'. [default=auto]])]) if test "x$with_poller" == "x"; then pollers=auto else pollers=$with_poller fi if test "$pollers" == "auto"; then # We search for pollers in this order pollers="kqueue epoll devpoll pollset poll select" fi # try to find suitable polling system. the order of testing is: AC_MSG_NOTICE([Choosing polling system from '$pollers'...]) poller_found=0 for poller in $pollers; do case "$poller" in kqueue) LIBZMQ_CHECK_POLLER_KQUEUE([ AC_MSG_NOTICE([Using 'kqueue' polling system]) AC_DEFINE(ZMQ_USE_KQUEUE, 1, [Use 'kqueue' polling system]) poller_found=1 ]) ;; epoll) case "$host_os" in solaris*|sunos*) # Recent illumos and Solaris systems did add epoll() # syntax, but it does not fully satisfy expectations # that ZMQ has from Linux systems. Unless you undertake # to fix the integration, do not disable this exception # and use select() or poll() on Solarish OSes for now. AC_MSG_NOTICE([NOT using 'epoll' polling system on '$host_os']) ;; *) LIBZMQ_CHECK_POLLER_EPOLL_CLOEXEC([ AC_MSG_NOTICE([Using 'epoll' polling system with CLOEXEC]) AC_DEFINE(ZMQ_USE_EPOLL, 1, [Use 'epoll' polling system]) AC_DEFINE(ZMQ_USE_EPOLL_CLOEXEC, 1, [Use 'epoll' polling system with CLOEXEC]) poller_found=1 ],[ LIBZMQ_CHECK_POLLER_EPOLL([ AC_MSG_NOTICE([Using 'epoll' polling system with CLOEXEC]) AC_DEFINE(ZMQ_USE_EPOLL, 1, [Use 'epoll' polling system]) poller_found=1 ]) ]) ;; esac ;; devpoll) LIBZMQ_CHECK_POLLER_DEVPOLL([ AC_MSG_NOTICE([Using 'devpoll' polling system]) AC_DEFINE(ZMQ_USE_DEVPOLL, 1, [Use 'devpoll' polling system]) poller_found=1 ]) ;; pollset) LIBZMQ_CHECK_POLLER_POLLSET([ AC_MSG_NOTICE([Using 'pollset' polling system]) AC_DEFINE(ZMQ_USE_POLLSET, 1, [Use 'pollset' polling system]) poller_found=1 ]) ;; poll) LIBZMQ_CHECK_POLLER_POLL([ AC_MSG_NOTICE([Using 'poll' polling system]) AC_DEFINE(ZMQ_USE_POLL, 1, [Use 'poll' polling system]) poller_found=1 ]) ;; select) LIBZMQ_CHECK_POLLER_SELECT([ AC_MSG_NOTICE([Using 'select' polling system]) AC_DEFINE(ZMQ_USE_SELECT, 1, [Use 'select' polling system]) poller_found=1 ]) ;; esac test $poller_found -eq 1 && break done if test $poller_found -eq 0; then AC_MSG_ERROR([None of '$pollers' are valid pollers on this platform]) fi }]) zeromq-4.2.5/builds/0000775000372000037200000000000013255253402015224 5ustar00travistravis00000000000000zeromq-4.2.5/builds/Makefile.am0000664000372000037200000000123413255253220017256 0ustar00travistravis00000000000000# Specify all build files that have to go into source packages. # msvc directory does its own stuff. EXTRA_DIST = \ cygwin/Makefile.cygwin \ zos/makelibzmq \ zos/cxxall \ zos/README.md \ zos/makeclean \ zos/platform.hpp \ zos/zc++ \ zos/test_fork.cpp \ zos/maketests \ zos/runtests \ cygwin/Makefile.cygwin \ mingw32/Makefile.mingw32 \ mingw32/platform.hpp \ cmake/Modules \ cmake/NSIS.template32.in \ cmake/NSIS.template64.in \ cmake/ZeroMQConfig.cmake.in \ cmake/platform.hpp.in \ valgrind/valgrind.supp \ valgrind/vg \ nuget/readme.nuget \ nuget/libzmq.autopkg \ android/android_build_helper.sh \ android/ci_build.sh \ android/build.sh zeromq-4.2.5/builds/msvc/0000775000372000037200000000000013255253403016175 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/errno.hpp0000664000372000037200000000240413255253220020030 0ustar00travistravis00000000000000#ifndef ERRNO_H #define ERRNO_H 1 //#define EPERM 1 //#define ENOENT 2 //#define ESRCH 3 #define EINTR 4 //#define EIO 5 //#define ENXIO 6 //#define E2BIG 7 //#define ENOEXEC 8 #define EBADF 9 //#define ECHILD 10 #define EAGAIN 11 //#define ENOMEM 12 #define EACCES 13 #define EFAULT 14 //#define EOSERR 15 // rk //#define EBUSY 16 //#define EEXIST 17 //#define EXDEV 18 //#define ENODEV 19 //#define ENOTDIR 20 //#define EISDIR 21 #define EINVAL 22 //#define ENFILE 23 #define EMFILE 24 //#define ENOTTY 25 //#define EFBIG 27 //#define ENOSPC 28 //#define ESPIPE 29 //#define EROFS 30 //#define EMLINK 31 //#define EPIPE 32 //#define EDOM 33 //#define ERANGE 34 //#define EDEADLK 36 //#define ENOSYS 37 #ifdef __cplusplus extern "C" { #endif extern int errno; extern int _doserrno; extern int _sys_nerr; char* strerror(int errno); #define sys_nerr _sys_nerr #ifdef __cplusplus }; #endif #endifzeromq-4.2.5/builds/msvc/vs2012/0000775000372000037200000000000013255253403017132 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/remote_thr/0000775000372000037200000000000013255253403021302 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/remote_thr/remote_thr.vcxproj0000664000372000037200000000642413255253220025072 0ustar00travistravis00000000000000 {B15E059C-0CBB-4A82-8C42-6567FB650802} remote_thr v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2012/remote_lat/0000775000372000037200000000000013255253403021265 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/remote_lat/remote_lat.vcxproj0000664000372000037200000000642413255253220025040 0ustar00travistravis00000000000000 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1} remote_lat v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2012/local_thr/0000775000372000037200000000000013255253403021101 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/local_thr/local_thr.vcxproj0000664000372000037200000000642213255253220024466 0ustar00travistravis00000000000000 {8EF2DF6B-6646-460F-8032-913B70FE0E94} local_thr v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2012/libzmq.sln0000664000372000037200000003716113255253220021153 0ustar00travistravis00000000000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2012 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcxproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcxproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcxproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "remote_thr\remote_thr.vcxproj", "{B15E059C-0CBB-4A82-8C42-6567FB650802}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_lat", "remote_lat\remote_lat.vcxproj", "{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_thr", "local_thr\local_thr.vcxproj", "{8EF2DF6B-6646-460F-8032-913B70FE0E94}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "local_lat\local_lat.vcxproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution DynDebug|Win32 = DynDebug|Win32 DynDebug|x64 = DynDebug|x64 DynRelease|Win32 = DynRelease|Win32 DynRelease|x64 = DynRelease|x64 LtcgDebug|Win32 = LtcgDebug|Win32 LtcgDebug|x64 = LtcgDebug|x64 LtcgRelease|Win32 = LtcgRelease|Win32 LtcgRelease|x64 = LtcgRelease|x64 StaticDebug|Win32 = StaticDebug|Win32 StaticDebug|x64 = StaticDebug|x64 StaticRelease|Win32 = StaticRelease|Win32 StaticRelease|x64 = StaticRelease|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.Build.0 = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.ActiveCfg = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.Build.0 = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.Build.0 = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.Build.0 = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.ActiveCfg = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.Build.0 = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.Build.0 = ReleaseLIB|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.Build.0 = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.Build.0 = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.Build.0 = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.Build.0 = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.Build.0 = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.Build.0 = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zeromq-4.2.5/builds/msvc/vs2012/local_lat/0000775000372000037200000000000013255253403021064 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/local_lat/local_lat.vcxproj0000664000372000037200000000642213255253220024434 0ustar00travistravis00000000000000 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57} local_lat v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2012/libzmq/0000775000372000037200000000000013255253403020430 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/libzmq/libzmq.vcxproj0000664000372000037200000003506713255253220023353 0ustar00travistravis00000000000000 {641C5F36-32EE-4323-B740-992B651CF9D6} libzmq v110 DebugDLL Win32 ReleaseDLL Win32 DebugDLL x64 ReleaseDLL x64 DebugLTCG Win32 ReleaseLTCG Win32 DebugLTCG x64 ReleaseLTCG x64 DebugLIB Win32 ReleaseLIB Win32 DebugLIB x64 ReleaseLIB x64 StaticLibrary DynamicLibrary true Create NotUsing zeromq-4.2.5/builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters0000664000372000037200000005167213255253220025022 0ustar00travistravis00000000000000 src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include resource src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include {f7e88c6c-e408-4631-959c-fe3568656d70} {35f0c644-e1d8-4a46-bb33-06bb8b645fff} {90853975-3420-4f06-8be4-4ab3d9792160} {f5e26e9d-c33d-45c1-95e4-0732acd28b59} {e66010e4-a9ea-4e2e-8bc6-12fec14bb009} packaging packaging packaging packaging packaging packaging resource zeromq-4.2.5/builds/msvc/vs2012/inproc_lat/0000775000372000037200000000000013255253403021264 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj0000664000372000037200000000642413255253220025036 0ustar00travistravis00000000000000 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0} inproc_lat v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2012/inproc_thr/0000775000372000037200000000000013255253403021301 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj0000664000372000037200000000642413255253220025070 0ustar00travistravis00000000000000 {1077E977-95DD-4E73-A692-74647DD0CC1E} inproc_thr v110 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/Makefile.am0000664000372000037200000000774713255253220020245 0ustar00travistravis00000000000000LIBZMQ_DIST = vs2008/libzmq.sln \ vs2008/libzmq/libzmq.vcproj \ vs2010/libzmq.sln \ vs2010/libzmq/libzmq.vcxproj \ vs2010/libzmq/libzmq.vcxproj.filters \ vs2012/libzmq.sln \ vs2012/libzmq/libzmq.vcxproj \ vs2012/libzmq/libzmq.vcxproj.filters \ vs2013/libzmq.sln \ vs2013/libzmq/libzmq.vcxproj \ vs2013/libzmq/libzmq.vcxproj.filters \ vs2015/libzmq.sln \ vs2015/libzmq/libzmq.vcxproj \ vs2015/libzmq/libzmq.vcxproj.filters \ vs2015/libzmq/libzmq.props \ vs2015/libzmq/libzmq.xml \ vs2015/libzmq.import.props \ vs2015/libzmq.import.xml \ errno.cpp \ errno.hpp \ platform.hpp \ resource.h \ resource.rc PERF_DIST = vs2008/local_lat/local_lat.vcproj \ vs2008/local_thr/local_thr.vcproj \ vs2008/remote_lat/remote_lat.vcproj \ vs2008/remote_thr/remote_thr.vcproj \ vs2008/inproc_lat/inproc_lat.vcproj \ vs2008/inproc_thr/inproc_thr.vcproj \ vs2010/local_lat/local_lat.vcxproj \ vs2010/local_thr/local_thr.vcxproj \ vs2010/remote_lat/remote_lat.vcxproj \ vs2010/remote_thr/remote_thr.vcxproj \ vs2010/inproc_lat/inproc_lat.vcxproj \ vs2010/inproc_thr/inproc_thr.vcxproj \ vs2012/local_lat/local_lat.vcxproj \ vs2012/local_thr/local_thr.vcxproj \ vs2012/remote_lat/remote_lat.vcxproj \ vs2012/remote_thr/remote_thr.vcxproj \ vs2012/inproc_lat/inproc_lat.vcxproj \ vs2012/inproc_thr/inproc_thr.vcxproj \ vs2013/local_lat/local_lat.vcxproj \ vs2013/local_thr/local_thr.vcxproj \ vs2013/remote_lat/remote_lat.vcxproj \ vs2013/remote_thr/remote_thr.vcxproj \ vs2013/inproc_lat/inproc_lat.vcxproj \ vs2013/inproc_thr/inproc_thr.vcxproj \ vs2015/local_lat/local_lat.vcxproj \ vs2015/local_lat/local_lat.props \ vs2015/local_thr/local_thr.vcxproj \ vs2015/local_thr/local_thr.props \ vs2015/remote_lat/remote_lat.vcxproj \ vs2015/remote_lat/remote_lat.props \ vs2015/remote_thr/remote_thr.vcxproj \ vs2015/remote_thr/remote_thr.props \ vs2015/inproc_lat/inproc_lat.vcxproj \ vs2015/inproc_lat/inproc_lat.props \ vs2015/inproc_thr/inproc_thr.vcxproj \ vs2015/inproc_thr/inproc_thr.props PROPERTIES_DIST = properties/Common.props \ properties/Debug.props \ properties/DebugDEXE.props \ properties/DebugDLL.props \ properties/DebugLEXE.props \ properties/DebugLIB.props \ properties/DebugLTCG.props \ properties/DebugSEXE.props \ properties/DLL.props \ properties/EXE.props \ properties/LIB.props \ properties/Link.props \ properties/LTCG.props \ properties/Messages.props \ properties/Output.props \ properties/Release.props \ properties/ReleaseDEXE.props \ properties/ReleaseDLL.props \ properties/ReleaseLEXE.props \ properties/ReleaseLIB.props \ properties/ReleaseLTCG.props \ properties/ReleaseSEXE.props \ properties/Win32.props \ properties/x64.props PRECOMPILED_DIST = ../../src/precompiled.hpp \ ../../src/precompiled.cpp BUILD_DIST = build/build.bat \ build/buildall.bat \ build/buildbase.bat EXTRA_DIST = $(LIBZMQ_DIST) $(PERF_DIST) $(PROPERTIES_DIST) $(PRECOMPILED_DIST) $(BUILD_DIST)zeromq-4.2.5/builds/msvc/vs2013/0000775000372000037200000000000013255253403017133 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/remote_thr/0000775000372000037200000000000013255253403021303 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/remote_thr/remote_thr.vcxproj0000664000372000037200000000642413255253220025073 0ustar00travistravis00000000000000 {B15E059C-0CBB-4A82-8C42-6567FB650802} remote_thr v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2013/remote_lat/0000775000372000037200000000000013255253403021266 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/remote_lat/remote_lat.vcxproj0000664000372000037200000000642413255253220025041 0ustar00travistravis00000000000000 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1} remote_lat v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2013/local_thr/0000775000372000037200000000000013255253403021102 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/local_thr/local_thr.vcxproj0000664000372000037200000000642213255253220024467 0ustar00travistravis00000000000000 {8EF2DF6B-6646-460F-8032-913B70FE0E94} local_thr v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2013/libzmq.sln0000664000372000037200000003727613255253220021163 0ustar00travistravis00000000000000 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.30110.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcxproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcxproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcxproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "remote_thr\remote_thr.vcxproj", "{B15E059C-0CBB-4A82-8C42-6567FB650802}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_lat", "remote_lat\remote_lat.vcxproj", "{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_thr", "local_thr\local_thr.vcxproj", "{8EF2DF6B-6646-460F-8032-913B70FE0E94}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "local_lat\local_lat.vcxproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution DynDebug|Win32 = DynDebug|Win32 DynDebug|x64 = DynDebug|x64 DynRelease|Win32 = DynRelease|Win32 DynRelease|x64 = DynRelease|x64 LtcgDebug|Win32 = LtcgDebug|Win32 LtcgDebug|x64 = LtcgDebug|x64 LtcgRelease|Win32 = LtcgRelease|Win32 LtcgRelease|x64 = LtcgRelease|x64 StaticDebug|Win32 = StaticDebug|Win32 StaticDebug|x64 = StaticDebug|x64 StaticRelease|Win32 = StaticRelease|Win32 StaticRelease|x64 = StaticRelease|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.Build.0 = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.ActiveCfg = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.Build.0 = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.Build.0 = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.Build.0 = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.ActiveCfg = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.Build.0 = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.Build.0 = ReleaseLIB|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.Build.0 = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.Build.0 = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.Build.0 = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.Build.0 = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.Build.0 = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.Build.0 = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zeromq-4.2.5/builds/msvc/vs2013/local_lat/0000775000372000037200000000000013255253403021065 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/local_lat/local_lat.vcxproj0000664000372000037200000000642213255253220024435 0ustar00travistravis00000000000000 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57} local_lat v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2013/libzmq/0000775000372000037200000000000013255253403020431 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/libzmq/libzmq.vcxproj0000664000372000037200000003552713255253220023355 0ustar00travistravis00000000000000 {641C5F36-32EE-4323-B740-992B651CF9D6} libzmq v120 DebugDLL Win32 ReleaseDLL Win32 DebugDLL x64 ReleaseDLL x64 DebugLTCG Win32 ReleaseLTCG Win32 DebugLTCG x64 ReleaseLTCG x64 DebugLIB Win32 ReleaseLIB Win32 DebugLIB x64 ReleaseLIB x64 StaticLibrary DynamicLibrary true Create NotUsing zeromq-4.2.5/builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters0000664000372000037200000005167213255253220025023 0ustar00travistravis00000000000000 src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include resource src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include {f7e88c6c-e408-4631-959c-fe3568656d70} {35f0c644-e1d8-4a46-bb33-06bb8b645fff} {90853975-3420-4f06-8be4-4ab3d9792160} {f5e26e9d-c33d-45c1-95e4-0732acd28b59} {e66010e4-a9ea-4e2e-8bc6-12fec14bb009} packaging packaging packaging packaging packaging packaging resource zeromq-4.2.5/builds/msvc/vs2013/inproc_lat/0000775000372000037200000000000013255253403021265 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj0000664000372000037200000000642413255253220025037 0ustar00travistravis00000000000000 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0} inproc_lat v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2013/inproc_thr/0000775000372000037200000000000013255253403021302 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj0000664000372000037200000000642413255253220025071 0ustar00travistravis00000000000000 {1077E977-95DD-4E73-A692-74647DD0CC1E} inproc_thr v120 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/platform.hpp0000664000372000037200000000073413255253220020533 0ustar00travistravis00000000000000#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 #endif zeromq-4.2.5/builds/msvc/vs2010/0000775000372000037200000000000013255253403017130 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/remote_thr/0000775000372000037200000000000013255253403021300 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/remote_thr/remote_thr.vcxproj0000664000372000037200000000642413255253220025070 0ustar00travistravis00000000000000 {B15E059C-0CBB-4A82-8C42-6567FB650802} remote_thr v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2010/remote_lat/0000775000372000037200000000000013255253403021263 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/remote_lat/remote_lat.vcxproj0000664000372000037200000000642413255253220025036 0ustar00travistravis00000000000000 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1} remote_lat v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2010/local_thr/0000775000372000037200000000000013255253403021077 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/local_thr/local_thr.vcxproj0000664000372000037200000000642213255253220024464 0ustar00travistravis00000000000000 {8EF2DF6B-6646-460F-8032-913B70FE0E94} local_thr v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2010/libzmq.sln0000664000372000037200000003716113255253220021151 0ustar00travistravis00000000000000 Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcxproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcxproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcxproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "remote_thr\remote_thr.vcxproj", "{B15E059C-0CBB-4A82-8C42-6567FB650802}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_lat", "remote_lat\remote_lat.vcxproj", "{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_thr", "local_thr\local_thr.vcxproj", "{8EF2DF6B-6646-460F-8032-913B70FE0E94}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "local_lat\local_lat.vcxproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution DynDebug|Win32 = DynDebug|Win32 DynDebug|x64 = DynDebug|x64 DynRelease|Win32 = DynRelease|Win32 DynRelease|x64 = DynRelease|x64 LtcgDebug|Win32 = LtcgDebug|Win32 LtcgDebug|x64 = LtcgDebug|x64 LtcgRelease|Win32 = LtcgRelease|Win32 LtcgRelease|x64 = LtcgRelease|x64 StaticDebug|Win32 = StaticDebug|Win32 StaticDebug|x64 = StaticDebug|x64 StaticRelease|Win32 = StaticRelease|Win32 StaticRelease|x64 = StaticRelease|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.Build.0 = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.ActiveCfg = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.Build.0 = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.Build.0 = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.Build.0 = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.ActiveCfg = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.Build.0 = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.Build.0 = ReleaseLIB|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.Build.0 = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.Build.0 = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.Build.0 = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.Build.0 = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.Build.0 = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.Build.0 = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zeromq-4.2.5/builds/msvc/vs2010/local_lat/0000775000372000037200000000000013255253403021062 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/local_lat/local_lat.vcxproj0000664000372000037200000000642213255253220024432 0ustar00travistravis00000000000000 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57} local_lat v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2010/libzmq/0000775000372000037200000000000013255253403020426 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/libzmq/libzmq.vcxproj0000664000372000037200000003507213255253220023345 0ustar00travistravis00000000000000 {641C5F36-32EE-4323-B740-992B651CF9D6} libzmq v100 DebugDLL Win32 ReleaseDLL Win32 DebugDLL x64 ReleaseDLL x64 DebugLTCG Win32 ReleaseLTCG Win32 DebugLTCG x64 ReleaseLTCG x64 DebugLIB Win32 ReleaseLIB Win32 DebugLIB x64 ReleaseLIB x64 StaticLibrary DynamicLibrary true Create NotUsing zeromq-4.2.5/builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters0000664000372000037200000005167213255253220025020 0ustar00travistravis00000000000000 src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include resource src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include {f7e88c6c-e408-4631-959c-fe3568656d70} {35f0c644-e1d8-4a46-bb33-06bb8b645fff} {90853975-3420-4f06-8be4-4ab3d9792160} {f5e26e9d-c33d-45c1-95e4-0732acd28b59} {e66010e4-a9ea-4e2e-8bc6-12fec14bb009} packaging packaging packaging packaging packaging packaging resource zeromq-4.2.5/builds/msvc/vs2010/inproc_lat/0000775000372000037200000000000013255253403021262 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj0000664000372000037200000000642413255253220025034 0ustar00travistravis00000000000000 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0} inproc_lat v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2010/inproc_thr/0000775000372000037200000000000013255253403021277 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj0000664000372000037200000000642413255253220025066 0ustar00travistravis00000000000000 {1077E977-95DD-4E73-A692-74647DD0CC1E} inproc_thr v100 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/errno.cpp0000664000372000037200000000107313255253220020024 0ustar00travistravis00000000000000#if defined _WIN32_WCE //#include "..\..\include\zmq.h" #include "..\..\src\err.hpp" int errno; int _doserrno; int _sys_nerr; char* error_desc_buff = NULL; char* strerror(int errno) { if (NULL != error_desc_buff) { LocalFree(error_desc_buff); error_desc_buff = NULL; } FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, errno, 0, (LPTSTR)&error_desc_buff, 1024, NULL ); return error_desc_buff; } #endifzeromq-4.2.5/builds/msvc/vs2008/0000775000372000037200000000000013255253402017136 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/remote_thr/0000775000372000037200000000000013255253403021307 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/remote_thr/remote_thr.vcproj0000664000372000037200000000575113255253220024711 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/remote_lat/0000775000372000037200000000000013255253403021272 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/remote_lat/remote_lat.vcproj0000664000372000037200000000557513255253220024663 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/local_thr/0000775000372000037200000000000013255253403021106 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/local_thr/local_thr.vcproj0000664000372000037200000000574413255253220024311 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/libzmq.sln0000664000372000037200000001410213255253220021146 0ustar00travistravis00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "local_lat\local_lat.vcproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_lat", "remote_lat\remote_lat.vcproj", "{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_thr", "local_thr\local_thr.vcproj", "{8EF2DF6B-6646-460F-8032-913B70FE0E94}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "remote_thr\remote_thr.vcproj", "{B15E059C-0CBB-4A82-8C42-6567FB650802}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}" ProjectSection(ProjectDependencies) = postProject {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 StaticDebug|Win32 = StaticDebug|Win32 StaticRelease|Win32 = StaticRelease|Win32 WithOpenPGM|Win32 = WithOpenPGM|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C5F36-32EE-4323-B740-992B651CF9D6}.Debug|Win32.ActiveCfg = Debug|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.Debug|Win32.Build.0 = Debug|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.Release|Win32.ActiveCfg = Release|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.Release|Win32.Build.0 = Release|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = StaticDebug|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = StaticDebug|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = StaticRelease|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = StaticRelease|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.ActiveCfg = WithOpenPGM|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.WithOpenPGM|Win32.Build.0 = WithOpenPGM|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Debug|Win32.ActiveCfg = Debug|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Debug|Win32.Build.0 = Debug|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Release|Win32.ActiveCfg = Release|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.Release|Win32.Build.0 = Release|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.WithOpenPGM|Win32.Build.0 = Release|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Debug|Win32.ActiveCfg = Debug|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Debug|Win32.Build.0 = Debug|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Release|Win32.ActiveCfg = Release|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.Release|Win32.Build.0 = Release|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.WithOpenPGM|Win32.Build.0 = Release|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.Debug|Win32.ActiveCfg = Debug|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.Debug|Win32.Build.0 = Debug|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.Release|Win32.ActiveCfg = Release|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.Release|Win32.Build.0 = Release|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.WithOpenPGM|Win32.Build.0 = Release|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.Debug|Win32.ActiveCfg = Debug|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.Debug|Win32.Build.0 = Debug|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|Win32.ActiveCfg = Release|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.Release|Win32.Build.0 = Release|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.WithOpenPGM|Win32.Build.0 = Release|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Debug|Win32.ActiveCfg = Debug|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Debug|Win32.Build.0 = Debug|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|Win32.ActiveCfg = Release|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.Release|Win32.Build.0 = Release|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.WithOpenPGM|Win32.Build.0 = Release|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.Debug|Win32.ActiveCfg = Debug|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.Debug|Win32.Build.0 = Debug|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|Win32.ActiveCfg = Release|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.Release|Win32.Build.0 = Release|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.ActiveCfg = Release|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.WithOpenPGM|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zeromq-4.2.5/builds/msvc/vs2008/local_lat/0000775000372000037200000000000013255253403021071 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/local_lat/local_lat.vcproj0000664000372000037200000000557013255253220024254 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/libzmq/0000775000372000037200000000000013255253403020435 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/libzmq/libzmq.vcproj0000664000372000037200000005145513255253220023167 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/inproc_lat/0000775000372000037200000000000013255253403021271 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj0000664000372000037200000000557513255253220024661 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2008/inproc_thr/0000775000372000037200000000000013255253403021306 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj0000664000372000037200000000557513255253220024713 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/resource.h0000664000372000037200000000060413255253220020172 0ustar00travistravis00000000000000//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by resource.rc // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif zeromq-4.2.5/builds/msvc/Makefile.in0000664000372000037200000004254213255253274020257 0ustar00travistravis00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = builds/msvc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/platform.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ ASCIIDOC = @ASCIIDOC@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLANG_FORMAT = @CLANG_FORMAT@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@ LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@ LIBZMQ_VMCI_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ LIBZMQ_VMCI_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTVER = @LTVER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ VALGRIND_HAVE_TOOL_drd = @VALGRIND_HAVE_TOOL_drd@ VALGRIND_HAVE_TOOL_exp_sgcheck = @VALGRIND_HAVE_TOOL_exp_sgcheck@ VALGRIND_HAVE_TOOL_helgrind = @VALGRIND_HAVE_TOOL_helgrind@ VALGRIND_HAVE_TOOL_memcheck = @VALGRIND_HAVE_TOOL_memcheck@ VERSION = @VERSION@ WITH_CLANG_FORMAT = @WITH_CLANG_FORMAT@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gssapi_krb5_CFLAGS = @gssapi_krb5_CFLAGS@ gssapi_krb5_LIBS = @gssapi_krb5_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libzmq_have_asciidoc = @libzmq_have_asciidoc@ libzmq_have_xmlto = @libzmq_have_xmlto@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ norm_CFLAGS = @norm_CFLAGS@ norm_LIBS = @norm_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pgm_CFLAGS = @pgm_CFLAGS@ pgm_LIBS = @pgm_LIBS@ pkg_config_defines = @pkg_config_defines@ pkg_config_libs_private = @pkg_config_libs_private@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ LIBZMQ_DIST = vs2008/libzmq.sln \ vs2008/libzmq/libzmq.vcproj \ vs2010/libzmq.sln \ vs2010/libzmq/libzmq.vcxproj \ vs2010/libzmq/libzmq.vcxproj.filters \ vs2012/libzmq.sln \ vs2012/libzmq/libzmq.vcxproj \ vs2012/libzmq/libzmq.vcxproj.filters \ vs2013/libzmq.sln \ vs2013/libzmq/libzmq.vcxproj \ vs2013/libzmq/libzmq.vcxproj.filters \ vs2015/libzmq.sln \ vs2015/libzmq/libzmq.vcxproj \ vs2015/libzmq/libzmq.vcxproj.filters \ vs2015/libzmq/libzmq.props \ vs2015/libzmq/libzmq.xml \ vs2015/libzmq.import.props \ vs2015/libzmq.import.xml \ errno.cpp \ errno.hpp \ platform.hpp \ resource.h \ resource.rc PERF_DIST = vs2008/local_lat/local_lat.vcproj \ vs2008/local_thr/local_thr.vcproj \ vs2008/remote_lat/remote_lat.vcproj \ vs2008/remote_thr/remote_thr.vcproj \ vs2008/inproc_lat/inproc_lat.vcproj \ vs2008/inproc_thr/inproc_thr.vcproj \ vs2010/local_lat/local_lat.vcxproj \ vs2010/local_thr/local_thr.vcxproj \ vs2010/remote_lat/remote_lat.vcxproj \ vs2010/remote_thr/remote_thr.vcxproj \ vs2010/inproc_lat/inproc_lat.vcxproj \ vs2010/inproc_thr/inproc_thr.vcxproj \ vs2012/local_lat/local_lat.vcxproj \ vs2012/local_thr/local_thr.vcxproj \ vs2012/remote_lat/remote_lat.vcxproj \ vs2012/remote_thr/remote_thr.vcxproj \ vs2012/inproc_lat/inproc_lat.vcxproj \ vs2012/inproc_thr/inproc_thr.vcxproj \ vs2013/local_lat/local_lat.vcxproj \ vs2013/local_thr/local_thr.vcxproj \ vs2013/remote_lat/remote_lat.vcxproj \ vs2013/remote_thr/remote_thr.vcxproj \ vs2013/inproc_lat/inproc_lat.vcxproj \ vs2013/inproc_thr/inproc_thr.vcxproj \ vs2015/local_lat/local_lat.vcxproj \ vs2015/local_lat/local_lat.props \ vs2015/local_thr/local_thr.vcxproj \ vs2015/local_thr/local_thr.props \ vs2015/remote_lat/remote_lat.vcxproj \ vs2015/remote_lat/remote_lat.props \ vs2015/remote_thr/remote_thr.vcxproj \ vs2015/remote_thr/remote_thr.props \ vs2015/inproc_lat/inproc_lat.vcxproj \ vs2015/inproc_lat/inproc_lat.props \ vs2015/inproc_thr/inproc_thr.vcxproj \ vs2015/inproc_thr/inproc_thr.props PROPERTIES_DIST = properties/Common.props \ properties/Debug.props \ properties/DebugDEXE.props \ properties/DebugDLL.props \ properties/DebugLEXE.props \ properties/DebugLIB.props \ properties/DebugLTCG.props \ properties/DebugSEXE.props \ properties/DLL.props \ properties/EXE.props \ properties/LIB.props \ properties/Link.props \ properties/LTCG.props \ properties/Messages.props \ properties/Output.props \ properties/Release.props \ properties/ReleaseDEXE.props \ properties/ReleaseDLL.props \ properties/ReleaseLEXE.props \ properties/ReleaseLIB.props \ properties/ReleaseLTCG.props \ properties/ReleaseSEXE.props \ properties/Win32.props \ properties/x64.props PRECOMPILED_DIST = ../../src/precompiled.hpp \ ../../src/precompiled.cpp BUILD_DIST = build/build.bat \ build/buildall.bat \ build/buildbase.bat EXTRA_DIST = $(LIBZMQ_DIST) $(PERF_DIST) $(PROPERTIES_DIST) $(PRECOMPILED_DIST) $(BUILD_DIST) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builds/msvc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign builds/msvc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: zeromq-4.2.5/builds/msvc/build/0000775000372000037200000000000013255253403017274 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/build/buildbase.bat0000664000372000037200000000531113255253220021713 0ustar00travistravis00000000000000@ECHO OFF @setlocal REM Usage: [buildbase.bat ..\vs2013\mysolution.sln 12 [Clean]] SET solution=%1 SET version=%2 :: supports passing in Clean as third argument if "make clean" behavior is desired SET target=%3 SET ACTION=Building if NOT "%target%" == "" set target=/t:%target%&set ACTION=Cleaning SET log=build_%version%.log SET tools=Microsoft Visual Studio %version%.0\VC\vcvarsall.bat if "%version%" == "15" SET tools=Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat SET environment="%programfiles(x86)%\%tools%" IF NOT EXIST %environment% SET environment="%programfiles%\%tools%" IF NOT EXIST %environment% GOTO no_tools @ECHO %ACTION% %solution% SET __CURRENT_DIR__=%CD% CALL %environment% x86 >%SystemDrive%\nul 2>&1 ECHO Platform=x86 2> %log% CD /D %__CURRENT_DIR__% SET __CURRENT_DIR__= ECHO Configuration=DynDebug msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error ECHO Configuration=DynRelease msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error ECHO Configuration=LtcgDebug msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error ECHO Configuration=LtcgRelease msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error ECHO Configuration=StaticDebug msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=Win32 %solution% %target%>> %log% || GOTO error ECHO Configuration=StaticRelease msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=Win32 %solution% %target%>> %log% || GOTO error SET __CURRENT_DIR__=%CD% CALL %environment% x86_amd64 >%SystemDrive%\nul 2>&1 ECHO Platform=x64 CD /D %__CURRENT_DIR__% SET __CURRENT_DIR__= ECHO Configuration=DynDebug msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO Configuration=DynRelease msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO Configuration=LtcgDebug msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO Configuration=LtcgRelease msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO Configuration=StaticDebug msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO Configuration=StaticRelease msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% %target%>> %log% || GOTO error ECHO %ACTION% complete: %solution% GOTO end :error ECHO *** ERROR, build terminated early, see: %log% GOTO end :no_tools ECHO *** ERROR, build tools not found: %tools% :end @endlocal zeromq-4.2.5/builds/msvc/build/build.bat0000664000372000037200000000141213255253220021056 0ustar00travistravis00000000000000@ECHO OFF :: Usage: build.bat [Clean] @setlocal :: validate environment if "%VSINSTALLDIR%" == "" @echo Error: Attempt to build without proper DevStudio environment.&@goto :done :: record starting time set STARTTIME=%DATE% %TIME% @echo Start Time: %STARTTIME% :: validate optional argument (and make sure it is spelled "Clean") set MAKECLEAN=%%1 if NOT "%%1" == "" if /I "%%1" == "clean" set MAKECLEAN=Clean :: :: uses the environment from the DevStudio CMD window to figure out which version to build :: set VSVER=%VSINSTALLDIR:~-5,2% set DIRVER=%VSVER% if %VSVER% gtr 10 set /a DIRVER = DIRVER + 1 CALL buildbase.bat ..\vs20%DIRVER%\libzmq.sln %VSVER% %MAKECLEAN% set STOPTIME=%DATE% %TIME% @echo Stop Time: %STOPTIME% @echo Start Time: %STARTTIME% :done @endlocal zeromq-4.2.5/builds/msvc/build/buildall.bat0000664000372000037200000000051513255253220021552 0ustar00travistravis00000000000000@ECHO OFF :: Usage: buildall.bat :: Build all configurations for all solutions. call buildbase.bat ..\vs2017\libzmq.sln 15 ECHO. CALL buildbase.bat ..\vs2015\libzmq.sln 14 ECHO. CALL buildbase.bat ..\vs2013\libzmq.sln 12 ECHO. CALL buildbase.bat ..\vs2012\libzmq.sln 11 ECHO. CALL buildbase.bat ..\vs2010\libzmq.sln 10 ECHO. PAUSE zeromq-4.2.5/builds/msvc/resource.rc0000664000372000037200000001105213255253220020346 0ustar00travistravis00000000000000ÿþ// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (United States) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 4,2,30,0 PRODUCTVERSION 4,2,30,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x7L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "iMatix Corporation" VALUE "FileDescription", "ZeroMQ lightweight messaging kernel" VALUE "FileVersion", "4.2.30.0" VALUE "InternalName", "zeromq" VALUE "LegalCopyright", "Copyright (c) 2012 The ZeroMQ Authors." VALUE "OriginalFilename", "libzmq.dll" VALUE "ProductName", "ZeroMQ" VALUE "ProductVersion", "4.2.30.0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED zeromq-4.2.5/builds/msvc/vs2015/0000775000372000037200000000000013255253403017135 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/remote_thr/0000775000372000037200000000000013255253403021305 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/remote_thr/remote_thr.props0000664000372000037200000000367613255253220024553 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ remote_thr Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/remote_thr/remote_thr.vcxproj0000664000372000037200000000642413255253220025075 0ustar00travistravis00000000000000 {B15E059C-0CBB-4A82-8C42-6567FB650802} remote_thr v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2015/remote_lat/0000775000372000037200000000000013255253403021270 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/remote_lat/remote_lat.props0000664000372000037200000000367413255253220024517 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ remote_lat Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/remote_lat/remote_lat.vcxproj0000664000372000037200000000642413255253220025043 0ustar00travistravis00000000000000 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1} remote_lat v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2015/local_thr/0000775000372000037200000000000013255253403021104 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/local_thr/local_thr.props0000664000372000037200000000367313255253220024146 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ local_thr Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/local_thr/local_thr.vcxproj0000664000372000037200000000642213255253220024471 0ustar00travistravis00000000000000 {8EF2DF6B-6646-460F-8032-913B70FE0E94} local_thr v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2015/libzmq.import.props0000664000372000037200000000715313255253220023034 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZMQ Import Settings ZMQ_USE_TWEETNACL;%(PreprocessorDefinitions) ZMQ_USE_LIBSODIUM;%(PreprocessorDefinitions) ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions) HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions) ZMQ_BUILD_DRAFT_API;%(PreprocessorDefinitions) $(ProjectDir)..\..\..\..\..\libzmq\include\;%(AdditionalIncludeDirectories) ZMQ_STATIC;%(PreprocessorDefinitions) libzmq.lib;%(AdditionalDependencies) $(ProjectDir)..\..\..\..\..\libzmq\bin\$(PlatformName)\Debug\$(PlatformToolset)\$(Linkage-libzmq)\;%(AdditionalLibraryDirectories) $(ProjectDir)..\..\..\..\..\libzmq\bin\$(PlatformName)\Release\$(PlatformToolset)\$(Linkage-libzmq)\;%(AdditionalLibraryDirectories) zeromq-4.2.5/builds/msvc/vs2015/libzmq.sln0000664000372000037200000003727413255253220021163 0ustar00travistravis00000000000000 Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libzmq", "libzmq\libzmq.vcxproj", "{641C5F36-32EE-4323-B740-992B651CF9D6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_thr", "inproc_thr\inproc_thr.vcxproj", "{1077E977-95DD-4E73-A692-74647DD0CC1E}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inproc_lat", "inproc_lat\inproc_lat.vcxproj", "{6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_thr", "remote_thr\remote_thr.vcxproj", "{B15E059C-0CBB-4A82-8C42-6567FB650802}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote_lat", "remote_lat\remote_lat.vcxproj", "{9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_thr", "local_thr\local_thr.vcxproj", "{8EF2DF6B-6646-460F-8032-913B70FE0E94}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "local_lat", "local_lat\local_lat.vcxproj", "{4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution DynDebug|Win32 = DynDebug|Win32 DynDebug|x64 = DynDebug|x64 DynRelease|Win32 = DynRelease|Win32 DynRelease|x64 = DynRelease|x64 LtcgDebug|Win32 = LtcgDebug|Win32 LtcgDebug|x64 = LtcgDebug|x64 LtcgRelease|Win32 = LtcgRelease|Win32 LtcgRelease|x64 = LtcgRelease|x64 StaticDebug|Win32 = StaticDebug|Win32 StaticDebug|x64 = StaticDebug|x64 StaticRelease|Win32 = StaticRelease|Win32 StaticRelease|x64 = StaticRelease|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|Win32.Build.0 = DebugDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.ActiveCfg = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynDebug|x64.Build.0 = DebugDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.DynRelease|x64.Build.0 = ReleaseDLL|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgDebug|x64.Build.0 = DebugLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|Win32.Build.0 = DebugLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.ActiveCfg = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticDebug|x64.Build.0 = DebugLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64 {641C5F36-32EE-4323-B740-992B651CF9D6}.StaticRelease|x64.Build.0 = ReleaseLIB|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynDebug|x64.Build.0 = DebugDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {1077E977-95DD-4E73-A692-74647DD0CC1E}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynDebug|x64.Build.0 = DebugDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynDebug|x64.Build.0 = DebugDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {B15E059C-0CBB-4A82-8C42-6567FB650802}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynDebug|x64.Build.0 = DebugDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {9C20A37C-5D9F-4C4C-A2D9-E6EE91A077D1}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynDebug|x64.Build.0 = DebugDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {8EF2DF6B-6646-460F-8032-913B70FE0E94}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.ActiveCfg = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|Win32.Build.0 = DebugDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.ActiveCfg = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynDebug|x64.Build.0 = DebugDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.ActiveCfg = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|Win32.Build.0 = ReleaseDEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.ActiveCfg = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.DynRelease|x64.Build.0 = ReleaseDEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.ActiveCfg = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|Win32.Build.0 = DebugLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.ActiveCfg = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgDebug|x64.Build.0 = DebugLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.ActiveCfg = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|Win32.Build.0 = ReleaseLEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.ActiveCfg = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.LtcgRelease|x64.Build.0 = ReleaseLEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.ActiveCfg = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|Win32.Build.0 = DebugSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.ActiveCfg = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticDebug|x64.Build.0 = DebugSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.ActiveCfg = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|Win32.Build.0 = ReleaseSEXE|Win32 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.ActiveCfg = ReleaseSEXE|x64 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57}.StaticRelease|x64.Build.0 = ReleaseSEXE|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal zeromq-4.2.5/builds/msvc/vs2015/local_lat/0000775000372000037200000000000013255253403021067 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/local_lat/local_lat.props0000664000372000037200000000367313255253220024114 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ local_lat Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/local_lat/local_lat.vcxproj0000664000372000037200000000642213255253220024437 0ustar00travistravis00000000000000 {4FDB8C73-9D4A-4D87-A4A9-A7FC06DFEA57} local_lat v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2015/libzmq.import.xml0000664000372000037200000000531413255253220022466 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2015/libzmq/0000775000372000037200000000000013255253403020433 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/libzmq/libzmq.vcxproj0000664000372000037200000003506713255253220023356 0ustar00travistravis00000000000000 {641C5F36-32EE-4323-B740-992B651CF9D6} libzmq v140 DebugDLL Win32 ReleaseDLL Win32 DebugDLL x64 ReleaseDLL x64 DebugLTCG Win32 ReleaseLTCG Win32 DebugLTCG x64 ReleaseLTCG x64 DebugLIB Win32 ReleaseLIB Win32 DebugLIB x64 ReleaseLIB x64 StaticLibrary DynamicLibrary true Create NotUsing zeromq-4.2.5/builds/msvc/vs2015/libzmq/libzmq.xml0000664000372000037200000000455313255253220022457 0ustar00travistravis00000000000000 zeromq-4.2.5/builds/msvc/vs2015/libzmq/libzmq.props0000664000372000037200000001051313255253220023013 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ Library Common Settings AllRules.ruleset false $(ProjectDir)..\..\;$(ProjectDir)..\..\..\..\include\;%(AdditionalIncludeDirectories) false Use precompiled.hpp _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;FD_SETSIZE=16384;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) ZMQ_USE_TWEETNACL;%(PreprocessorDefinitions) ZMQ_USE_LIBSODIUM;%(PreprocessorDefinitions) ZMQ_HAVE_CURVE;%(PreprocessorDefinitions) ZMQ_HAVE_OPENPGM;%(PreprocessorDefinitions) HAVE_LIBGSSAPI_KRB5;%(PreprocessorDefinitions) ZMQ_BUILD_DRAFT_API;%(PreprocessorDefinitions) ZMQ_USE_POLL;%(PreprocessorDefinitions) ZMQ_USE_SELECT;%(PreprocessorDefinitions) ZMQ_STATIC;%(PreprocessorDefinitions) DLL_EXPORT;%(PreprocessorDefinitions) Advapi32.lib;Ws2_32.lib;Rpcrt4.lib;Iphlpapi.lib;%(AdditionalDependencies) /ignore:4221 %(AdditionalOptions) zeromq-4.2.5/builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters0000664000372000037200000005167213255253220025025 0ustar00travistravis00000000000000 src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src src include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include resource src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include src\include {f7e88c6c-e408-4631-959c-fe3568656d70} {35f0c644-e1d8-4a46-bb33-06bb8b645fff} {90853975-3420-4f06-8be4-4ab3d9792160} {f5e26e9d-c33d-45c1-95e4-0732acd28b59} {e66010e4-a9ea-4e2e-8bc6-12fec14bb009} packaging packaging packaging packaging packaging packaging resource zeromq-4.2.5/builds/msvc/vs2015/inproc_lat/0000775000372000037200000000000013255253403021267 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/inproc_lat/inproc_lat.props0000664000372000037200000000367513255253220024516 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ inproc_lat Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj0000664000372000037200000000642413255253220025041 0ustar00travistravis00000000000000 {6FF7436F-B3F6-4AE9-A3AC-CFDE8A3872A0} inproc_lat v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/vs2015/inproc_thr/0000775000372000037200000000000013255253403021304 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/vs2015/inproc_thr/inproc_thr.props0000664000372000037200000000367413255253220024547 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>ZeroMQ inproc_thr Common Settings AllRules.ruleset false $(ProjectDir)..\..\;%(AdditionalIncludeDirectories) Advapi32.lib;Rpcrt4.lib;Ws2_32.lib;Iphlpapi.lib;%(AdditionalDependencies) dynamic ltcg static zeromq-4.2.5/builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj0000664000372000037200000000642413255253220025073 0ustar00travistravis00000000000000 {1077E977-95DD-4E73-A692-74647DD0CC1E} inproc_thr v140 Application DebugDEXE Win32 ReleaseDEXE Win32 DebugDEXE x64 ReleaseDEXE x64 DebugLEXE Win32 ReleaseLEXE Win32 DebugLEXE x64 ReleaseLEXE x64 DebugSEXE Win32 ReleaseSEXE Win32 DebugSEXE x64 ReleaseSEXE x64 true {641c5f36-32ee-4323-b740-992b651cf9d6} false zeromq-4.2.5/builds/msvc/properties/0000775000372000037200000000000013255253403020371 5ustar00travistravis00000000000000zeromq-4.2.5/builds/msvc/properties/Win32.props0000664000372000037200000000114313255253220022354 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>x86 Settings WIN32;_WIN32;%(PreprocessorDefinitions) MachineX86 /MACHINE:X86 %(AdditionalOptions) zeromq-4.2.5/builds/msvc/properties/LTCG.props0000664000372000037200000000062713255253220022211 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Link Time Code Generation Library zeromq-4.2.5/builds/msvc/properties/DebugDLL.props0000664000372000037200000000111213255253220023030 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Dynamic Debug Library MultiThreadedDebugDLL true zeromq-4.2.5/builds/msvc/properties/DebugLIB.props0000664000372000037200000000121213255253220023024 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Static Debug Library OldStyle MultiThreadedDebug true zeromq-4.2.5/builds/msvc/properties/DebugLTCG.props0000664000372000037200000000116513255253220023156 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Static Debug Link Time Code Generation Library OldStyle MultiThreadedDebug zeromq-4.2.5/builds/msvc/properties/Link.props0000664000372000037200000000121713255253220022351 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Link Time Code Generation Settings ltcg true UseLinkTimeCodeGeneration true zeromq-4.2.5/builds/msvc/properties/ReleaseDEXE.props0000664000372000037200000000110613255253220023477 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Release Dynamic dynamic MultiThreadedDLL zeromq-4.2.5/builds/msvc/properties/Output.props0000664000372000037200000000245613255253220022762 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Output Settings $(ProjectDir)..\..\ $(ProjectDir)..\..\..\..\ $(ProjectDir)..\..\..\..\..\ $(ProjectDir)..\..\..\..\bin\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\ $(ProjectDir)..\..\..\..\obj\$(TargetName)\$(PlatformName)\$(DebugOrRelease)\$(PlatformToolset)\$(DefaultLinkage)\ $(OutDir) $(TargetName) $(TargetDir)$(TargetName)$(TargetExt) $(OutDir)$(TargetName).lib $(OutDir)$(TargetName).log zeromq-4.2.5/builds/msvc/properties/Messages.props0000664000372000037200000000120313255253220023216 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Build Messages zeromq-4.2.5/builds/msvc/properties/Common.props0000664000372000037200000000127013255253220022703 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Common Settings Unicode true UNICODE;_UNICODE;%(PreprocessorDefinitions) Level3 zeromq-4.2.5/builds/msvc/properties/DLL.props0000664000372000037200000000101213255253220022060 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Dynamic Library dynamic .dll _DLL;_WINDLL;%(PreprocessorDefinitions) zeromq-4.2.5/builds/msvc/properties/Release.props0000664000372000037200000000307113255253220023034 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Release Settings Release false /Oy- %(AdditionalOptions) true true OnlyExplicitInline false MaxSpeed NDEBUG;%(PreprocessorDefinitions) NDEBUG;%(PreprocessorDefinitions) true true StreamingSIMDExtensions2 zeromq-4.2.5/builds/msvc/properties/ReleaseLEXE.props0000664000372000037200000000111413255253220023506 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Release Link Time Code Generation MultiThreaded zeromq-4.2.5/builds/msvc/properties/DebugLEXE.props0000664000372000037200000000111513255253220023155 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Debug Link Time Code Generation MultiThreadedDebug zeromq-4.2.5/builds/msvc/properties/ReleaseDLL.props0000664000372000037200000000103513255253220023366 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Dynamic Release Library MultiThreadedDLL zeromq-4.2.5/builds/msvc/properties/x64.props0000664000372000037200000000162013255253220022073 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>x64 Settings WIN32;_WIN32;WIN64;_WIN64;%(PreprocessorDefinitions) MachineX64 /MACHINE:X64 %(AdditionalOptions) zeromq-4.2.5/builds/msvc/properties/Debug.props0000664000372000037200000000202013255253220022473 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Debug Settings Debug EnableFastChecks ProgramDatabase true Disabled _DEBUG;%(PreprocessorDefinitions) _DEBUG;%(PreprocessorDefinitions) true zeromq-4.2.5/builds/msvc/properties/ReleaseSEXE.props0000664000372000037200000000110113255253220023511 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Release Static static MultiThreaded zeromq-4.2.5/builds/msvc/properties/ReleaseLTCG.props0000664000372000037200000000106213255253220023504 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Static Release Link Time Code Generation Library MultiThreaded zeromq-4.2.5/builds/msvc/properties/LIB.props0000664000372000037200000000077613255253220022073 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Static Library static .lib _LIB;%(PreprocessorDefinitions) zeromq-4.2.5/builds/msvc/properties/DebugSEXE.props0000664000372000037200000000116013255253220023164 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Debug Static static MultiThreadedDebug true zeromq-4.2.5/builds/msvc/properties/DebugDEXE.props0000664000372000037200000000117113255253220023147 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Debug Dynamic dynamic MultiThreadedDebugDLL true zeromq-4.2.5/builds/msvc/properties/EXE.props0000664000372000037200000000102213255253220022067 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Console Application true _CONSOLE;%(PreprocessorDefinitions) Console zeromq-4.2.5/builds/msvc/properties/ReleaseLIB.props0000664000372000037200000000102713255253220023362 0ustar00travistravis00000000000000 <_PropertySheetDisplayName>Static Release Library MultiThreaded zeromq-4.2.5/builds/cmake/0000775000372000037200000000000013255253402016304 5ustar00travistravis00000000000000zeromq-4.2.5/builds/cmake/Modules/0000775000372000037200000000000013255253220017712 5ustar00travistravis00000000000000zeromq-4.2.5/builds/cmake/Modules/TestZMQVersion.cmake0000664000372000037200000000102113255253220023563 0ustar00travistravis00000000000000 file(READ "${PROJECT_SOURCE_DIR}/include/zmq.h" _ZMQ_H_CONTENTS) string(REGEX REPLACE ".*#define ZMQ_VERSION_MAJOR ([0-9]+).*" "\\1" ZMQ_VERSION_MAJOR "${_ZMQ_H_CONTENTS}") string(REGEX REPLACE ".*#define ZMQ_VERSION_MINOR ([0-9]+).*" "\\1" ZMQ_VERSION_MINOR "${_ZMQ_H_CONTENTS}") string(REGEX REPLACE ".*#define ZMQ_VERSION_PATCH ([0-9]+).*" "\\1" ZMQ_VERSION_PATCH "${_ZMQ_H_CONTENTS}") set(ZMQ_VERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}") message(STATUS "Detected ZMQ Version - ${ZMQ_VERSION}") zeromq-4.2.5/builds/cmake/Modules/ClangFormat.cmake0000664000372000037200000000300213255253220023104 0ustar00travistravis00000000000000# additional target to perform clang-format run, requires clang-format # get all project files file(GLOB_RECURSE ALL_SOURCE_FILES RELATIVE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/*.cpp ${CMAKE_SOURCE_DIR}/src/*.h ${CMAKE_SOURCE_DIR}/src/*.hpp ${CMAKE_SOURCE_DIR}/tests/*.cpp ${CMAKE_SOURCE_DIR}/tests/*.h ${CMAKE_SOURCE_DIR}/tests/*.hpp ${CMAKE_SOURCE_DIR}/perf/*.cpp ${CMAKE_SOURCE_DIR}/perf/*.h ${CMAKE_SOURCE_DIR}/perf/*.hpp ${CMAKE_SOURCE_DIR}/tools/*.cpp ${CMAKE_SOURCE_DIR}/tools/*.h ${CMAKE_SOURCE_DIR}/tools/*.hpp ${CMAKE_SOURCE_DIR}/include/*.h ) if("${CLANG_FORMAT}" STREQUAL "") set(CLANG_FORMAT "clang-format") endif() add_custom_target( clang-format COMMAND ${CLANG_FORMAT} -style=file -i ${ALL_SOURCE_FILES} ) function(JOIN VALUES GLUE OUTPUT) string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}") set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) endfunction() configure_file(builds/cmake/clang-format-check.sh.in clang-format-check.sh @ONLY) add_custom_target( clang-format-check COMMAND chmod +x clang-format-check.sh COMMAND ./clang-format-check.sh COMMENT "Checking correct formatting according to .clang-format file using ${CLANG_FORMAT}" ) add_custom_target( clang-format-diff COMMAND ${CLANG_FORMAT} -style=file -i ${ALL_SOURCE_FILES} COMMAND git diff ${ALL_SOURCE_FILES} COMMENT "Formatting with clang-format (using ${CLANG_FORMAT}) and showing differences with latest commit" ) zeromq-4.2.5/builds/cmake/Modules/FindAsciiDoc.cmake0000664000372000037200000000167213255253220023201 0ustar00travistravis00000000000000# - Find Asciidoc # this module looks for asciidoc and a2x # # ASCIIDOC_EXECUTABLE - the full path to asciidoc # ASCIIDOC_FOUND - If false, don't attempt to use asciidoc. # A2X_EXECUTABLE - the full path to a2x # A2X_FOUND - If false, don't attempt to use a2x. set (PROGRAMFILESX86 "PROGRAMFILES(X86)") find_program(ASCIIDOC_EXECUTABLE asciidoc asciidoc.py PATHS "$ENV{ASCIIDOC_ROOT}" "$ENV{PROGRAMW6432}/asciidoc" "$ENV{PROGRAMFILES}/asciidoc" "$ENV{${PROGRAMFILESX86}}/asciidoc") find_program(A2X_EXECUTABLE a2x PATHS "$ENV{ASCIIDOC_ROOT}" "$ENV{PROGRAMW6432}/asciidoc" "$ENV{PROGRAMFILES}/asciidoc" "$ENV{${PROGRAMFILESX86}}/asciidoc") include(FindPackageHandleStandardArgs) find_package_handle_standard_ARGS(AsciiDoc REQUIRED_VARS ASCIIDOC_EXECUTABLE) mark_as_advanced(ASCIIDOC_EXECUTABLE A2X_EXECUTABLE) zeromq-4.2.5/builds/cmake/Modules/FindSodium.cmake0000664000372000037200000000310113255253220022750 0ustar00travistravis00000000000000################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Please refer to the README for information about making permanent changes. # ################################################################################ if (NOT MSVC) include(FindPkgConfig) pkg_check_modules(PC_SODIUM "libsodium") if (NOT PC_SODIUM_FOUND) pkg_check_modules(PC_SODIUM "sodium") endif (NOT PC_SODIUM_FOUND) if (PC_SODIUM_FOUND) set(SODIUM_INCLUDE_HINTS ${PC_SODIUM_INCLUDE_DIRS} ${PC_SODIUM_INCLUDE_DIRS}/*) set(SODIUM_LIBRARY_HINTS ${PC_SODIUM_LIBRARY_DIRS} ${PC_SODIUM_LIBRARY_DIRS}/*) endif() endif (NOT MSVC) # some libraries install the headers is a subdirectory of the include dir # returned by pkg-config, so use a wildcard match to improve chances of finding # headers and libraries. find_path( SODIUM_INCLUDE_DIRS NAMES sodium.h HINTS ${SODIUM_INCLUDE_HINTS} ) find_library( SODIUM_LIBRARIES NAMES libsodium sodium HINTS ${SODIUM_LIBRARY_HINTS} ) 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) ################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Please refer to the README for information about making permanent changes. # ################################################################################ zeromq-4.2.5/builds/cmake/Modules/ZMQSourceRunChecks.cmake0000664000372000037200000001456313255253220024363 0ustar00travistravis00000000000000 macro(zmq_check_sock_cloexec) message(STATUS "Checking whether SOCK_CLOEXEC is supported") check_c_source_runs( " #include #include int main(int argc, char *argv []) { int s = socket(PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); return(s == -1); } " ZMQ_HAVE_SOCK_CLOEXEC) endmacro() macro(zmq_check_efd_cloexec) message(STATUS "Checking whether EFD_CLOEXEC is supported") check_c_source_runs( " #include int main(int argc, char *argv []) { int s = eventfd (0, EFD_CLOEXEC); return(s == -1); } " ZMQ_HAVE_EVENTFD_CLOEXEC) endmacro() macro(zmq_check_o_cloexec) message(STATUS "Checking whether O_CLOEXEC is supported") check_c_source_runs( " #include #include #include int main(int argc, char *argv []) { int s = open (\"/dev/null\", O_CLOEXEC | O_RDONLY); return (s == -1); } " ZMQ_HAVE_O_CLOEXEC) endmacro() macro(zmq_check_so_bindtodevice) message(STATUS "Checking whether SO_BINDTODEVICE is supported") check_c_source_runs( " #include int main(int argc, char *argv []) { /* Actually making the setsockopt() call requires CAP_NET_RAW */ #ifndef SO_BINDTODEVICE return 1; #else return 0; #endif } " ZMQ_HAVE_SO_BINDTODEVICE) endmacro() # TCP keep-alives Checks. macro(zmq_check_so_keepalive) message(STATUS "Checking whether SO_KEEPALIVE is supported") check_c_source_runs( " #include #include int main(int argc, char *argv []) { int s, rc, opt = 1; return( ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) ); } " ZMQ_HAVE_SO_KEEPALIVE) endmacro() macro(zmq_check_tcp_keepcnt) message(STATUS "Checking whether TCP_KEEPCNT is supported") check_c_source_runs( " #include #include #include #include int main(int argc, char *argv []) { int s, rc, opt = 1; return( ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) || ((rc = setsockopt(s, IPPROTO_TCP, TCP_KEEPCNT,(char*) &opt, sizeof(int))) == -1) ); } " ZMQ_HAVE_TCP_KEEPCNT) endmacro() macro(zmq_check_tcp_keepidle) message(STATUS "Checking whether TCP_KEEPIDLE is supported") check_c_source_runs( " #include #include #include #include int main(int argc, char *argv []) { int s, rc, opt = 1; return( ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) || ((rc = setsockopt(s, IPPROTO_TCP, TCP_KEEPIDLE,(char*) &opt, sizeof(int))) == -1) ); } " ZMQ_HAVE_TCP_KEEPIDLE) endmacro() macro(zmq_check_tcp_keepintvl) message(STATUS "Checking whether TCP_KEEPINTVL is supported") check_c_source_runs( " #include #include #include #include int main(int argc, char *argv []) { int s, rc, opt = 1; return( ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) || ((rc = setsockopt(s, IPPROTO_TCP, TCP_KEEPINTVL,(char*) &opt, sizeof(int))) == -1) ); } " ZMQ_HAVE_TCP_KEEPINTVL) endmacro() macro(zmq_check_tcp_keepalive) message(STATUS "Checking whether TCP_KEEPALIVE is supported") check_c_source_runs( " #include #include #include #include int main(int argc, char *argv []) { int s, rc, opt = 1; return( ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) || ((rc = setsockopt(s, IPPROTO_TCP, TCP_KEEPALIVE,(char*) &opt, sizeof(int))) == -1) ); } " ZMQ_HAVE_TCP_KEEPALIVE) endmacro() macro(zmq_check_tcp_tipc) message(STATUS "Checking whether TIPC is supported") check_c_source_runs( " #include #include #include #include #include #include int main(int argc, char *argv []) { struct sockaddr_tipc topsrv; int sd = socket(AF_TIPC, SOCK_SEQPACKET, 0); memset(&topsrv, 0, sizeof(topsrv)); topsrv.family = AF_TIPC; topsrv.addrtype = TIPC_ADDR_NAME; topsrv.addr.name.name.type = TIPC_TOP_SRV; topsrv.addr.name.name.instance = TIPC_TOP_SRV; fcntl(sd, F_SETFL, O_NONBLOCK); } " ZMQ_HAVE_TIPC) endmacro() macro(zmq_check_pthread_setname) message(STATUS "Checking pthread_setname signature") set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS "-D_GNU_SOURCE -Werror -pthread") check_c_source_runs( " #include int main(int argc, char *argv []) { pthread_setname_np (\"foo\"); return 0; } " ZMQ_HAVE_PTHREAD_SETNAME_1) check_c_source_runs( " #include int main(int argc, char *argv []) { pthread_setname_np (pthread_self(), \"foo\"); return 0; } " ZMQ_HAVE_PTHREAD_SETNAME_2) check_c_source_runs( " #include int main(int argc, char *argv []) { pthread_setname_np (pthread_self(), \"foo\", (void *)0); return 0; } " ZMQ_HAVE_PTHREAD_SETNAME_3) check_c_source_runs( " #include int main(int argc, char *argv []) { pthread_set_name_np (pthread_self(), \"foo\"); return 0; } " ZMQ_HAVE_PTHREAD_SET_NAME) set(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) endmacro() macro(zmq_check_pthread_setaffinity) message(STATUS "Checking pthread_setaffinity signature") set(SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS "-D_GNU_SOURCE -Werror -pthread") check_c_source_runs( " #include int main(int argc, char *argv []) { cpu_set_t test; pthread_setaffinity_np (pthread_self(), sizeof(cpu_set_t), &test); return 0; } " ZMQ_HAVE_PTHREAD_SETAFFINITY) set(CMAKE_REQUIRED_FLAGS ${SAVE_CMAKE_REQUIRED_FLAGS}) endmacro() macro(zmq_check_getrandom) message(STATUS "Checking whether getrandom is supported") check_c_source_runs( " #include int main (int argc, char *argv []) { char buf[4]; getrandom(buf, 4, 0); } " ZMQ_HAVE_GETRANDOM) endmacro() zeromq-4.2.5/builds/cmake/NSIS.template64.in0000664000372000037200000006646213255253220021410 0ustar00travistravis00000000000000; CPack install script designed for a nmake build ;-------------------------------- ; You must define these values !define VERSION "@CPACK_PACKAGE_VERSION@" !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@" !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" ;-------------------------------- ;Variables Var MUI_TEMP Var STARTMENU_FOLDER Var SV_ALLUSERS Var START_MENU Var DO_NOT_ADD_TO_PATH Var ADD_TO_PATH_ALL_USERS Var ADD_TO_PATH_CURRENT_USER Var INSTALL_DESKTOP Var IS_DEFAULT_INSTALLDIR ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;Default installation folder ;InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" InstallDir "$PROGRAMFILES64\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;-------------------------------- ;General ;Name and file Name "@CPACK_NSIS_PACKAGE_NAME@" OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" ;Set compression SetCompressor @CPACK_NSIS_COMPRESSOR@ @CPACK_NSIS_DEFINES@ !include Sections.nsh ;--- Component support macros: --- ; The code for the add/remove functionality is from: ; http://nsis.sourceforge.net/Add/Remove_Functionality ; It has been modified slightly and extended to provide ; inter-component dependencies. Var AR_SecFlags Var AR_RegFlags @CPACK_NSIS_SECTION_SELECTED_VARS@ ; Loads the "selected" flag for the section named SecName into the ; variable VarName. !macro LoadSectionSelectedIntoVar SecName VarName SectionGetFlags ${${SecName}} $${VarName} IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits !macroend ; Loads the value of a variable... can we get around this? !macro LoadVar VarName IntOp $R0 0 + $${VarName} !macroend ; Sets the value of a variable !macro StoreVar VarName IntValue IntOp $${VarName} 0 + ${IntValue} !macroend !macro InitSection SecName ; This macro reads component installed flag from the registry and ;changes checked state of the section on the components page. ;Input: section index constant name specified in Section command. ClearErrors ;Reading component status from registry ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" "Installed" IfErrors "default_${SecName}" ;Status will stay default if registry value not found ;(component was never installed) IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit ; Note whether this component was installed before !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags IntOp $R0 $AR_RegFlags & $AR_RegFlags ;Writing modified flags SectionSetFlags ${${SecName}} $AR_SecFlags "default_${SecName}:" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected !macroend !macro FinishSection SecName ; This macro reads section flag set by user and removes the section ;if it is not selected. ;Then it writes component installed flag to registry ;Input: section index constant name specified in Section command. SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags ;Checking lowest bit: IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED} IntCmp $AR_SecFlags 1 "leave_${SecName}" ;Section is not selected: ;Calling Section uninstall macro and writing zero installed flag !insertmacro "Remove_${${SecName}}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" \ "Installed" 0 Goto "exit_${SecName}" "leave_${SecName}:" ;Section is selected: WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)\Components\${SecName}" \ "Installed" 1 "exit_${SecName}:" !macroend !macro RemoveSection SecName ; This macro is used to call section's Remove_... macro ;from the uninstaller. ;Input: section index constant name specified in Section command. !insertmacro "Remove_${${SecName}}" !macroend ; Determine whether the selection of SecName changed !macro MaybeSelectionChanged SecName !insertmacro LoadVar ${SecName}_selected SectionGetFlags ${${SecName}} $R1 IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits ; See if the status has changed: IntCmp $R0 $R1 "${SecName}_unchanged" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected" !insertmacro "Deselect_required_by_${SecName}" goto "${SecName}_unchanged" "${SecName}_was_selected:" !insertmacro "Select_${SecName}_depends" "${SecName}_unchanged:" !macroend ;--- End of Add/Remove macros --- ;-------------------------------- ;Interface Settings !define MUI_HEADERIMAGE !define MUI_ABORTWARNING ;-------------------------------- ; path functions !verbose 3 !include "WinMessages.NSH" !verbose 4 ;---------------------------------------- ; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02" ;---------------------------------------- !verbose 3 !include "WinMessages.NSH" !verbose 4 ;==================================================== ; get_NT_environment ; Returns: the selected environment ; Output : head of the stack ;==================================================== !macro select_NT_profile UN Function ${UN}select_NT_profile StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single DetailPrint "Selected environment for all users" Push "all" Return environment_single: DetailPrint "Selected environment for current user only." Push "current" Return FunctionEnd !macroend !insertmacro select_NT_profile "" !insertmacro select_NT_profile "un." ;---------------------------------------------------- !define NT_current_env 'HKCU "Environment"' !define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' !ifndef WriteEnvStr_RegKey !ifdef ALL_USERS !define WriteEnvStr_RegKey \ 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' !else !define WriteEnvStr_RegKey 'HKCU "Environment"' !endif !endif ; AddToPath - Adds the given dir to the search path. ; Input - head of the stack ; Note - Win9x systems requires reboot Function AddToPath Exch $0 Push $1 Push $2 Push $3 # don't add if the path doesn't exist IfFileExists "$0\*.*" "" AddToPath_done ReadEnvStr $1 PATH ; if the path is too long for a NSIS variable NSIS will return a 0 ; length string. If we find that, then warn and skip any path ; modification as it will trash the existing path. StrLen $2 $1 IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done CheckPathLength_ShowPathWarning: Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!" Goto AddToPath_done CheckPathLength_Done: Push "$1;" Push "$0;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Push "$1;" Push "$0\;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done GetFullPathName /SHORT $3 $0 Push "$1;" Push "$3;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Push "$1;" Push "$3\;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Call IsNT Pop $1 StrCmp $1 1 AddToPath_NT ; Not on NT StrCpy $1 $WINDIR 2 FileOpen $1 "$1\autoexec.bat" a FileSeek $1 -1 END FileReadByte $1 $2 IntCmp $2 26 0 +2 +2 # DOS EOF FileSeek $1 -1 END # write over EOF FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" FileClose $1 SetRebootFlag true Goto AddToPath_done AddToPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" Goto DoTrim ReadAllKey: ReadRegStr $1 ${NT_all_env} "PATH" DoTrim: StrCmp $1 "" AddToPath_NTdoIt Push $1 Call Trim Pop $1 StrCpy $0 "$1;$0" AddToPath_NTdoIt: StrCmp $ADD_TO_PATH_ALL_USERS "1" WriteAllKey WriteRegExpandStr ${NT_current_env} "PATH" $0 Goto DoSend WriteAllKey: WriteRegExpandStr ${NT_all_env} "PATH" $0 DoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 AddToPath_done: Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd ; RemoveFromPath - Remove a given dir from the path ; Input: head of the stack Function un.RemoveFromPath Exch $0 Push $1 Push $2 Push $3 Push $4 Push $5 Push $6 IntFmt $6 "%c" 26 # DOS EOF Call un.IsNT Pop $1 StrCmp $1 1 unRemoveFromPath_NT ; Not on NT StrCpy $1 $WINDIR 2 FileOpen $1 "$1\autoexec.bat" r GetTempFileName $4 FileOpen $2 $4 w GetFullPathName /SHORT $0 $0 StrCpy $0 "SET PATH=%PATH%;$0" Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoop: FileRead $1 $3 StrCpy $5 $3 1 -1 # read last char StrCmp $5 $6 0 +2 # if DOS EOF StrCpy $3 $3 -1 # remove DOS EOF so we can compare StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "" unRemoveFromPath_dosLoopEnd FileWrite $2 $3 Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoopRemoveLine: SetRebootFlag true Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoopEnd: FileClose $2 FileClose $1 StrCpy $1 $WINDIR 2 Delete "$1\autoexec.bat" CopyFiles /SILENT $4 "$1\autoexec.bat" Delete $4 Goto unRemoveFromPath_done unRemoveFromPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" Goto unDoTrim unReadAllKey: ReadRegStr $1 ${NT_all_env} "PATH" unDoTrim: StrCpy $5 $1 1 -1 # copy last char StrCmp $5 ";" +2 # if last char != ; StrCpy $1 "$1;" # append ; Push $1 Push "$0;" Call un.StrStr ; Find `$0;` in $1 Pop $2 ; pos of our dir StrCmp $2 "" unRemoveFromPath_done ; else, it is in path # $0 - path to add # $1 - path var StrLen $3 "$0;" StrLen $4 $2 StrCpy $5 $1 -$4 # $5 is now the part before the path to remove StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove StrCpy $3 $5$6 StrCpy $5 $3 1 -1 # copy last char StrCmp $5 ";" 0 +2 # if last char == ; StrCpy $3 $3 -1 # remove last char StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey WriteRegExpandStr ${NT_current_env} "PATH" $3 Goto unDoSend unWriteAllKey: WriteRegExpandStr ${NT_all_env} "PATH" $3 unDoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 unRemoveFromPath_done: Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Uninstall sutff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ########################################### # Utility Functions # ########################################### ;==================================================== ; IsNT - Returns 1 if the current system is NT, 0 ; otherwise. ; Output: head of the stack ;==================================================== ; IsNT ; no input ; output, top of the stack = 1 if NT or 0 if not ; ; Usage: ; Call IsNT ; Pop $R0 ; ($R0 at this point is 1 or 0) !macro IsNT un Function ${un}IsNT Push $0 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $0 "" 0 IsNT_yes ; we are not NT. Pop $0 Push 0 Return IsNT_yes: ; NT!!! Pop $0 Push 1 FunctionEnd !macroend !insertmacro IsNT "" !insertmacro IsNT "un." ; StrStr ; input, top of stack = string to search for ; top of stack-1 = string to search in ; output, top of stack (replaces with the portion of the string remaining) ; modifies no other variables. ; ; Usage: ; Push "this is a long ass string" ; Push "ass" ; Call StrStr ; Pop $R0 ; ($R0 at this point is "ass string") !macro StrStr un Function ${un}StrStr Exch $R1 ; st=haystack,old$R1, $R1=needle Exch ; st=old$R1,haystack Exch $R2 ; st=old$R1,old$R2, $R2=haystack Push $R3 Push $R4 Push $R5 StrLen $R3 $R1 StrCpy $R4 0 ; $R1=needle ; $R2=haystack ; $R3=len(needle) ; $R4=cnt ; $R5=tmp loop: StrCpy $R5 $R2 $R3 $R4 StrCmp $R5 $R1 done StrCmp $R5 "" done IntOp $R4 $R4 + 1 Goto loop done: StrCpy $R1 $R2 "" $R4 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Exch $R1 FunctionEnd !macroend !insertmacro StrStr "" !insertmacro StrStr "un." Function Trim ; Added by Pelaca Exch $R1 Push $R2 Loop: StrCpy $R2 "$R1" 1 -1 StrCmp "$R2" " " RTrim StrCmp "$R2" "$\n" RTrim StrCmp "$R2" "$\r" RTrim StrCmp "$R2" ";" RTrim GoTo Done RTrim: StrCpy $R1 "$R1" -1 Goto Loop Done: Pop $R2 Exch $R1 FunctionEnd Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" ConditionalAddToRegisty_EmptyString: FunctionEnd ;-------------------------------- !ifdef CPACK_USES_DOWNLOAD Function DownloadFile IfFileExists $INSTDIR\* +2 CreateDirectory $INSTDIR Pop $0 ; Skip if already downloaded IfFileExists $INSTDIR\$0 0 +2 Return StrCpy $1 "@CPACK_DOWNLOAD_SITE@" try_again: NSISdl::download "$1/$0" "$INSTDIR\$0" Pop $1 StrCmp $1 "success" success StrCmp $1 "Cancelled" cancel MessageBox MB_OK "Download failed: $1" cancel: Return success: FunctionEnd !endif ;-------------------------------- ; Installation types @CPACK_NSIS_INSTALLATION_TYPES@ ;-------------------------------- ; Component sections @CPACK_NSIS_COMPONENT_SECTIONS@ ;-------------------------------- ; Define some macro setting for the gui @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" Page custom InstallOptionsPage !insertmacro MUI_PAGE_DIRECTORY ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt" @CPACK_NSIS_PAGE_COMPONENTS@ !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;first language is the default language !insertmacro MUI_LANGUAGE "Albanian" !insertmacro MUI_LANGUAGE "Arabic" !insertmacro MUI_LANGUAGE "Basque" !insertmacro MUI_LANGUAGE "Belarusian" !insertmacro MUI_LANGUAGE "Bosnian" !insertmacro MUI_LANGUAGE "Breton" !insertmacro MUI_LANGUAGE "Bulgarian" !insertmacro MUI_LANGUAGE "Croatian" !insertmacro MUI_LANGUAGE "Czech" !insertmacro MUI_LANGUAGE "Danish" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "Estonian" !insertmacro MUI_LANGUAGE "Farsi" !insertmacro MUI_LANGUAGE "Finnish" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Greek" !insertmacro MUI_LANGUAGE "Hebrew" !insertmacro MUI_LANGUAGE "Hungarian" !insertmacro MUI_LANGUAGE "Icelandic" !insertmacro MUI_LANGUAGE "Indonesian" !insertmacro MUI_LANGUAGE "Irish" !insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "Korean" !insertmacro MUI_LANGUAGE "Kurdish" !insertmacro MUI_LANGUAGE "Latvian" !insertmacro MUI_LANGUAGE "Lithuanian" !insertmacro MUI_LANGUAGE "Luxembourgish" !insertmacro MUI_LANGUAGE "Macedonian" !insertmacro MUI_LANGUAGE "Malay" !insertmacro MUI_LANGUAGE "Mongolian" !insertmacro MUI_LANGUAGE "Norwegian" !insertmacro MUI_LANGUAGE "Polish" !insertmacro MUI_LANGUAGE "Portuguese" !insertmacro MUI_LANGUAGE "PortugueseBR" !insertmacro MUI_LANGUAGE "Romanian" !insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_LANGUAGE "Serbian" !insertmacro MUI_LANGUAGE "SerbianLatin" !insertmacro MUI_LANGUAGE "SimpChinese" !insertmacro MUI_LANGUAGE "Slovak" !insertmacro MUI_LANGUAGE "Slovenian" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "Swedish" !insertmacro MUI_LANGUAGE "Thai" !insertmacro MUI_LANGUAGE "TradChinese" !insertmacro MUI_LANGUAGE "Turkish" !insertmacro MUI_LANGUAGE "Ukrainian" !insertmacro MUI_LANGUAGE "Welsh" ;-------------------------------- ;Reserve Files ;These files should be inserted before other files in the data block ;Keep these lines before any File command ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) ReserveFile "NSIS.InstallOptions.ini" !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- ;Installer Sections Section "-Core installation" ;Use the entire tree produced by the INSTALL target. Keep the ;list of directories here in sync with the RMDir commands below. SetOutPath "$INSTDIR" @CPACK_NSIS_FULL_INSTALL@ ;Store installation folder WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" Push "DisplayName" Push "@CPACK_NSIS_DISPLAY_NAME@" Call ConditionalAddToRegisty Push "DisplayVersion" Push "@CPACK_PACKAGE_VERSION@" Call ConditionalAddToRegisty Push "Publisher" Push "@CPACK_PACKAGE_VENDOR@" Call ConditionalAddToRegisty Push "UninstallString" Push "$INSTDIR\Uninstall.exe" Call ConditionalAddToRegisty Push "NoRepair" Push "1" Call ConditionalAddToRegisty !ifdef CPACK_NSIS_ADD_REMOVE ;Create add/remove functionality Push "ModifyPath" Push "$INSTDIR\AddRemove.exe" Call ConditionalAddToRegisty !else Push "NoModify" Push "1" Call ConditionalAddToRegisty !endif ; Optional registration Push "DisplayIcon" Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" Call ConditionalAddToRegisty Push "HelpLink" Push "@CPACK_NSIS_HELP_LINK@" Call ConditionalAddToRegisty Push "URLInfoAbout" Push "@CPACK_NSIS_URL_INFO_ABOUT@" Call ConditionalAddToRegisty Push "Contact" Push "@CPACK_NSIS_CONTACT@" Call ConditionalAddToRegisty !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application ;Create shortcuts CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" @CPACK_NSIS_CREATE_ICONS@ @CPACK_NSIS_CREATE_ICONS_EXTRA@ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" ;Read a value from an InstallOptions INI file !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State" !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State" ; Write special uninstall registry entries Push "StartMenu" Push "$STARTMENU_FOLDER" Call ConditionalAddToRegisty Push "DoNotAddToPath" Push "$DO_NOT_ADD_TO_PATH" Call ConditionalAddToRegisty Push "AddToPathAllUsers" Push "$ADD_TO_PATH_ALL_USERS" Call ConditionalAddToRegisty Push "AddToPathCurrentUser" Push "$ADD_TO_PATH_CURRENT_USER" Call ConditionalAddToRegisty Push "InstallToDesktop" Push "$INSTALL_DESKTOP" Call ConditionalAddToRegisty !insertmacro MUI_STARTMENU_WRITE_END @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ SectionEnd Section "-Add to path" Push $INSTDIR\bin StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 Call AddToPath doNotAddToPath: SectionEnd ;-------------------------------- ; Create custom pages Function InstallOptionsPage !insertmacro MUI_HEADER_TEXT "Install Options" "Choose options for installing @CPACK_NSIS_PACKAGE_NAME@" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini" FunctionEnd ;-------------------------------- ; determine admin versus local install Function un.onInit ClearErrors UserInfo::GetName IfErrors noLM Pop $0 UserInfo::GetAccountType Pop $1 StrCmp $1 "Admin" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' Goto done StrCmp $1 "Power" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' Goto done noLM: ;Get installation folder from registry if available done: ;Disable WoW64 redirection SetRegView 64 FunctionEnd ;--- Add/Remove callback functions: --- !macro SectionList MacroName ;This macro used to perform operation on multiple sections. ;List all of your components in following manner here. @CPACK_NSIS_COMPONENT_SECTION_LIST@ !macroend Section -FinishComponents ;Removes unselected components and writes component status to registry !insertmacro SectionList "FinishSection" !ifdef CPACK_NSIS_ADD_REMOVE ; Get the name of the installer executable System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' StrCpy $R3 $R0 ; Strip off the last 13 characters, to see if we have AddRemove.exe StrLen $R1 $R0 IntOp $R1 $R0 - 13 StrCpy $R2 $R0 13 $R1 StrCmp $R2 "AddRemove.exe" addremove_installed ; We're not running AddRemove.exe, so install it CopyFiles $R3 $INSTDIR\AddRemove.exe addremove_installed: !endif SectionEnd ;--- End of Add/Remove callback functions --- ;-------------------------------- ; Component dependencies Function .onSelChange !insertmacro SectionList MaybeSelectionChanged FunctionEnd ;-------------------------------- ;Uninstaller Section Section "Uninstall" ReadRegStr $START_MENU SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "AddToPathAllUsers" ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "AddToPathCurrentUser" ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" ReadRegStr $INSTALL_DESKTOP SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" "InstallToDesktop" ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ ;Remove files we installed. ;Keep the list of directories here in sync with the File commands above. @CPACK_NSIS_DELETE_FILES@ @CPACK_NSIS_DELETE_DIRECTORIES@ !ifdef CPACK_NSIS_ADD_REMOVE ;Remove the add/remove program Delete "$INSTDIR\AddRemove.exe" !endif ;Remove the uninstaller itself. Delete "$INSTDIR\Uninstall.exe" DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@ (x64)" ;Remove the installation directory if it is empty. RMDir "$INSTDIR" ; Remove the registry entries. DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ; Removes all optional components !insertmacro SectionList "RemoveSection" !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS@ @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors startMenuDeleteLoopDone StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: ; If the user changed the shortcut, then untinstall may not work. This should ; try to fix it. StrCpy $MUI_TEMP "$START_MENU" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" secondStartMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors secondStartMenuDeleteLoopDone StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop secondStartMenuDeleteLoopDone: DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" Push $INSTDIR\bin StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0 Call un.RemoveFromPath doNotRemoveFromPath: SectionEnd ;-------------------------------- ; determine admin versus local install ; Is install for "AllUsers" or "JustMe"? ; Default to "JustMe" - set to "AllUsers" if admin or on Win9x ; This function is used for the very first "custom page" of the installer. ; This custom page does not show up visibly, but it executes prior to the ; first visible page and sets up $INSTDIR properly... ; Choose different default installation folder based on SV_ALLUSERS... ; "Program Files" for AllUsers, "My Documents" for JustMe... Function .onInit ; Reads components status for registry !insertmacro SectionList "InitSection" ; check to see if /D has been used to change ; the install directory by comparing it to the ; install directory that is expected to be the ; default StrCpy $IS_DEFAULT_INSTALLDIR 0 ;StrCmp "$INSTDIR" "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 StrCmp "$INSTDIR" "$PROGRAMFILES64\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 StrCpy $IS_DEFAULT_INSTALLDIR 1 StrCpy $SV_ALLUSERS "JustMe" ; if default install dir then change the default ; if it is installed for JustMe StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;Disable WoW64 redirection SetRegView 64 ClearErrors UserInfo::GetName IfErrors noLM Pop $0 UserInfo::GetAccountType Pop $1 StrCmp $1 "Admin" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' StrCpy $SV_ALLUSERS "AllUsers" Goto done StrCmp $1 "Power" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' StrCpy $SV_ALLUSERS "AllUsers" Goto done noLM: StrCpy $SV_ALLUSERS "AllUsers" ;Get installation folder from registry if available done: StrCmp $SV_ALLUSERS "AllUsers" 0 +3 StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 ;StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" StrCpy $INSTDIR "$PROGRAMFILES64\@CPACK_PACKAGE_INSTALL_DIRECTORY@" StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" noOptionsPage: FunctionEnd zeromq-4.2.5/builds/cmake/ZeroMQConfig.cmake.in0000664000372000037200000000130213255253220022210 0ustar00travistravis00000000000000# ZeroMQ cmake module # # The following import targets are created # # :: # # libzmq-static # libzmq # # This module sets the following variables in your project:: # # ZeroMQ_FOUND - true if ZeroMQ found on the system # ZeroMQ_INCLUDE_DIR - the directory containing ZeroMQ headers # ZeroMQ_LIBRARY - # ZeroMQ_STATIC_LIBRARY @PACKAGE_INIT@ if(NOT TARGET libzmq AND NOT TARGET libzmq-static) include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") get_target_property(@PROJECT_NAME@_INCLUDE_DIR libzmq INTERFACE_INCLUDE_DIRECTORIES) get_target_property(@PROJECT_NAME@_LIBRARY libzmq LOCATION) get_target_property(@PROJECT_NAME@_STATIC_LIBRARY libzmq-static LOCATION) endif() zeromq-4.2.5/builds/cmake/platform.hpp.in0000664000372000037200000000406613255253220021252 0ustar00travistravis00000000000000#ifndef __ZMQ_PLATFORM_HPP_INCLUDED__ #define __ZMQ_PLATFORM_HPP_INCLUDED__ #cmakedefine ZMQ_USE_KQUEUE #cmakedefine ZMQ_USE_EPOLL #cmakedefine ZMQ_USE_EPOLL_CLOEXEC #cmakedefine ZMQ_USE_DEVPOLL #cmakedefine ZMQ_USE_POLL #cmakedefine ZMQ_USE_SELECT #cmakedefine ZMQ_FORCE_MUTEXES #cmakedefine HAVE_FORK #cmakedefine HAVE_CLOCK_GETTIME #cmakedefine HAVE_GETHRTIME #cmakedefine HAVE_MKDTEMP #cmakedefine ZMQ_HAVE_UIO #cmakedefine ZMQ_HAVE_EVENTFD #cmakedefine ZMQ_HAVE_EVENTFD_CLOEXEC #cmakedefine ZMQ_HAVE_IFADDRS #cmakedefine ZMQ_HAVE_SO_BINDTODEVICE #cmakedefine ZMQ_HAVE_SO_PEERCRED #cmakedefine ZMQ_HAVE_LOCAL_PEERCRED #cmakedefine ZMQ_HAVE_O_CLOEXEC #cmakedefine ZMQ_HAVE_SOCK_CLOEXEC #cmakedefine ZMQ_HAVE_SO_KEEPALIVE #cmakedefine ZMQ_HAVE_TCP_KEEPCNT #cmakedefine ZMQ_HAVE_TCP_KEEPIDLE #cmakedefine ZMQ_HAVE_TCP_KEEPINTVL #cmakedefine ZMQ_HAVE_TCP_KEEPALIVE #cmakedefine ZMQ_HAVE_PTHREAD_SETNAME_1 #cmakedefine ZMQ_HAVE_PTHREAD_SETNAME_2 #cmakedefine ZMQ_HAVE_PTHREAD_SETNAME_3 #cmakedefine ZMQ_HAVE_PTHREAD_SET_NAME #cmakedefine HAVE_ACCEPT4 #cmakedefine ZMQ_HAVE_OPENPGM #cmakedefine ZMQ_MAKE_VALGRIND_HAPPY #cmakedefine ZMQ_HAVE_CURVE #cmakedefine ZMQ_USE_TWEETNACL #cmakedefine ZMQ_USE_LIBSODIUM #cmakedefine SODIUM_STATIC #ifdef _AIX #define ZMQ_HAVE_AIX #endif #if defined ANDROID #define ZMQ_HAVE_ANDROID #endif #if defined __CYGWIN__ #define ZMQ_HAVE_CYGWIN #endif #if defined __MINGW32__ #define ZMQ_HAVE_MINGW32 #endif #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) #define ZMQ_HAVE_FREEBSD #endif #if defined __hpux #define ZMQ_HAVE_HPUX #endif #if defined __linux__ #define ZMQ_HAVE_LINUX #endif #if defined __NetBSD__ #define ZMQ_HAVE_NETBSD #endif #if defined __OpenBSD__ #define ZMQ_HAVE_OPENBSD #endif #if defined __VMS #define ZMQ_HAVE_OPENVMS #endif #if defined __APPLE__ #define ZMQ_HAVE_OSX #endif #if defined __QNXNTO__ #define ZMQ_HAVE_QNXNTO #endif #if defined(sun) || defined(__sun) #define ZMQ_HAVE_SOLARIS #endif #cmakedefine ZMQ_HAVE_WINDOWS #cmakedefine ZMQ_HAVE_WINDOWS_UWP #endif zeromq-4.2.5/builds/cmake/NSIS.template32.in0000664000372000037200000006600113255253220021370 0ustar00travistravis00000000000000; CPack install script designed for a nmake build ;-------------------------------- ; You must define these values !define VERSION "@CPACK_PACKAGE_VERSION@" !define PATCH "@CPACK_PACKAGE_VERSION_PATCH@" !define INST_DIR "@CPACK_TEMPORARY_DIRECTORY@" ;-------------------------------- ;Variables Var MUI_TEMP Var STARTMENU_FOLDER Var SV_ALLUSERS Var START_MENU Var DO_NOT_ADD_TO_PATH Var ADD_TO_PATH_ALL_USERS Var ADD_TO_PATH_CURRENT_USER Var INSTALL_DESKTOP Var IS_DEFAULT_INSTALLDIR ;-------------------------------- ;Include Modern UI !include "MUI.nsh" ;Default installation folder InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;InstallDir "$PROGRAMFILES64\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;-------------------------------- ;General ;Name and file Name "@CPACK_NSIS_PACKAGE_NAME@" OutFile "@CPACK_TOPLEVEL_DIRECTORY@/@CPACK_OUTPUT_FILE_NAME@" ;Set compression SetCompressor @CPACK_NSIS_COMPRESSOR@ @CPACK_NSIS_DEFINES@ !include Sections.nsh ;--- Component support macros: --- ; The code for the add/remove functionality is from: ; http://nsis.sourceforge.net/Add/Remove_Functionality ; It has been modified slightly and extended to provide ; inter-component dependencies. Var AR_SecFlags Var AR_RegFlags @CPACK_NSIS_SECTION_SELECTED_VARS@ ; Loads the "selected" flag for the section named SecName into the ; variable VarName. !macro LoadSectionSelectedIntoVar SecName VarName SectionGetFlags ${${SecName}} $${VarName} IntOp $${VarName} $${VarName} & ${SF_SELECTED} ;Turn off all other bits !macroend ; Loads the value of a variable... can we get around this? !macro LoadVar VarName IntOp $R0 0 + $${VarName} !macroend ; Sets the value of a variable !macro StoreVar VarName IntValue IntOp $${VarName} 0 + ${IntValue} !macroend !macro InitSection SecName ; This macro reads component installed flag from the registry and ;changes checked state of the section on the components page. ;Input: section index constant name specified in Section command. ClearErrors ;Reading component status from registry ReadRegDWORD $AR_RegFlags HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" "Installed" IfErrors "default_${SecName}" ;Status will stay default if registry value not found ;(component was never installed) IntOp $AR_RegFlags $AR_RegFlags & ${SF_SELECTED} ;Turn off all other bits SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading default section flags IntOp $AR_SecFlags $AR_SecFlags & 0xFFFE ;Turn lowest (enabled) bit off IntOp $AR_SecFlags $AR_RegFlags | $AR_SecFlags ;Change lowest bit ; Note whether this component was installed before !insertmacro StoreVar ${SecName}_was_installed $AR_RegFlags IntOp $R0 $AR_RegFlags & $AR_RegFlags ;Writing modified flags SectionSetFlags ${${SecName}} $AR_SecFlags "default_${SecName}:" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected !macroend !macro FinishSection SecName ; This macro reads section flag set by user and removes the section ;if it is not selected. ;Then it writes component installed flag to registry ;Input: section index constant name specified in Section command. SectionGetFlags ${${SecName}} $AR_SecFlags ;Reading section flags ;Checking lowest bit: IntOp $AR_SecFlags $AR_SecFlags & ${SF_SELECTED} IntCmp $AR_SecFlags 1 "leave_${SecName}" ;Section is not selected: ;Calling Section uninstall macro and writing zero installed flag !insertmacro "Remove_${${SecName}}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ "Installed" 0 Goto "exit_${SecName}" "leave_${SecName}:" ;Section is selected: WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@\Components\${SecName}" \ "Installed" 1 "exit_${SecName}:" !macroend !macro RemoveSection SecName ; This macro is used to call section's Remove_... macro ;from the uninstaller. ;Input: section index constant name specified in Section command. !insertmacro "Remove_${${SecName}}" !macroend ; Determine whether the selection of SecName changed !macro MaybeSelectionChanged SecName !insertmacro LoadVar ${SecName}_selected SectionGetFlags ${${SecName}} $R1 IntOp $R1 $R1 & ${SF_SELECTED} ;Turn off all other bits ; See if the status has changed: IntCmp $R0 $R1 "${SecName}_unchanged" !insertmacro LoadSectionSelectedIntoVar ${SecName} ${SecName}_selected IntCmp $R1 ${SF_SELECTED} "${SecName}_was_selected" !insertmacro "Deselect_required_by_${SecName}" goto "${SecName}_unchanged" "${SecName}_was_selected:" !insertmacro "Select_${SecName}_depends" "${SecName}_unchanged:" !macroend ;--- End of Add/Remove macros --- ;-------------------------------- ;Interface Settings !define MUI_HEADERIMAGE !define MUI_ABORTWARNING ;-------------------------------- ; path functions !verbose 3 !include "WinMessages.NSH" !verbose 4 ;---------------------------------------- ; based upon a script of "Written by KiCHiK 2003-01-18 05:57:02" ;---------------------------------------- !verbose 3 !include "WinMessages.NSH" !verbose 4 ;==================================================== ; get_NT_environment ; Returns: the selected environment ; Output : head of the stack ;==================================================== !macro select_NT_profile UN Function ${UN}select_NT_profile StrCmp $ADD_TO_PATH_ALL_USERS "1" 0 environment_single DetailPrint "Selected environment for all users" Push "all" Return environment_single: DetailPrint "Selected environment for current user only." Push "current" Return FunctionEnd !macroend !insertmacro select_NT_profile "" !insertmacro select_NT_profile "un." ;---------------------------------------------------- !define NT_current_env 'HKCU "Environment"' !define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' !ifndef WriteEnvStr_RegKey !ifdef ALL_USERS !define WriteEnvStr_RegKey \ 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' !else !define WriteEnvStr_RegKey 'HKCU "Environment"' !endif !endif ; AddToPath - Adds the given dir to the search path. ; Input - head of the stack ; Note - Win9x systems requires reboot Function AddToPath Exch $0 Push $1 Push $2 Push $3 # don't add if the path doesn't exist IfFileExists "$0\*.*" "" AddToPath_done ReadEnvStr $1 PATH ; if the path is too long for a NSIS variable NSIS will return a 0 ; length string. If we find that, then warn and skip any path ; modification as it will trash the existing path. StrLen $2 $1 IntCmp $2 0 CheckPathLength_ShowPathWarning CheckPathLength_Done CheckPathLength_Done CheckPathLength_ShowPathWarning: Messagebox MB_OK|MB_ICONEXCLAMATION "Warning! PATH too long installer unable to modify PATH!" Goto AddToPath_done CheckPathLength_Done: Push "$1;" Push "$0;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Push "$1;" Push "$0\;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done GetFullPathName /SHORT $3 $0 Push "$1;" Push "$3;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Push "$1;" Push "$3\;" Call StrStr Pop $2 StrCmp $2 "" "" AddToPath_done Call IsNT Pop $1 StrCmp $1 1 AddToPath_NT ; Not on NT StrCpy $1 $WINDIR 2 FileOpen $1 "$1\autoexec.bat" a FileSeek $1 -1 END FileReadByte $1 $2 IntCmp $2 26 0 +2 +2 # DOS EOF FileSeek $1 -1 END # write over EOF FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" FileClose $1 SetRebootFlag true Goto AddToPath_done AddToPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" ReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" Goto DoTrim ReadAllKey: ReadRegStr $1 ${NT_all_env} "PATH" DoTrim: StrCmp $1 "" AddToPath_NTdoIt Push $1 Call Trim Pop $1 StrCpy $0 "$1;$0" AddToPath_NTdoIt: StrCmp $ADD_TO_PATH_ALL_USERS "1" WriteAllKey WriteRegExpandStr ${NT_current_env} "PATH" $0 Goto DoSend WriteAllKey: WriteRegExpandStr ${NT_all_env} "PATH" $0 DoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 AddToPath_done: Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd ; RemoveFromPath - Remove a given dir from the path ; Input: head of the stack Function un.RemoveFromPath Exch $0 Push $1 Push $2 Push $3 Push $4 Push $5 Push $6 IntFmt $6 "%c" 26 # DOS EOF Call un.IsNT Pop $1 StrCmp $1 1 unRemoveFromPath_NT ; Not on NT StrCpy $1 $WINDIR 2 FileOpen $1 "$1\autoexec.bat" r GetTempFileName $4 FileOpen $2 $4 w GetFullPathName /SHORT $0 $0 StrCpy $0 "SET PATH=%PATH%;$0" Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoop: FileRead $1 $3 StrCpy $5 $3 1 -1 # read last char StrCmp $5 $6 0 +2 # if DOS EOF StrCpy $3 $3 -1 # remove DOS EOF so we can compare StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine StrCmp $3 "" unRemoveFromPath_dosLoopEnd FileWrite $2 $3 Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoopRemoveLine: SetRebootFlag true Goto unRemoveFromPath_dosLoop unRemoveFromPath_dosLoopEnd: FileClose $2 FileClose $1 StrCpy $1 $WINDIR 2 Delete "$1\autoexec.bat" CopyFiles /SILENT $4 "$1\autoexec.bat" Delete $4 Goto unRemoveFromPath_done unRemoveFromPath_NT: StrCmp $ADD_TO_PATH_ALL_USERS "1" unReadAllKey ReadRegStr $1 ${NT_current_env} "PATH" Goto unDoTrim unReadAllKey: ReadRegStr $1 ${NT_all_env} "PATH" unDoTrim: StrCpy $5 $1 1 -1 # copy last char StrCmp $5 ";" +2 # if last char != ; StrCpy $1 "$1;" # append ; Push $1 Push "$0;" Call un.StrStr ; Find `$0;` in $1 Pop $2 ; pos of our dir StrCmp $2 "" unRemoveFromPath_done ; else, it is in path # $0 - path to add # $1 - path var StrLen $3 "$0;" StrLen $4 $2 StrCpy $5 $1 -$4 # $5 is now the part before the path to remove StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove StrCpy $3 $5$6 StrCpy $5 $3 1 -1 # copy last char StrCmp $5 ";" 0 +2 # if last char == ; StrCpy $3 $3 -1 # remove last char StrCmp $ADD_TO_PATH_ALL_USERS "1" unWriteAllKey WriteRegExpandStr ${NT_current_env} "PATH" $3 Goto unDoSend unWriteAllKey: WriteRegExpandStr ${NT_all_env} "PATH" $3 unDoSend: SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 unRemoveFromPath_done: Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Uninstall sutff ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ########################################### # Utility Functions # ########################################### ;==================================================== ; IsNT - Returns 1 if the current system is NT, 0 ; otherwise. ; Output: head of the stack ;==================================================== ; IsNT ; no input ; output, top of the stack = 1 if NT or 0 if not ; ; Usage: ; Call IsNT ; Pop $R0 ; ($R0 at this point is 1 or 0) !macro IsNT un Function ${un}IsNT Push $0 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $0 "" 0 IsNT_yes ; we are not NT. Pop $0 Push 0 Return IsNT_yes: ; NT!!! Pop $0 Push 1 FunctionEnd !macroend !insertmacro IsNT "" !insertmacro IsNT "un." ; StrStr ; input, top of stack = string to search for ; top of stack-1 = string to search in ; output, top of stack (replaces with the portion of the string remaining) ; modifies no other variables. ; ; Usage: ; Push "this is a long ass string" ; Push "ass" ; Call StrStr ; Pop $R0 ; ($R0 at this point is "ass string") !macro StrStr un Function ${un}StrStr Exch $R1 ; st=haystack,old$R1, $R1=needle Exch ; st=old$R1,haystack Exch $R2 ; st=old$R1,old$R2, $R2=haystack Push $R3 Push $R4 Push $R5 StrLen $R3 $R1 StrCpy $R4 0 ; $R1=needle ; $R2=haystack ; $R3=len(needle) ; $R4=cnt ; $R5=tmp loop: StrCpy $R5 $R2 $R3 $R4 StrCmp $R5 $R1 done StrCmp $R5 "" done IntOp $R4 $R4 + 1 Goto loop done: StrCpy $R1 $R2 "" $R4 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Exch $R1 FunctionEnd !macroend !insertmacro StrStr "" !insertmacro StrStr "un." Function Trim ; Added by Pelaca Exch $R1 Push $R2 Loop: StrCpy $R2 "$R1" 1 -1 StrCmp "$R2" " " RTrim StrCmp "$R2" "$\n" RTrim StrCmp "$R2" "$\r" RTrim StrCmp "$R2" ";" RTrim GoTo Done RTrim: StrCpy $R1 "$R1" -1 Goto Loop Done: Pop $R2 Exch $R1 FunctionEnd Function ConditionalAddToRegisty Pop $0 Pop $1 StrCmp "$0" "" ConditionalAddToRegisty_EmptyString WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" ConditionalAddToRegisty_EmptyString: FunctionEnd ;-------------------------------- !ifdef CPACK_USES_DOWNLOAD Function DownloadFile IfFileExists $INSTDIR\* +2 CreateDirectory $INSTDIR Pop $0 ; Skip if already downloaded IfFileExists $INSTDIR\$0 0 +2 Return StrCpy $1 "@CPACK_DOWNLOAD_SITE@" try_again: NSISdl::download "$1/$0" "$INSTDIR\$0" Pop $1 StrCmp $1 "success" success StrCmp $1 "Cancelled" cancel MessageBox MB_OK "Download failed: $1" cancel: Return success: FunctionEnd !endif ;-------------------------------- ; Installation types @CPACK_NSIS_INSTALLATION_TYPES@ ;-------------------------------- ; Component sections @CPACK_NSIS_COMPONENT_SECTIONS@ ;-------------------------------- ; Define some macro setting for the gui @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "@CPACK_RESOURCE_FILE_LICENSE@" Page custom InstallOptionsPage !insertmacro MUI_PAGE_DIRECTORY ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\NEWS.txt" @CPACK_NSIS_PAGE_COMPONENTS@ !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;first language is the default language !insertmacro MUI_LANGUAGE "Albanian" !insertmacro MUI_LANGUAGE "Arabic" !insertmacro MUI_LANGUAGE "Basque" !insertmacro MUI_LANGUAGE "Belarusian" !insertmacro MUI_LANGUAGE "Bosnian" !insertmacro MUI_LANGUAGE "Breton" !insertmacro MUI_LANGUAGE "Bulgarian" !insertmacro MUI_LANGUAGE "Croatian" !insertmacro MUI_LANGUAGE "Czech" !insertmacro MUI_LANGUAGE "Danish" !insertmacro MUI_LANGUAGE "Dutch" !insertmacro MUI_LANGUAGE "Estonian" !insertmacro MUI_LANGUAGE "Farsi" !insertmacro MUI_LANGUAGE "Finnish" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Greek" !insertmacro MUI_LANGUAGE "Hebrew" !insertmacro MUI_LANGUAGE "Hungarian" !insertmacro MUI_LANGUAGE "Icelandic" !insertmacro MUI_LANGUAGE "Indonesian" !insertmacro MUI_LANGUAGE "Irish" !insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "Japanese" !insertmacro MUI_LANGUAGE "Korean" !insertmacro MUI_LANGUAGE "Kurdish" !insertmacro MUI_LANGUAGE "Latvian" !insertmacro MUI_LANGUAGE "Lithuanian" !insertmacro MUI_LANGUAGE "Luxembourgish" !insertmacro MUI_LANGUAGE "Macedonian" !insertmacro MUI_LANGUAGE "Malay" !insertmacro MUI_LANGUAGE "Mongolian" !insertmacro MUI_LANGUAGE "Norwegian" !insertmacro MUI_LANGUAGE "Polish" !insertmacro MUI_LANGUAGE "Portuguese" !insertmacro MUI_LANGUAGE "PortugueseBR" !insertmacro MUI_LANGUAGE "Romanian" !insertmacro MUI_LANGUAGE "Russian" !insertmacro MUI_LANGUAGE "Serbian" !insertmacro MUI_LANGUAGE "SerbianLatin" !insertmacro MUI_LANGUAGE "SimpChinese" !insertmacro MUI_LANGUAGE "Slovak" !insertmacro MUI_LANGUAGE "Slovenian" !insertmacro MUI_LANGUAGE "Spanish" !insertmacro MUI_LANGUAGE "Swedish" !insertmacro MUI_LANGUAGE "Thai" !insertmacro MUI_LANGUAGE "TradChinese" !insertmacro MUI_LANGUAGE "Turkish" !insertmacro MUI_LANGUAGE "Ukrainian" !insertmacro MUI_LANGUAGE "Welsh" ;-------------------------------- ;Reserve Files ;These files should be inserted before other files in the data block ;Keep these lines before any File command ;Only for solid compression (by default, solid compression is enabled for BZIP2 and LZMA) ReserveFile "NSIS.InstallOptions.ini" !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;-------------------------------- ;Installer Sections Section "-Core installation" ;Use the entire tree produced by the INSTALL target. Keep the ;list of directories here in sync with the RMDir commands below. SetOutPath "$INSTDIR" @CPACK_NSIS_FULL_INSTALL@ ;Store installation folder WriteRegStr SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" Push "DisplayName" Push "@CPACK_NSIS_DISPLAY_NAME@" Call ConditionalAddToRegisty Push "DisplayVersion" Push "@CPACK_PACKAGE_VERSION@" Call ConditionalAddToRegisty Push "Publisher" Push "@CPACK_PACKAGE_VENDOR@" Call ConditionalAddToRegisty Push "UninstallString" Push "$INSTDIR\Uninstall.exe" Call ConditionalAddToRegisty Push "NoRepair" Push "1" Call ConditionalAddToRegisty !ifdef CPACK_NSIS_ADD_REMOVE ;Create add/remove functionality Push "ModifyPath" Push "$INSTDIR\AddRemove.exe" Call ConditionalAddToRegisty !else Push "NoModify" Push "1" Call ConditionalAddToRegisty !endif ; Optional registration Push "DisplayIcon" Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" Call ConditionalAddToRegisty Push "HelpLink" Push "@CPACK_NSIS_HELP_LINK@" Call ConditionalAddToRegisty Push "URLInfoAbout" Push "@CPACK_NSIS_URL_INFO_ABOUT@" Call ConditionalAddToRegisty Push "Contact" Push "@CPACK_NSIS_CONTACT@" Call ConditionalAddToRegisty !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application ;Create shortcuts CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" @CPACK_NSIS_CREATE_ICONS@ @CPACK_NSIS_CREATE_ICONS_EXTRA@ CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" ;Read a value from an InstallOptions INI file !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State" !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State" !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State" ; Write special uninstall registry entries Push "StartMenu" Push "$STARTMENU_FOLDER" Call ConditionalAddToRegisty Push "DoNotAddToPath" Push "$DO_NOT_ADD_TO_PATH" Call ConditionalAddToRegisty Push "AddToPathAllUsers" Push "$ADD_TO_PATH_ALL_USERS" Call ConditionalAddToRegisty Push "AddToPathCurrentUser" Push "$ADD_TO_PATH_CURRENT_USER" Call ConditionalAddToRegisty Push "InstallToDesktop" Push "$INSTALL_DESKTOP" Call ConditionalAddToRegisty !insertmacro MUI_STARTMENU_WRITE_END @CPACK_NSIS_EXTRA_INSTALL_COMMANDS@ SectionEnd Section "-Add to path" Push $INSTDIR\bin StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 doNotAddToPath StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0 Call AddToPath doNotAddToPath: SectionEnd ;-------------------------------- ; Create custom pages Function InstallOptionsPage !insertmacro MUI_HEADER_TEXT "Install Options" "Choose options for installing @CPACK_NSIS_PACKAGE_NAME@" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini" FunctionEnd ;-------------------------------- ; determine admin versus local install Function un.onInit ClearErrors UserInfo::GetName IfErrors noLM Pop $0 UserInfo::GetAccountType Pop $1 StrCmp $1 "Admin" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' Goto done StrCmp $1 "Power" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' Goto done noLM: ;Get installation folder from registry if available done: FunctionEnd ;--- Add/Remove callback functions: --- !macro SectionList MacroName ;This macro used to perform operation on multiple sections. ;List all of your components in following manner here. @CPACK_NSIS_COMPONENT_SECTION_LIST@ !macroend Section -FinishComponents ;Removes unselected components and writes component status to registry !insertmacro SectionList "FinishSection" !ifdef CPACK_NSIS_ADD_REMOVE ; Get the name of the installer executable System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1' StrCpy $R3 $R0 ; Strip off the last 13 characters, to see if we have AddRemove.exe StrLen $R1 $R0 IntOp $R1 $R0 - 13 StrCpy $R2 $R0 13 $R1 StrCmp $R2 "AddRemove.exe" addremove_installed ; We're not running AddRemove.exe, so install it CopyFiles $R3 $INSTDIR\AddRemove.exe addremove_installed: !endif SectionEnd ;--- End of Add/Remove callback functions --- ;-------------------------------- ; Component dependencies Function .onSelChange !insertmacro SectionList MaybeSelectionChanged FunctionEnd ;-------------------------------- ;Uninstaller Section Section "Uninstall" ReadRegStr $START_MENU SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "StartMenu" ;MessageBox MB_OK "Start menu is in: $START_MENU" ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "DoNotAddToPath" ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathAllUsers" ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "AddToPathCurrentUser" ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS" ReadRegStr $INSTALL_DESKTOP SHCTX \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "InstallToDesktop" ;MessageBox MB_OK "Install to desktop: $INSTALL_DESKTOP " @CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@ ;Remove files we installed. ;Keep the list of directories here in sync with the File commands above. @CPACK_NSIS_DELETE_FILES@ @CPACK_NSIS_DELETE_DIRECTORIES@ !ifdef CPACK_NSIS_ADD_REMOVE ;Remove the add/remove program Delete "$INSTDIR\AddRemove.exe" !endif ;Remove the uninstaller itself. Delete "$INSTDIR\Uninstall.exe" DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" ;Remove the installation directory if it is empty. RMDir "$INSTDIR" ; Remove the registry entries. DeleteRegKey SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" ; Removes all optional components !insertmacro SectionList "RemoveSection" !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS@ @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors startMenuDeleteLoopDone StrCmp "$MUI_TEMP" "$SMPROGRAMS" startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: ; If the user changed the shortcut, then untinstall may not work. This should ; try to fix it. StrCpy $MUI_TEMP "$START_MENU" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" secondStartMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors secondStartMenuDeleteLoopDone StrCmp "$MUI_TEMP" "$SMPROGRAMS" secondStartMenuDeleteLoopDone secondStartMenuDeleteLoop secondStartMenuDeleteLoopDone: DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" Push $INSTDIR\bin StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0 Call un.RemoveFromPath doNotRemoveFromPath: SectionEnd ;-------------------------------- ; determine admin versus local install ; Is install for "AllUsers" or "JustMe"? ; Default to "JustMe" - set to "AllUsers" if admin or on Win9x ; This function is used for the very first "custom page" of the installer. ; This custom page does not show up visibly, but it executes prior to the ; first visible page and sets up $INSTDIR properly... ; Choose different default installation folder based on SV_ALLUSERS... ; "Program Files" for AllUsers, "My Documents" for JustMe... Function .onInit ; Reads components status for registry !insertmacro SectionList "InitSection" ; check to see if /D has been used to change ; the install directory by comparing it to the ; install directory that is expected to be the ; default StrCpy $IS_DEFAULT_INSTALLDIR 0 StrCmp "$INSTDIR" "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 StrCpy $IS_DEFAULT_INSTALLDIR 1 StrCpy $SV_ALLUSERS "JustMe" ; if default install dir then change the default ; if it is installed for JustMe StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ClearErrors UserInfo::GetName IfErrors noLM Pop $0 UserInfo::GetAccountType Pop $1 StrCmp $1 "Admin" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Admin group' StrCpy $SV_ALLUSERS "AllUsers" Goto done StrCmp $1 "Power" 0 +3 SetShellVarContext all ;MessageBox MB_OK 'User "$0" is in the Power Users group' StrCpy $SV_ALLUSERS "AllUsers" Goto done noLM: StrCpy $SV_ALLUSERS "AllUsers" ;Get installation folder from registry if available done: StrCmp $SV_ALLUSERS "AllUsers" 0 +3 StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" noOptionsPage: FunctionEnd zeromq-4.2.5/builds/Makefile.in0000664000372000037200000003401713255253274017305 0ustar00travistravis00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Specify all build files that have to go into source packages. # msvc directory does its own stuff. VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = builds DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/platform.hpp CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ ASCIIDOC = @ASCIIDOC@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLANG_FORMAT = @CLANG_FORMAT@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@ LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@ LIBZMQ_VMCI_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ LIBZMQ_VMCI_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTVER = @LTVER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ VALGRIND_HAVE_TOOL_drd = @VALGRIND_HAVE_TOOL_drd@ VALGRIND_HAVE_TOOL_exp_sgcheck = @VALGRIND_HAVE_TOOL_exp_sgcheck@ VALGRIND_HAVE_TOOL_helgrind = @VALGRIND_HAVE_TOOL_helgrind@ VALGRIND_HAVE_TOOL_memcheck = @VALGRIND_HAVE_TOOL_memcheck@ VERSION = @VERSION@ WITH_CLANG_FORMAT = @WITH_CLANG_FORMAT@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gssapi_krb5_CFLAGS = @gssapi_krb5_CFLAGS@ gssapi_krb5_LIBS = @gssapi_krb5_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libzmq_have_asciidoc = @libzmq_have_asciidoc@ libzmq_have_xmlto = @libzmq_have_xmlto@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ norm_CFLAGS = @norm_CFLAGS@ norm_LIBS = @norm_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pgm_CFLAGS = @pgm_CFLAGS@ pgm_LIBS = @pgm_LIBS@ pkg_config_defines = @pkg_config_defines@ pkg_config_libs_private = @pkg_config_libs_private@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ cygwin/Makefile.cygwin \ zos/makelibzmq \ zos/cxxall \ zos/README.md \ zos/makeclean \ zos/platform.hpp \ zos/zc++ \ zos/test_fork.cpp \ zos/maketests \ zos/runtests \ cygwin/Makefile.cygwin \ mingw32/Makefile.mingw32 \ mingw32/platform.hpp \ cmake/Modules \ cmake/NSIS.template32.in \ cmake/NSIS.template64.in \ cmake/ZeroMQConfig.cmake.in \ cmake/platform.hpp.in \ valgrind/valgrind.supp \ valgrind/vg \ nuget/readme.nuget \ nuget/libzmq.autopkg \ android/android_build_helper.sh \ android/ci_build.sh \ android/build.sh all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign builds/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign builds/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: zeromq-4.2.5/builds/valgrind/0000775000372000037200000000000013255253402017032 5ustar00travistravis00000000000000zeromq-4.2.5/builds/valgrind/valgrind.supp0000664000372000037200000000041213255253220021544 0ustar00travistravis00000000000000{ Memcheck:Param socketcall.sendto(msg) fun:send ... } { Memcheck:Param socketcall.send(msg) fun:send ... } { Memcheck:Free fun:free ... fun:__libc_freeres ... } zeromq-4.2.5/builds/valgrind/vg0000775000372000037200000000011313255253220017365 0ustar00travistravis00000000000000valgrind --tool=memcheck --leak-check=full --suppressions=valgrind.supp $* zeromq-4.2.5/builds/android/0000775000372000037200000000000013255253402016644 5ustar00travistravis00000000000000zeromq-4.2.5/builds/android/build.sh0000775000372000037200000000410113255253220020274 0ustar00travistravis00000000000000#!/usr/bin/env bash # Use directory of current script as the build directory and working directory cd "$( dirname "${BASH_SOURCE[0]}" )" ANDROID_BUILD_DIR="$(pwd)" # Get access to android_build functions and variables source ${ANDROID_BUILD_DIR}/android_build_helper.sh # Choose a C++ standard library implementation from the ndk ANDROID_BUILD_CXXSTL="gnustl_shared_49" # Set up android build environment and set ANDROID_BUILD_OPTS array android_build_env android_build_opts # Use a temporary build directory cache="/tmp/android_build/${TOOLCHAIN_NAME}" rm -rf "${cache}" mkdir -p "${cache}" # Check for environment variable to clear the prefix and do a clean build if [[ $ANDROID_BUILD_CLEAN ]]; then echo "Doing a clean build (removing previous build and depedencies)..." rm -rf "${ANDROID_BUILD_PREFIX}"/* fi if [ -z $CURVE ]; then CURVE="--disable-curve" VERIFY="libzmq.so" elif [ $CURVE == "libsodium" ]; then CURVE="--with-libsodium=yes" VERIFY="libzmq.so libsodium.so" ## # Build libsodium from latest master branch (android_build_verify_so "libsodium.so" &> /dev/null) || { rm -rf "${cache}/libsodium" (cd "${cache}" && git clone -b stable --depth 1 git://github.com/jedisct1/libsodium.git) || exit 1 (cd "${cache}/libsodium" && ./autogen.sh \ && ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" --disable-soname-versions \ && make -j 4 \ && make install) || exit 1 } elif [ $CURVE == "tweetnacl" ]; then # Default CURVE="" VERIFY="libzmq.so" fi ## # Build libzmq from local source LIBTOOL_EXTRA_LDFLAGS='-avoid-version' (android_build_verify_so ${VERIFY} &> /dev/null) || { rm -rf "${cache}/libzmq" (cp -r ../.. "${cache}/libzmq" && cd "${cache}/libzmq" && make clean) (cd "${cache}/libzmq" && ./autogen.sh \ && ./configure --quiet "${ANDROID_BUILD_OPTS[@]}" ${CURVE} --without-docs \ && make -j 4 \ && make install) || exit 1 } ## # Verify shared libraries in prefix android_build_verify_so ${VERIFY} echo "libzmq android build succeeded" zeromq-4.2.5/builds/android/ci_build.sh0000775000372000037200000000137213255253220020756 0ustar00travistravis00000000000000#!/usr/bin/env bash NDK_VER=android-ndk-r11c NDK_ABI_VER=4.9 if [ $TRAVIS_OS_NAME == "linux" ] then NDK_PLATFORM=linux-x86_64 elif [ $TRAVIS_OS_NAME == "osx" ] then NDK_PLATFORM=darwin-x86_64 else echo "Unsupported platform $TRAVIS_OS_NAME" exit 1 fi export FILENAME=$NDK_VER-$NDK_PLATFORM.zip (cd '/tmp' \ && wget http://dl.google.com/android/repository/$FILENAME \ && unzip $FILENAME &> /dev/null ) || exit 1 unset FILENAME export ANDROID_NDK_ROOT="/tmp/$NDK_VER" export TOOLCHAIN_PATH="$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-$NDK_ABI_VER/prebuilt/$NDK_PLATFORM/bin" export TOOLCHAIN_NAME="arm-linux-androideabi-$NDK_ABI_VER" export TOOLCHAIN_HOST="arm-linux-androideabi" export TOOLCHAIN_ARCH="arm" source ./build.sh zeromq-4.2.5/builds/android/android_build_helper.sh0000664000372000037200000003012113255253220023331 0ustar00travistravis00000000000000#!/usr/bin/env bash # # Copyright (c) 2014, Joe Eli McIlvain # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. # ### # # https://github.com/jemc/android_build_helper # android_build_helper.sh # # The following is a helper script for setting up android builds for # "native" libraries maintained with an autotools build system. # It merely helps to create the proper cross-compile environment. # It makes no attempt to wrap the library or make it accessible to Java code; # the intention is to make the bare library available to other "native" code. # # To get the latest version of this script, please download from: # https://github.com/jemc/android_build_helper # # You are free to modify this script, but if you add improvements, # please consider submitting a pull request to the aforementioned upstream # repository for the benefit of other users. # # Get directory of current script (if not already set) # This directory is also the basis for the build directories the get created. if [ -z "$ANDROID_BUILD_DIR" ]; then ANDROID_BUILD_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" fi # Set up a variable to hold the global failure reasons, separated by newlines # (Empty string indicates no failure) ANDROID_BUILD_FAIL=() function android_build_check_fail { if [ ! ${#ANDROID_BUILD_FAIL[@]} -eq 0 ]; then echo "Android build failed for the following reasons:" for reason in "${ANDROID_BUILD_FAIL[@]}"; do local formatted_reason=" ${reason}" echo "${formatted_reason}" done exit 1 fi } function android_build_env { ## # Check that necessary environment variables are set if [ -z "$ANDROID_NDK_ROOT" ]; then ANDROID_BUILD_FAIL+=("Please set the ANDROID_NDK_ROOT environment variable") ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c\")") fi if [ -z "$TOOLCHAIN_PATH" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_PATH environment variable") ANDROID_BUILD_FAIL+=(" (eg. \"/home/user/android/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin\")") fi if [ -z "$TOOLCHAIN_NAME" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_NAME environment variable") ANDROID_BUILD_FAIL+=(" (eg. \"arm-linux-androideabi-4.9\")") fi if [ -z "$TOOLCHAIN_HOST" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_HOST environment variable") ANDROID_BUILD_FAIL+=(" (eg. \"arm-linux-androideabi\")") fi if [ -z "$TOOLCHAIN_ARCH" ]; then ANDROID_BUILD_FAIL+=("Please set the TOOLCHAIN_ARCH environment variable") ANDROID_BUILD_FAIL+=(" (eg. \"arm\")") fi android_build_check_fail ## # Check that directories given by environment variables exist if [ ! -d "$ANDROID_NDK_ROOT" ]; then ANDROID_BUILD_FAIL+=("The ANDROID_NDK_ROOT directory does not exist") ANDROID_BUILD_FAIL+=(" ${ANDROID_NDK_ROOT}") fi if [ ! -d "$TOOLCHAIN_PATH" ]; then ANDROID_BUILD_FAIL+=("The TOOLCHAIN_PATH directory does not exist") ANDROID_BUILD_FAIL+=(" ${TOOLCHAIN_PATH}") fi ## # Set up some local variables and check them ANDROID_BUILD_SYSROOT="${ANDROID_NDK_ROOT}/platforms/android-9/arch-${TOOLCHAIN_ARCH}" if [ ! -d "$ANDROID_BUILD_SYSROOT" ]; then ANDROID_BUILD_FAIL+=("The ANDROID_BUILD_SYSROOT directory does not exist") ANDROID_BUILD_FAIL+=(" ${ANDROID_BUILD_SYSROOT}") fi ANDROID_BUILD_PREFIX="${ANDROID_BUILD_DIR}/prefix/${TOOLCHAIN_NAME}" mkdir -p "$ANDROID_BUILD_PREFIX" || { ANDROID_BUILD_FAIL+=("Failed to make ANDROID_BUILD_PREFIX directory") ANDROID_BUILD_FAIL+=(" ${ANDROID_BUILD_PREFIX}") } android_build_check_fail } function _android_build_opts_process_binaries { local CPP="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-cpp" local CC="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-gcc" local CXX="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-g++" local LD="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ld" local AS="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-as" local AR="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ar" local RANLIB="${TOOLCHAIN_PATH}/${TOOLCHAIN_HOST}-ranlib" if [ ! -x "${CPP}" ]; then ANDROID_BUILD_FAIL+=("The CPP binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${CPP}") fi if [ ! -x "${CC}" ]; then ANDROID_BUILD_FAIL+=("The CC binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${CC}") fi if [ ! -x "${CXX}" ]; then ANDROID_BUILD_FAIL+=("The CXX binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${CXX}") fi if [ ! -x "${LD}" ]; then ANDROID_BUILD_FAIL+=("The LD binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${LD}") fi if [ ! -x "${AS}" ]; then ANDROID_BUILD_FAIL+=("The AS binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${AS}") fi if [ ! -x "${AR}" ]; then ANDROID_BUILD_FAIL+=("The AR binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${AR}") fi if [ ! -x "${RANLIB}" ]; then ANDROID_BUILD_FAIL+=("The RANLIB binary does not exist or is not executable") ANDROID_BUILD_FAIL+=(" ${RANLIB}") fi ANDROID_BUILD_OPTS+=("CPP=${CPP}") ANDROID_BUILD_OPTS+=("CC=${CC}") ANDROID_BUILD_OPTS+=("CXX=${CXX}") ANDROID_BUILD_OPTS+=("LD=${LD}") ANDROID_BUILD_OPTS+=("AS=${AS}") ANDROID_BUILD_OPTS+=("AR=${AR}") ANDROID_BUILD_OPTS+=("RANLIB=${RANLIB}") android_build_check_fail } function _android_build_opts_process_cxx_stl { case "${ANDROID_BUILD_CXXSTL}" in stlport_static) LIBS+=" -lstlport_static" CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/stlport" case "${TOOLCHAIN_ARCH}" in arm) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi" ;; x86) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/x86" ;; mips) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/mips" ;; *) ANDROID_BUILD_FAIL+=("Unknown combination for ANDROID_BUILD_CXXSTL and TOOLCHAIN_ARCH") ANDROID_BUILD_FAIL+=(" ${ANDROID_BUILD_CXXSTL}") ANDROID_BUILD_FAIL+=(" ${TOOLCHAIN_ARCH}") ;; esac ;; gnustl_shared_49) LIBS+=" -lgnustl_shared" CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/include" case "${TOOLCHAIN_ARCH}" in arm) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi" CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include" ;; x86) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86" CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include" ;; mips) LDFLAGS+=" -L${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips" CPPFLAGS+=" -I${ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/4.9/libs/mips/include" ;; *) ANDROID_BUILD_FAIL+=("Unknown combination for ANDROID_BUILD_CXXSTL and TOOLCHAIN_ARCH") ANDROID_BUILD_FAIL+=(" ${ANDROID_BUILD_CXXSTL}") ANDROID_BUILD_FAIL+=(" ${TOOLCHAIN_ARCH}") ;; esac ;; '');; *) ANDROID_BUILD_FAIL+=("Unknown value for ANDROID_BUILD_CXXSTL") ANDROID_BUILD_FAIL+=(" ${ANDROID_BUILD_CXXSTL}") ;; esac } # Set the ANDROID_BUILD_OPTS variable to a bash array of configure options function android_build_opts { ANDROID_BUILD_OPTS=() local CFLAGS="--sysroot=${ANDROID_BUILD_SYSROOT} -I${ANDROID_BUILD_PREFIX}/include" local CPPFLAGS="--sysroot=${ANDROID_BUILD_SYSROOT} -I${ANDROID_BUILD_PREFIX}/include" local CXXFLAGS="--sysroot=${ANDROID_BUILD_SYSROOT} -I${ANDROID_BUILD_PREFIX}/include" local LDFLAGS="-L${ANDROID_BUILD_PREFIX}/lib" local LIBS="-lc -lgcc -ldl" _android_build_opts_process_binaries _android_build_opts_process_cxx_stl ANDROID_BUILD_OPTS+=("CFLAGS=${CFLAGS} ${ANDROID_BUILD_EXTRA_CFLAGS}") ANDROID_BUILD_OPTS+=("CPPFLAGS=${CPPFLAGS} ${ANDROID_BUILD_EXTRA_CPPFLAGS}") ANDROID_BUILD_OPTS+=("CXXFLAGS=${CXXFLAGS} ${ANDROID_BUILD_EXTRA_CXXFLAGS}") ANDROID_BUILD_OPTS+=("LDFLAGS=${LDFLAGS} ${ANDROID_BUILD_EXTRA_LDFLAGS}") ANDROID_BUILD_OPTS+=("LIBS=${LIBS} ${ANDROID_BUILD_EXTRA_LIBS}") ANDROID_BUILD_OPTS+=("PKG_CONFIG_PATH=${ANDROID_BUILD_PREFIX}/lib/pkgconfig") ANDROID_BUILD_OPTS+=("--host=${TOOLCHAIN_HOST}") ANDROID_BUILD_OPTS+=("--prefix=${ANDROID_BUILD_PREFIX}") android_build_check_fail } # Parse readelf output to verify the correct linking of libraries. # The first argument should be the soname of the newly built library. # The rest of the arguments should be the sonames of dependencies. # All sonames should be unversioned for android (no trailing numbers). function android_build_verify_so { local soname="$1" shift # Get rid of first argument - the rest represent dependencies local sofile="${ANDROID_BUILD_PREFIX}/lib/${soname}" if [ ! -f "${sofile}" ]; then ANDROID_BUILD_FAIL+=("Found no library named ${soname}") ANDROID_BUILD_FAIL+=(" ${sofile}") fi android_build_check_fail if command -v readelf >/dev/null 2>&1 ; then local readelf_bin="readelf" elif command -v greadelf >/dev/null 2>&1 ; then local readelf_bin="greadelf" else ANDROID_BUILD_FAIL+=("Could not find [g]readelf") fi android_build_check_fail local elfoutput=$($readelf_bin -d ${sofile}) local soname_regexp='soname: \[([[:alnum:]\.]+)\]' if [[ $elfoutput =~ $soname_regexp ]]; then local parsed_soname="${BASH_REMATCH[1]}" if [ "${parsed_soname}" != "${soname}" ]; then ANDROID_BUILD_FAIL+=("Actual soname of library ${soname} is incorrect (or versioned):") ANDROID_BUILD_FAIL+=(" ${parsed_soname}") fi else ANDROID_BUILD_FAIL+=("Failed to meaningfully parse readelf output for library ${soname}:") ANDROID_BUILD_FAIL+=(" ${elfoutput}") fi for dep_soname do if [[ $elfoutput != *"library: [${dep_soname}]"* ]]; then ANDROID_BUILD_FAIL+=("Library ${soname} was expected to be linked to library with soname:") ANDROID_BUILD_FAIL+=(" ${dep_soname}") fi done android_build_check_fail } zeromq-4.2.5/builds/README0000664000372000037200000000026413255253220016104 0ustar00travistravis00000000000000This directory holds build tools, i.e. tools we use to build the current code tree. Packaging tools (which take released tarballs or github code repos) should go into /packaging. zeromq-4.2.5/builds/cygwin/0000775000372000037200000000000013255253402016524 5ustar00travistravis00000000000000zeromq-4.2.5/builds/cygwin/Makefile.cygwin0000775000372000037200000000256313255253220021472 0ustar00travistravis00000000000000CC=gcc CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=16384 -DZMQ_USE_SELECT -I. LIBS=-lws2_32 OBJS = ctx.o reaper.o dist.o err.o \ clock.o metadata.o random.o \ object.o own.o \ io_object.o io_thread.o \ lb.o fq.o \ address.o tcp_address.o ipc_address.o \ ipc_connecter.o ipc_listener.o \ tcp_connecter.o tcp_listener.o \ mailbox.o msg.o mtrie.o \ pipe.o precompiled.o proxy.o \ signaler.o stream_engine.o \ thread.o trie.o \ ip.o tcp.o \ pgm_socket.o pgm_receiver.o pgm_sender.o \ raw_decoder.o raw_encoder.o \ v1_decoder.o v1_encoder.o v2_decoder.o v2_encoder.o \ udp_address.o upd_engine.o radio.o dish.o \ socket_base.o session_base.o options.o \ req.o rep.o push.o pull.o pub.o sub.o pair.o \ dealer.o router.o xpub.o xsub.o stream.o \ poller_base.o select.o poll.o epoll.o kqueue.o devpoll.o \ curve_client.o curve_server.o \ mechanism.o null_mechanism.o plain_client.o plain_server.o \ zmq.o zmq_utils.o %.o: ../../src/%.cpp $(CC) -c -o $@ $< $(CFLAGS) %.o: ../../perf/%.cpp $(CC) -c -o $@ $< $(CFLAGS) all: libzmq.dll perf: inproc_lat.exe inproc_thr.exe local_lat.exe local_thr.exe remote_lat.exe remote_thr.exe libzmq.dll: $(OBJS) g++ -shared -o $@ $^ -Wl,--out-implib,-Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive $@.a -Wl,--no-whole-archive $(LIBS) %.exe: %.o libzmq.dll g++ -o $@ $^ clean: del *.o *.a *.dll *.exe zeromq-4.2.5/builds/zos/0000775000372000037200000000000013255253402016037 5ustar00travistravis00000000000000zeromq-4.2.5/builds/zos/README.md0000664000372000037200000004216313255253220017322 0ustar00travistravis00000000000000# ZeroMQ on z/OS UNIX System Services ZeroMQ has been successfully built on z/OS, using [z/OS UNIX System Services](http://www-03.ibm.com/systems/z/os/zos/features/unix/), a certified UNIX environment for the [IBM z-series](http://www-03.ibm.com/systems/z/). The build is possible with the shell scripts in this directory, as described below. Tested build combinations: * ZeroMQ 4.0.4, using IBM XL C/C++ compiler, as XPLINK in ILP32 mode * ZeroMQ 4.0.4, using IBM XL C/C++ compiler, as XPLINK in LP64 mode * ZeroMQ 4.1-git, using IBM XL C/C++ compiler, as XPLINK in ILP32 mode Other combinations are likely to work, possibly with minor changes, but have not been tested. Both static library and DLL modes have been tested. There are some minor limitations (detailed below), but all core functionality tests run successfully. ## Quickstart: building ZeroMQ on z/OS UNIX System Services Assuming [z/OS UNIX System Services](http://www-03.ibm.com/systems/z/os/zos/features/unix/) is installed, and the [z/OS XL C/C++ compiler suite](http://www-03.ibm.com/software/products/en/czos) is installed, ZeroMQ can be built as follows: * Download and extract ZeroMQ tar file * Ensure contents of this directory are present at `builds/zos` within that extracted diretory (eg, `zeromq-VERSION/builds/zos/`; copy these files in, if not already present, and make sure the shell scripts are executable) * (Optional) set ZCXXFLAGS for additional compile flags (see below) * Build `libzmq.a` static library and `libzmq.so` dynamic library, with: cd zeromq-VERSION builds/zos/makelibzmq or to skip the `libzmq.so` dynamic library (only building `libzmq.a`): cd zeromq-VERSION BUILD_DLL=false export BUILD_DLL builds/zos/makelibzmq * (Optional, but recommended) build and run the core tests with: cd zeromq-VERSION builds/zos/maketests builds/zos/runtests * To remove built files, to start again (eg, rebuild with different compile/link flags): cd zeromq-VERSION builds/zos/makeclean There are details on specifying alternative compilation flags below. ## Quickstart: using ZeroMQ on z/OS UNIX System Services ### Static linking Install `include/*.h` somewhere on your compiler include path. Install `src/libzmq.a` somewhere on your library search path. Compile and link application with: c++ -Wc,xplink -Wl,xplink ... -+ -o myprog myprog.cpp -lzmq Run with: ./myprog ### Dynamic linking Install `include/*.h` somewhere on your compiler include path. Install `src/libzmq.so` somewhere on your LIBPATH. Install `src/libzmq.x` somewhere you can reference for import linking. Compile and link application: c++ -Wc,xplink -Wc,dll ... -+ -c -o myprog.o myprog.cpp c++ -Wl,xplink -o myprog myprog.o /PATH/TO/libzmq.x Run with: LIBPATH=/DIR/OF/LIBZMQ.SO:/lib:/usr/lib:... # if not in default path export LIBPATH ./myprog ## ZeroMQ on z/OS UNIX System Services: Application considerations z/0S UNIX System Services does not provide a way to block the [`SIGPIPE` signal being generated when a thread writes to a closed socket](http://pic.dhe.ibm.com/infocenter/zvm/v6r2/index.jsp?topic=%2Fcom.ibm.zos.r12.cbcpx01%2Fcbcpg1b0287.htm) (compare with other platforms that support the `SO_NOSIGPIPE` socket option, and/or the `MSG_NOSIGNAL` flag on `send()`; z/OS UNIX System Services supports neither). As a result, applications using ZeroMQ on z/OS UNIX System Services have to expect to encounter `SIGPIPE` at various times during the use of the library, if sockets are unexpectedly disconnected. Normally `SIGPIPE` will terminate the application. A simple solution, if `SIGPIPE` is not required for normal operation of the application (eg, it is not part of a unix pipeline, the traditional use of `SIGPIPE`), is to set `SIGPIPE` to be ignored with code like: #include ... signal(SIGPIPE, SIG_IGN); near the start of the application (eg, before initialising the ZeroMQ library). If `SIGPIPE` is required for normal operation it is recommended that the application install a signal handler that flags the signal was received, and allows the application main loop to determine if it was received for one of its own file descriptors -- and ignores it if it none of the applications own file descriptors seems to have changed. Linking to the `libzmq.a` static library will pull in substantially all of the library code, which will add about 4MB to the application size (per executable statically linked with ZeroMQ). If this is a significant consideration, use of the DLL version is recommended. See also ZeroMQ test status on z/OS UNIX System Services below for other caveats. ## Setting other compilation flags ### Optimisation To build with optimisation: * set `ZCXXFLAGS` to "`-O2`" before starting build process above ### Full debugging symbols To build with debugging symbols: * set `ZCXXFLAGS` to "`-g`" before starting build process above ### 64-bit mode (LP64/amode=64) To build in 64-bit mode: The default build is [ILP32](http://publib.boulder.ibm.com/infocenter/zvm/v6r1/index.jsp?topic=/com.ibm.zos.r9.cbcux01/lp64cop.htm), the default for the IBM XL C/C++ compiler. To build in LP64 mode (64-bit): * set `ZCXXFLAGS` to "`-Wc,lp64 -Wl,lp64`" before starting build (64-bit mode can be combined with optimisation or debug symbols.) ### Combining compilation flags Other build flags can be used in `ZXCCFLAGS` if desired. Beware that they are passed through (Bourne) shell expansion, and passed to both the compile and link stages; some experimentation of argument quoting may be required (and arguments requiring parenthesis are particularly complicated). ## ZeroMQ test status on z/OS UNIX System Services As of 2014-07-22, 41 of the 43 tests in the core ZeroMQ test suite pass. There are two tests that are expected to fail: 0. `test_abstract_ipc`: tests Linux-specific IPC functions, and is expected to fail on non-Linux platforms. 0. `test_fork`: tests ability to use ZeroMQ both before *and* after fork (and before exec()); this relies on the ability to use pthreads both before *and* after fork. On z/OS (and some other UNIX compliant platforms) functions like `pthreads_create` (used by ZeroMQ) cannot be used after fork and before exec; on z/OS the call after fork fails with `ELEMULTITHREADFORK` (errno=257) if ZeroMQ was also used before fork. (On z/OS it appears possible to use z/OS *after* fork, *providing* it has not been used before fork -- the problem is the two separate initialisations of the threading library, before and after fork, attempting to mix together.) In practice this is unlikely to affect many real-world programs -- most programs use threads or fork without exec, but not both. 0. `test_diffserv`: tests ability to set IP_TOS ([IP Type of Service](http://en.wikipedia.org/wiki/Type_of_service), or [DiffServ](http://en.wikipedia.org/wiki/Differentiated_Services_Code_Point)) values on sockets. While z/OS UNIX System Services has the preprocessor defines required, it appears not to support the required functionality (call fails with "EDC8109I Protocol not available.") These three "expected to fail" tests are listed as XFAIL_TESTS, and `runtests` will still consider the test run successful when they fail as expected. (`builds/zos/runtests` will automatically skip these "expected to fail" tests if running "all" tests.) In addition `test_security_curve` does not do any meaningful testing, as a result of the CURVE support not being compiled in; it requires [`libsodium`](http://doc.libsodium.org/), which has not been ported to z/OS UNIX System Services yet. Multicast (via `libpgm`) is also not ported or compiled in. [TIPC](http://hintjens.com/blog:70), a cluster IPC protocol, is only supported on Linux, so it is not compiled into the z/OS UNIX System Services port -- and the tests are automatically skipped if running "all" tests. (However they are not listed in XFAIL_TESTS because without the TIPC support there is no point in even running them, and it would be non-trivial to track them by hand.) ## ZeroMQ on z/OS UNIX System Services: Library portability notes ### *.cpp The source code in ZeroMQ is a combination of a C++ core library (in `*.cpp` and `*.hpp` files), and a C wrapper (also in `*.cpp` files). It is all compiled with the C++ compiler. The IBM XL C/C++ complier (at least the version used for initial porting) insists that C++ source be in `*.C` files (note capital C). To work around this issue the compile flag `-+` is used (specified in the `zc++` compiler wrapper), which tells the compiler the file should be considered C++ despite the file extension. ### XPLINK The library (and tests) are built in [XPLINK](http://www.redbooks.ibm.com/abstracts/sg245991.html) mode with the flags `-Wc,xplink -Wl,xplink` (specified in the `zc++` compiler wrapper). This is [recommended by IBM for C++ code](http://publib.boulder.ibm.com/infocenter/zvm/v5r4/index.jsp?topic=/com.ibm.zos.r9.ceea200/xplrunt.htm) due to the small functions. (Amongst other things, using XPLINK enables function calls with some arguments passed in registers.) ### long long ZeroMQ makes use of `uint64_t` (which is `unsigned long long` in ILP32 mode). To enable this the compile flag `-Wc,lang(longlong)` is passed to enable `long long`. This is passed from the `zc++` compiler wrapper in order to be able to specifically quote the argument to protect the parentheses from shell expansion. ### BSD-style sockets, with IPv6 support ZeroMQ uses BSD-style socket handling, with extensions to support IPv6. BSD-style sockets were merged into SysV-derived UNIX at least a decade ago, and are required as part of the X/Open Portability Guide at least as of XPG 4.2. To access this functionality two feature macros are defined: _XOPEN_SOURCE_EXTENDED=1 _OPEN_SYS_SOCK_IPV6 The first enables the XPG 4.2 features (including functionality like `getsockname()`), and the latter exposes IPv6 specific functionality like `sa_family_t`. These flags are defined in the `cxxall` script. (The traditional BSD-sockets API, exposed with `_OE_SOCKETS` cannot be used because it does not support functions like `getsockname()`, nor does it support IPv6 -- and the API definitions prevent compiling in LP64 mode due to assumptions about long being 32 bits. Using `_XOPEN_SOURCE_EXTENDED=1` avoids all these problems.) ### pthreads ZeroMQ uses the pthreads library to create additional threads to handle background communication without blocking the main application. This functionaity is enabled on z/OS UNIX System Services by defining: _OPEN_THREADS=3 which is done in the `cxxall` script. (The "3" value exposes later pthreads functionality like `pthread_atfork`, although ZeroMQ does not currently use all these features.) If compiling on a *recent* version of z/OS UNIX System Services it may be worth compiling with: _UNIX03_THREADS=1 which enables a later version of the threading support, potentially including `pthread_getschedparam` and pthread_setschedparam`; at present in the z/OS UNIX System Services port these functions are hidden and never called. (See [IBM z/OS pthread.h documentation](http://pic.dhe.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.bpxbd00/pthrdh.htm) for details on the differences.) ## `platform.hpp` on z/OS UNIX System Services The build (described above) on z/OS UNIX System Services uses a static pre-built `platform.hpp` file. (By default `src/platform.hpp` is dynamically generated as a result of running the `./configure` script.) The master version of this is in `builds/zos/platform.hpp`. Beware that this file contains the version number for libzmq (usually included during the configure phase). If taking the `platform.hpp` from an older version to use on a newer libzmq be sure to update the version information near the top of the file. The pre-built file is used because z/OS does not have the GNU auto tools (`automake`, `autoconf`, `libtool`, etc) installed, and particularly the libtool replacement does not work properly with the IBM XL C/C++ compiler. The `./configure` script (only supplied in the tarballs); built with `automake` and `autoconf` on another platform), with one small edit, was used to generate the z/OS `platform.hpp` and then two small changes (described below) were made by hand to the generated `platform.hpp`. To be able to run the ./configure script to completion (in tcsh syntax): * Edit `./configure` and add: openedition) ;; immediately before the line: as_fn_error $? "unsupported system: ${host_os}." "$LINENO" 5 (somewhere around 17637). This avoids the configure script giving up early because `openedition` is not recognised. * set `CXX` to point that the full path to the `builds/zos/zc++` wrapper, eg setenv CXX "/u/0mq/zeromq-4.0.4/builds/zos/zc++" * set `CPPFLAGS` to for the feature macros required, eg: setenv CPPFLAGS "-D_XOPEN_SOURCE_EXTENDED=1 -D_OPEN_THREADS=3 -D_OPEN_SYS_SOCK_IPV6 -DZMQ_HAVE_ZOS" * set `CXXFLAGS` to enable XPLINK: setenv CXXFLAGS "-Wc,xplink -Wl,xplink -+" * run configure script with `--disable-eventfd` (`sys/eventfd.h` does not exist, but the test for its existance has a false positive on z/OS UNIX System Services, apparently due to the way the `c++` compiler wrapper passes errors back from the IBM XL C/C++ compiler), and with `--with-poller=poll` because `poll` is the most advanced of the file descriptor status tests available on z/OS. That is: ./configure --disable-eventfd --with-poller=poll All going well several Makefiles, and `src/platform.hpp` should be produced. Two additional changes are required to `src/platform.hpp` which can be appended to the end: /* ---- Special case for z/OS Unix Services: openedition ---- */ #include #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif (many includes require pthreads-related methods or data structures to be defined, but not all of them include `pthread.h`, and the value `NI_MAXHOST` is not defined on z/OS UNIX System Services -- the 1025 value is the conventional value on other platforms). Having done this the Makefiles can be used to compile individual files if desired, eg: cd src make zmq.o but note: * IBM Make will warn of duplicate prerequisites on *every* run of `make`, and both the generated `src/Makefile` and `tests/Makefile` have several duplicates. (For `src/Makefile` edit `libzmq_la_SOURCES` to remove the duplicates.) * IBM Make does not understand the `@` prefix (eg, `@echo`) as a way to avoid echoing the command, resulting in an error and the command being echoed anyway. * Many of the make targets result in GNU auto tools (`aclocal`, etc) being invoked, which are likely to fail, and most of the library-related targets will invoke `libtool` which will cause compile failures (due to differences in expected arguments). However running `./configure` to regenerate `src/platform.hpp` may be useful for later versions of ZeroMQ which add more feature tests. ## Transferring from GitHub to z/OS UNIX System Services The process of transferring files from GitHub to z/OS UNIX System Services is somewhat convoluted because: * There is not a port of git for z/OS UNIX System Services; and * z/OS uses the EBCDIC (IBM-1047) character set rather than the ASCII/ISO-8859-1 character set used by the ZeroMQ source code on GitHub A workable transfer process is: * On an ASCII/ISO-8859-1/UTF-8 system with `git` (eg, a Linux system): git clone https://github.com/zeromq/libzmq.git git archive --prefix=libzmq-git/ -o /var/tmp/libzmq-git.tar master * On a ASCII/ISO-8859-1/UTF-8 system with `tar`, and `pax`, and optionally the GNU auto tools (eg, the same Linux system): mkdir /var/tmp/zos cd /var/tmp/zos tar -xpf /var/tmp/libzmq-git.tar cd libzmq-git ./autogen.sh # Optional: to be able to run ./configure cd .. pax -wf /var/tmp/libzmq-git.pax libzmq-git compress libzmq-git.pax # If available, reduce transfer size * Transfer the resulting file (`libzmq-git.pax` or `libzmq-git.pax.Z`) to the z/OS UNIX System Services system. If using FTP be sure to transfer the file in `bin` (binary/Image) mode to avoid corruption. * On the z/OS UNIX System Services system, unpack the `pax` file and convert all the files to EBCDIC with: pax -o from=iso8859-1 -pp -rvf libzmq-git-2014-07-23.pax or if the file was compressed: pax -o from=iso8859-1 -pp -rvzf libzmq-git-2014-07-23.pax.Z The result should be a `libzmq-git` directory with the source in EBCDIC format, on the z/OS UNIX System Services system ready to start building. See also the [`pax` man page](http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa500%2Fr4paxsh.htm), some [`pax` conversion examples](http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.bpxa400%2Fbpxza4c0291.htm), and [IBM's advice on ASCII to EBCDIC conversion options](http://www-03.ibm.com/systems/z/os/zos/features/unix/bpxa1p03.html) zeromq-4.2.5/builds/zos/platform.hpp0000664000372000037200000001771013255253220020400 0ustar00travistravis00000000000000/* 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 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. */ /* #undef HAVE_CLOCK_GETTIME */ /* 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. */ #define HAVE_IFADDRS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `gssapi_krb5' library (-lgssapi_krb5). */ /* #undef HAVE_LIBGSSAPI_KRB5 */ /* Define to 1 if you have the `iphlpapi' library (-liphlpapi). */ /* #undef HAVE_LIBIPHLPAPI */ /* Define to 1 if you have the `nsl' library (-lnsl). */ /* #undef HAVE_LIBNSL */ /* Define to 1 if you have the `pthread' library (-lpthread). */ /* #undef HAVE_LIBPTHREAD */ /* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */ /* #undef HAVE_LIBRPCRT4 */ /* Define to 1 if you have the `rt' library (-lrt). */ /* #undef HAVE_LIBRT */ /* Define to 1 if you have the `socket' library (-lsocket). */ /* #undef HAVE_LIBSOCKET */ /* Define to 1 if you have the `sodium' library (-lsodium). */ /* #undef HAVE_LIBSODIUM */ /* Define to 1 if you have the `ws2_32' library (-lws2_32). */ /* #undef HAVE_LIBWS2_32 */ /* Define to 1 if you have the 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 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 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 /* 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 in which 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.1.0" /* 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.1.0" /* 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.1.0" /* Enable militant API assertions */ /* #undef ZMQ_ACT_MILITANT */ /* Force to use mutexes */ /* #undef ZMQ_FORCE_MUTEXES */ /* Have AIX OS */ /* #undef ZMQ_HAVE_AIX */ /* Have Android OS */ /* #undef ZMQ_HAVE_ANDROID */ /* Have Cygwin */ /* #undef ZMQ_HAVE_CYGWIN */ /* Have eventfd extension. */ /* #undef ZMQ_HAVE_EVENTFD */ /* Have FreeBSD OS */ /* #undef ZMQ_HAVE_FREEBSD */ /* Have HPUX OS */ /* #undef ZMQ_HAVE_HPUX */ /* Have ifaddrs.h header. */ #define ZMQ_HAVE_IFADDRS 1 /* Have Linux OS */ /* #undef ZMQ_HAVE_LINUX */ /* Have LOCAL_PEERCRED socket option */ /* #undef ZMQ_HAVE_LOCAL_PEERCRED */ /* Have MinGW32 */ /* #undef ZMQ_HAVE_MINGW32 */ /* 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 */ /* Have QNX Neutrino OS */ /* #undef ZMQ_HAVE_QNXNTO */ /* Whether SOCK_CLOEXEC is defined and functioning. */ /* #undef ZMQ_HAVE_SOCK_CLOEXEC */ /* Have Solaris OS */ /* #undef ZMQ_HAVE_SOLARIS */ /* Whether SO_KEEPALIVE is supported. */ #define ZMQ_HAVE_SO_KEEPALIVE 1 /* Have SO_PEERCRED socket option */ /* #undef ZMQ_HAVE_SO_PEERCRED */ /* Whether TCP_KEEPALIVE is supported. */ /* #undef ZMQ_HAVE_TCP_KEEPALIVE */ /* Whether TCP_KEEPCNT is supported. */ /* #undef ZMQ_HAVE_TCP_KEEPCNT */ /* Whether TCP_KEEPIDLE is supported. */ /* #undef ZMQ_HAVE_TCP_KEEPIDLE */ /* Whether TCP_KEEPINTVL is supported. */ /* #undef ZMQ_HAVE_TCP_KEEPINTVL */ /* Have TIPC support */ /* #undef ZMQ_HAVE_TIPC */ /* Have uio.h header. */ #define ZMQ_HAVE_UIO 1 /* Have Windows OS */ /* #undef ZMQ_HAVE_WINDOWS */ /* Define for Solaris 2.5.1 so the uint32_t typedef from , , 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 */ /* ---- Special case for z/OS Unix Services: openedition ---- */ #include #ifndef NI_MAXHOST #define NI_MAXHOST 1025 #endif zeromq-4.2.5/builds/zos/makeclean0000775000372000037200000000165713255253220017714 0ustar00travistravis00000000000000#! /bin/sh # Remove built object files and test executables # # Written by Ewen McNeill , 2014-07-22 # Updated by Ewen McNeill , 2014-07-24 #--------------------------------------------------------------------------- set -e # Stop on errors # Figure out where we are BIN_DIR=$(dirname $0) if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi case "${BIN_DIR}" in .) BIN_DIR="$(pwd)"; ;; /*) ;; *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;; esac # Locate top of source tree, assuming we're in builds/zos TOP="${BIN_DIR}/../.." SRC="${TOP}/src" TESTS="${TOP}/tests" # Remove object/library files echo "Removing libzmq built files" (cd "${SRC}" && rm -f *.o *.a *.dbg *.x *.so libzmq) # Remove test object files echo "Removing libzmq tests" (cd "${TESTS}" && rm -f *.o *.dbg) (cd "${TESTS}"; EXES=$(ls test_* | grep -v "\.") if [ -n "${EXES}" ]; then rm ${EXES} fi ) zeromq-4.2.5/builds/zos/runtests0000775000372000037200000001322013255253220017650 0ustar00travistravis00000000000000#! /bin/sh # Run ZeroMQ tests, in order. This is extracted from the tests/Makefile # which won't run as-is because it relies on libtool building things, and # thus creating various libtool files, which don't work well on z/OS # # noinst_PROGRAMS needs to be kept in sync with tests/Makefile.am, as it # defines the order in which tests are run. # # Written by Ewen McNeill , 2014-07-19 # Updated by Ewen McNeill , 2014-07-24 #--------------------------------------------------------------------------- set -e # Stop if a test fails #--------------------------------------------------------------------------- # Change to tests directory if necessary # Figure out where we are BIN_DIR=$(dirname $0) if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi case "${BIN_DIR}" in .) BIN_DIR="$(pwd)"; ;; /*) ;; *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;; esac # Locate top of source tree, assuming we're in builds/zos TOP="${BIN_DIR}/../.." SRCDIR="${TOP}/src" TESTDIR="${TOP}/tests" case "$(pwd)" in *tests) ;; *) echo "Changing to ${TESTDIR}" cd "${TESTDIR}" ;; esac if [ -x "test_system" ]; then : else echo "Run makelibzmq and maketests before runtests" >&2 exit 1 fi #--------------------------------------------------------------------------- # Explanation of tests expected to fail: # test_abstract_ipc: Relies on Linux-specific IPC functionality # test_fork: Relies on using pthreads _after_ fork, _before_ exec # test_diffserv: Needs IP_PROTO, IP_TOS setsockopt(); the headers # are present on z/OS UNIX System Services, but # fails with: # EDC8109I Protocol not available. (./ip.cpp:164) # NOTE: not listed as a valid IP setsockopt() option at: # http://pic.dhe.ibm.com/infocenter/zos/v2r1/index.jsp?topic=%2Fcom.ibm.zos.v2r1.bpxbd00%2Fsetopt.htm # XFAIL_TESTS="test_abstract_ipc|test_fork|test_diffserv" # BUILD_TIPC is not defined, so we skip all these tests SKIP_TESTS="test_.*_tipc" # Extract list of all test programs from tests/Makefile.am # # Excluding tests we know will fail because of missing functionality # noinst_PROGRAMS=$(grep "test_" Makefile.am | egrep -v "_SOURCES|XFAIL" | sed 's/noinst_PROGRAMS.* test/test/; s/^ *//; s/ *\\ *$//;' | grep -v "${SKIP_TESTS}" | egrep -v "${XFAIL_TESTS}") #echo "Found tetsts: ${noinst_PROGRAMS}" # Run tests on command line, or all tests we found if [ -n "${1}" ]; then TESTS="$*" # Run tests on command line else TESTS="${noinst_PROGRAMS}" fi verbose() { echo "Starting: $@" >&2 "$@" } # Uncomment TESTS_ENVIRONMENT=verbose to see "Starting: TEST" messages #TESTS_ENVIRONMENT=verbose TESTS_ENVIRONMENT= #--------------------------------------------------------------------------- # Explicitly add SRCDIR into library serach path, to make sure we # use our just-built version LIBPATH="${SRCDIR}:/lib:/usr/lib" export LIBPATH #--------------------------------------------------------------------------- # check-TESTS: target from tests/Makefile, converted from Make syntax to # shell syntax failed=0; all=0; xfail=0; xpass=0; skip=0; srcdir=.; export srcdir; list="${TESTS}"; red=""; grn=""; lgn=""; blu=""; std=""; if test -n "$list"; then for tst in $list; do if test -f ./$tst; then dir=./; elif test -f $tst; then dir=; else dir="${srcdir}/"; fi; if ${TESTS_ENVIRONMENT} ${dir}$tst; then all=`expr $all + 1`; case " ${XFAIL_TESTS} " in *"$tst"*) xpass=`expr $xpass + 1`; failed=`expr $failed + 1`; col=$red; res=XPASS; ;; *) col=$grn; res=PASS; ;; esac; elif test $? -ne 77; then all=`expr $all + 1`; case " ${XFAIL_TESTS} " in *"$tst"*) xfail=`expr $xfail + 1`; col=$lgn; res=XFAIL; ;; *) failed=`expr $failed + 1`; col=$red; res=FAIL; ;; esac; else skip=`expr $skip + 1`; col=$blu; res=SKIP; fi; echo "${col}$res${std}: $tst"; done; if test "$all" -eq 1; then tests="test"; All=""; else tests="tests"; All="All "; fi; if test "$failed" -eq 0; then if test "$xfail" -eq 0; then banner="$All$all $tests passed"; else if test "$xfail" -eq 1; then failures=failure; else failures=failures; fi; banner="$All$all $tests behaved as expected ($xfail expected $failures)"; fi; else if test "$xpass" -eq 0; then banner="$failed of $all $tests failed"; else if test "$xpass" -eq 1; then passes=pass; else passes=passes; fi; banner="$failed of $all $tests did not behave as expected ($xpass unexpected $passes)"; fi; fi; dashes="$banner"; skipped=""; if test "$skip" -ne 0; then if test "$skip" -eq 1; then skipped="($skip test was not run)"; else skipped="($skip tests were not run)"; fi; test `echo "$skipped" | wc -c` -le `echo "$banner" | wc -c` || dashes="$skipped"; \ fi; report=""; if test "$failed" -ne 0 && test -n "${PACKAGE_BUGREPORT}"; then report="Please report to ${PACKAGE_BUGREPORT}"; test `echo "$report" | wc -c` -le `echo "$banner" | wc -c` || dashes="$report"; fi; dashes=`echo "$dashes" | sed s/./=/g`; if test "$failed" -eq 0; then col="$grn"; else col="$red"; fi; echo "${col}$dashes${std}"; echo "${col}$banner${std}"; test -z "$skipped" || echo "${col}$skipped${std}"; test -z "$report" || echo "${col}$report${std}"; echo "${col}$dashes${std}"; test "$failed" -eq 0; else :; fi zeromq-4.2.5/builds/zos/test_fork.cpp0000664000372000037200000000627213255253220020550 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include // For alarm() const char *address = "tcp://127.0.0.1:6571"; #define NUM_MESSAGES 5 #define TIMEOUT_SECS 5 // Global timeout int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); // Create and bind pull socket to receive messages void *pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); int rc = zmq_bind (pull, address); assert (rc == 0); int pid = fork (); if (pid == 0) { // Child process // Immediately close parent sockets and context zmq_close (pull); zmq_ctx_term (ctx); // Create new context, socket, connect and send some messages void *child_ctx = zmq_ctx_new (); assert (child_ctx); void *push = zmq_socket (child_ctx, ZMQ_PUSH); assert (push); rc = zmq_connect (push, address); assert (rc == 0); int count; for (count = 0; count < NUM_MESSAGES; count++) zmq_send (push, "Hello", 5, 0); zmq_close (push); zmq_ctx_destroy (child_ctx); exit (0); } else { // Parent process alarm(TIMEOUT_SECS); // Set upper limit on runtime int count; for (count = 0; count < NUM_MESSAGES; count++) { char buffer [5]; int num_bytes = zmq_recv (pull, buffer, 5, 0); assert (num_bytes == 5); } int child_status; while (true) { rc = waitpid (pid, &child_status, 0); if (rc == -1 && errno == EINTR) continue; assert (rc > 0); // Verify the status code of the child was zero assert (WEXITSTATUS (child_status) == 0); break; } exit (0); } return 0; } zeromq-4.2.5/builds/zos/cxxall0000775000372000037200000000313313255253220017256 0ustar00travistravis00000000000000#! /bin/sh # Attempt to compile all *.cpp files in the current directory, that are # not already compiled. Uses zc++ wrapper around C++ compiler, to add # additional compile arguments. # # Written by Ewen McNeill , 2014-07-19 # Updated by Ewen McNeill , 2014-07-24 #--------------------------------------------------------------------------- VERBOSE="${VERBOSE:-}" # Set to non-empty for already done status export VERBOSE # Locate compiler wrapper BIN_DIR=$(dirname $0) if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi case "${BIN_DIR}" in .) BIN_DIR="$(pwd)"; ;; /*) ;; *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;; esac ZCXX="${BIN_DIR}/zc++" # Determine compile flags CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED=1 -D_OPEN_THREADS=3 -D_OPEN_SYS_SOCK_IPV6" CXXFLAGS="-DZMQ_HAVE_ZOS -DHAVE_CONFIG_H -D_REENTRANT -D_THREAD_SAFE -DZMQ_USE_POLL" case $(pwd) in *src) CXXFLAGS="${CXXFLAGS} -I." ;; *tests) CXXFLAGS="${CXXFLAGS} -I. -I../src -I../include" ;; *) echo "Currently only builds in src/ and tests/" >&2 exit 1 ;; esac skip() { SRC="$1" OBJ="$2" if [ -n "${VERBOSE}" ]; then echo " ${SRC} compiled already" fi } compile() { SRC="$1" OBJ="$2" echo "CXX ${SRC}" "${ZCXX}" ${CXXFLAGS} ${CPPFLAGS} -+ -c -o "${OBJ}" "${SRC}" } for SRC in *.cpp; do OBJ=$(echo $SRC | sed 's/\.cpp/.o/;') if [ -f "${OBJ}" ]; then if [ "${OBJ}" -nt "${SRC}" ]; then skip "${SRC}" "${OBJ}" else compile "${SRC}" "${OBJ}" fi else compile "${SRC}" "${OBJ}" fi done zeromq-4.2.5/builds/zos/makelibzmq0000775000372000037200000000301213255253220020113 0ustar00travistravis00000000000000#! /bin/sh # Build libzmq.a static library and libzmq.so dynamic library # # Usage: makelibzmq # BUILD_DLL=false makelibzmq # Skip building DLL # # NOTE: We do a single compile run for both static and dynamic libraries # which results in the static library having -Wc,exportall compiled objects; # in practice this doesn't seem to cause a problem beyond using some extra # space (around 10%). # # Written by Ewen McNeill , 2014-07-21 # Updated by Ewen McNeill , 2014-07-22 #--------------------------------------------------------------------------- set -e # Stop on errors BUILD_DLL="${BUILD_DLL:-true}" # Build DLL by default # Figure out where we are BIN_DIR=$(dirname $0) if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi case "${BIN_DIR}" in .) BIN_DIR="$(pwd)"; ;; /*) ;; *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;; esac ZCXX="${BIN_DIR}/zc++" # Locate top of source tree, assuming we're in builds/zos TOP="${BIN_DIR}/../.." SRC="${TOP}/src" # Install pre-generated platform.hpp cp -p "${BIN_DIR}/platform.hpp" "${SRC}/platform.hpp" # Compile all the source (optionally ready for a DLL) if [ "${BUILD_DLL}" = "true" ]; then ZCXXFLAGS="${ZCXXFLAGS} -Wc,exportall" export ZCXXFLAGS #echo "Building DLL with ${ZCXXFLAGS}" fi cd "${SRC}" "${BIN_DIR}/cxxall" # Make static library ar r libzmq.a *.o # Optionally Make dynamic library if [ "${BUILD_DLL}" = "true" ]; then #echo "Building libzmq.so DLL" "${ZCXX}" -Wl,DLL -o libzmq.so *.o fi zeromq-4.2.5/builds/zos/maketests0000775000372000037200000000502613255253220017766 0ustar00travistravis00000000000000#! /bin/sh # Build tests/* executables; assumes that libzmq.a or libzmq.so/libzmq.x # is already built # # If libzmq.so and libzmq.x exist, then dynamic linking is used, otherwise # static linking is used. # # Written by Ewen McNeill , 2014-07-21 # Updated by Ewen McNeill , 2014-07-22 #--------------------------------------------------------------------------- set -e # Stop on errors VERBOSE="${VERBOSE:-}" # Set to non-empty for already done status export VERBOSE # Figure out where we are BIN_DIR=$(dirname $0) if [ -z "${BIN_DIR}" ]; then BIN_DIR="."; fi case "${BIN_DIR}" in .) BIN_DIR="$(pwd)"; ;; /*) ;; *) BIN_DIR="$(pwd)/${BIN_DIR}"; ;; esac # Locate compiler wrapper ZCXX="${BIN_DIR}/zc++" # Locate top of source tree, assuming we're in builds/zos TOP="${BIN_DIR}/../.." SRC="${TOP}/src" TESTS="${TOP}/tests" # Figure out how we are going to link to ZMQ LINK_TYPE=unknown if [ -f "${SRC}/platform.hpp" -a -f "${SRC}/libzmq.so" -a -f "${SRC}/libzmq.x" ]; then LINK_TYPE=dynamic elif [ -f "${SRC}/platform.hpp" -a -f "${SRC}/libzmq.a" ]; then LINK_TYPE=static else echo "Error: run makezmqlib to build libzmq.a and/or libzmq.so/libzmq.x first" >&2 exit 1 fi # Copy in replacement test with timeout, if main version is not already # up to date # if [ -f "${TESTS}/test_fork.cpp" ] && grep "TIMEOUT" "${TESTS}/test_fork.cpp" >/dev/null 2>&1; then : # Already copied in else echo "Updating test_fork.cpp to version with master timeout" cp -p "${BIN_DIR}/test_fork.cpp" "${TESTS}/test_fork.cpp" fi # Compile all the source if [ "${LINK_TYPE}" = "dynamic" ]; then ZCXXFLAGS="${ZCXXFLAGS} -Wc,DLL" export ZXCCFLAGS echo "Building tests to use DLL: ${ZCXXFLAGS}" fi cd "${TESTS}" "${BIN_DIR}/cxxall" # Link all the executables that are not already linked skip() { OBJ="$1" EXE="$2" if [ -n "${VERBOSE}" ]; then echo "${OBJ} linked to ${EXE}" fi } link() { OBJ="$1" EXE="$2" echo " LD ${EXE}" case "${LINK_TYPE}" in static) "${ZCXX}" -L ../src -o "${EXE}" "${OBJ}" -lzmq ;; dynamic) "${ZCXX}" -o "${EXE}" "${OBJ}" ../src/libzmq.x ;; *) echo "Do not know how to do ${LINK_TYPE} linking!" 2>&1 exit 1 ;; esac } for OBJ in *.o; do EXE=$(echo "${OBJ}" | sed 's/\.o//;') if [ -f "${EXE}" ]; then if [ "${EXE}" -nt "${OBJ}" ]; then skip "${OBJ}" "${EXE}" else link "${OBJ}" "${EXE}" fi else link "${OBJ}" "${EXE}" fi done zeromq-4.2.5/builds/zos/zc++0000775000372000037200000000305613255253220016531 0ustar00travistravis00000000000000#! /bin/sh # Wrapper around IBM C++ compiler to add "-+" to preprocessor calls # and thus work with C++ in files other than *.C. Also add -Wc,lang(longlong) # with appropriate quoting to avoid shell confusion -- this is difficult # to get through both ./configure arguments _and_ Makefile/shell expansion # safely so more easily added in this wrapper. # # Finally, by default will enable xplink for C++ compatibilty and performance # (c++ standard library requires xplink enabled). # # Additional compile/link flags can be passed in as ZCXXFLAGS, eg: # # For debug: ZXCCFLAGS=-g ... # # Written by Ewen McNeill , 2014-07-18 # Updated by Ewen McNeill , 2014-07-21 #--------------------------------------------------------------------------- CPPFLAGS="-+" LONGLONG="-Wc,lang(longlong)" XPLINK="${XPLINK:--Wc,xplink -Wl,xplink}" CXX="/bin/c++" ZCXXFLAGS="${ZCXXFLAGS:-}" # Extra compile/link arguments, eg "-g" # For debugging calling conventions issues #echo "Called with: $0 $@" >>/tmp/zc++.log 2>&1 #exec >>/tmp/zc++.log 2>&1 #set -x case "$1" in -E) exec "${CXX}" "${CPPFLAGS}" "$@" ;; -o) exec "${CXX}" ${ZCXXFLAGS} "${LONGLONG}" "${CPPFLAGS}" ${XPLINK} "$@" ;; -c) exec "${CXX}" ${ZCXXFLAGS} "${LONGLONG}" "${CPPFLAGS}" ${XPLINK} "$@" ;; -L) # Special case for linking via C++, called from linkall exec "${CXX}" ${ZCXXFLAGS} ${XPLINK} "$@" ;; *) exec "${CXX}" ${ZCXXFLAGS} "${LONGLONG}" ${XPLINK} "$@" ;; esac zeromq-4.2.5/builds/mingw32/0000775000372000037200000000000013255253402016512 5ustar00travistravis00000000000000zeromq-4.2.5/builds/mingw32/platform.hpp0000664000372000037200000000346413255253220021054 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PLATFORM_HPP_INCLUDED__ #define __ZMQ_PLATFORM_HPP_INCLUDED__ // This is the platform definition for the MSVC platform. // As a first step of the build process it is copied to // zmq directory to take place of platform.hpp generated from // platform.hpp.in on platforms supported by GNU autotools. // Place any MSVC-specific definitions here. #define ZMQ_HAVE_WINDOWS #define ZMQ_USE_LIBSODIUM #endif zeromq-4.2.5/builds/mingw32/Makefile.mingw320000664000372000037200000000272413255253220021442 0ustar00travistravis00000000000000CC=gcc CFLAGS=-Wall -Os -g -DDLL_EXPORT -DFD_SETSIZE=16384 -DZMQ_USE_SELECT -I. LIBS=-lws2_32 -lIphlpapi -lsodium OBJS = ctx.o reaper.o dist.o err.o \ clock.o metadata.o random.o \ object.o own.o \ io_object.o io_thread.o \ lb.o fq.o \ address.o tcp_address.o ipc_address.o \ ipc_connecter.o ipc_listener.o \ tcp_connecter.o tcp_listener.o \ mailbox.o msg.o mtrie.o \ pipe.o precompiled.o proxy.o \ signaler.o stream_engine.o \ thread.o trie.o \ ip.o tcp.o \ pgm_socket.o pgm_receiver.o pgm_sender.o \ raw_decoder.o raw_encoder.o \ v1_decoder.o v1_encoder.o v2_decoder.o v2_encoder.o \ udp_address.o udp_engine.o radio.o dish.o \ socket_base.o session_base.o options.o \ req.o rep.o push.o pull.o pub.o sub.o pair.o \ dealer.o router.o xpub.o xsub.o stream.o \ poller_base.o select.o poll.o epoll.o kqueue.o devpoll.o \ curve_client.o curve_server.o \ mechanism.o null_mechanism.o plain_client.o plain_server.o \ socks.o server.o decoder_allocators.o socks_connecter.o \ socket_poller.o mailbox_safe.o plain_server.o client.o timers.o \ zmq.o zmq_utils.o gather.o scatter.o dgram.o %.o: ../../src/%.cpp $(CC) -c -o $@ $< $(CFLAGS) %.o: ../../perf/%.cpp $(CC) -c -o $@ $< $(CFLAGS) all: libzmq.dll perf: inproc_lat.exe inproc_thr.exe local_lat.exe local_thr.exe remote_lat.exe remote_thr.exe libzmq.dll: $(OBJS) g++ -shared -static -O2 -s -o $@ $^ -Wl,--out-implib,$@.a $(LIBS) %.exe: %.o libzmq.dll g++ -o -O2 $@ $^ clean: del *.o *.a *.dll *.exe zeromq-4.2.5/builds/nuget/0000775000372000037200000000000013255253402016346 5ustar00travistravis00000000000000zeromq-4.2.5/builds/nuget/libzmq.autopkg0000664000372000037200000000275713255253220021251 0ustar00travistravis00000000000000nuget{ nuspec{ id = libzmq; version : 4.1.0-alpha; title: ZMQ - Code Connected; authors: { zeromq }; owners: { phreed, jgoz }; licenseUrl: "https://www.gnu.org/licenses/lgpl.html"; projectUrl: "http://www.zeromq.org/"; iconUrl: "http://www.zeromq.org/local--files/admin:css/logo.gif"; requireLicenseAcceptance: false; summary: Code Connected; description: @" ZeroMQ \zeromq\: - Connect your code in any language, on any platform. - Carries messages across inproc, IPC, TCP, TPIC, multicast. - Smart patterns like pub-sub, push-pull, and router-dealer. - High-speed asynchronous I/O engines, in a tiny library. - Backed by a large and active open source community. - Supports every modern language and platform. - Build any architecture: centralized, distributed, small, or large. - Free software with full commercial support."; releaseNotes: "Made a NuGet package."; copyright: Copyright 2012 iMatix Corporation and Contributors; tags: {0mq, zeromq, nuget, native; } } files{ #defines { SDK_ROOT = ..\..\; SDK_2010 = ..\msvc\; } include: { "${SDK_ROOT}include\*" }; docs: { "${SDK_ROOT}doc\*.txt" }; [x64,v100,debug] { lib: ${SDK_2010}Debug\libzmq.lib; symbols: ${SDK_2010}Debug\libzmq.pdb; } [x64,v100,release] { lib: ${SDK_2010}Release\libzmq.lib; bin: ${SDK_2010}..\..\lib\libzmq.dll; } targets{ Defines += HAS_CPP_ZMQ_SDK; } } } zeromq-4.2.5/builds/nuget/readme.nuget0000664000372000037200000000115613255253220020650 0ustar00travistravis00000000000000 NuGet is a package management system for MS-Windows. It is similar in spirit to tools like Maven or Gradle. It was originaly for .Net only packages but it has recently been augmented to working with native packages. http://docs.nuget.org/docs/reference/support-for-native-projects The instructions for building a NuGet package can be found here: http://coapp.org/pages/tutorials.html The basic procedure is to first build all the artifacts and then run ... Write-NuGetPackage .\libzmq.autopkg The *.nuget files thus produced can then be installed in a local repository or uploaded to one of the nuget servers. zeromq-4.2.5/ChangeLog0000664000372000037200000114334013255253403015523 0ustar00travistravis00000000000000# Generated by Makefile. Do not edit. commit d062edd8c142384792955796329baf1e5a3377cd Author: Luca Boccassi Date: Fri Mar 23 19:23:22 2018 +0000 Finalise changelog for 4.2.5 NEWS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit d70981f54df4c80bd62a299014d6cbb24774a821 Merge: 7f1f705 a66a9d9 Author: Constantin Rack Date: Fri Mar 23 20:13:00 2018 +0100 Merge pull request #3019 from bluca/newver Problem: regression in 4.2.3 needs to be fixed before 4.3 commit a66a9d9e8d28eb4fb7b32ee43c3e7330cf513ca8 Author: Luca Boccassi Date: Fri Mar 23 11:27:07 2018 +0000 Problem: want to release 4.2.5 but no NEWS Solution: note bug fixes NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) commit 5f17e26fa4c60c3de0282d1b6ad1e8b7037ed57a Author: Luca Boccassi Date: Fri Mar 23 11:18:28 2018 +0000 Problem: regression in 4.2.3 went unnoticed, want to release 4.2.5 Solution: revert DRAFT -> STABLE API transition so that we can do a bugfix-only 4.2.5 release. Will be re-reverted once tagged. Revert "Problem: ZMQ_BINDTODEVICE has met STABLE conditions" This reverts commit 3cb79f5042cf32cdb7b1b58d4acf17eba85ec9f7. Revert "Problem: ZMQ_MSG_GSSAPI_* have met STABLE conditions" This reverts commit 374da4207b8034b0fcd67a2cc2165d50e09b9387. Revert "Problem: ZMQ_MSG_T_SIZE has met STABLE conditions" This reverts commit 6411c4a247c08ead50919d16b30eb030eaf44a7e. Revert "Problem: docs say STABLE API still in DRAFT" This reverts commit 9f2f30b7ffa09acc51d3b87251a47e83b435d5d4. NEWS | 17 +---------------- configure.ac | 2 +- doc/zmq_ctx_get.txt | 1 + doc/zmq_getsockopt.txt | 6 ++++++ doc/zmq_setsockopt.txt | 5 +++++ include/zmq.h | 30 +++++++++++++++--------------- packaging/debian/changelog | 2 +- packaging/debian/zeromq.dsc.obs | 2 +- packaging/redhat/zeromq.spec | 2 +- src/zmq_draft.h | 13 +++++++++++++ tests/test_security_gssapi.cpp | 6 ++++++ 11 files changed, 51 insertions(+), 35 deletions(-) commit 7f1f7057d81dae9e0189d895f5061a5eeb0ba1d5 Merge: 7722381 1c5a63e Author: Constantin Rack Date: Thu Mar 22 22:10:30 2018 +0100 Merge pull request #3018 from bluca/null_auth_regression Problem: backward incompatible change to NULL with ZAP commit 1c5a63e9394865ce01b91b4678d1932f7dd65087 Author: Luca Boccassi Date: Thu Mar 22 19:27:23 2018 +0000 Problem: backward incompatible change to NULL with ZAP Solution: like for other mechanism, do not enforce strict ZAP protocol adherence unless the specific socket option is enabled with NULL auth. Add test to exercise this functionality, and fix ZAP test to set the socket option when it uses NULL auth. See: https://github.com/zeromq/pyzmq/pull/1152 src/null_mechanism.cpp | 29 ++++++++++++++------------ tests/test_security_null.cpp | 49 +++++++++++++++++++++++++++++++++++++++++--- tests/test_security_zap.cpp | 8 +++++--- 3 files changed, 67 insertions(+), 19 deletions(-) commit e4b3bd86313b0c8b046a13983971f6d57dbc7111 Author: Luca Boccassi Date: Thu Mar 22 19:23:04 2018 +0000 Problem: cannot set ZAP_ENFORCE_DOMAIN in testutil's wrappers Solution: override unused parameter for NULL wrapper tests/testutil_security.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) commit 7722381fe7d49086841af4ccfe4448cefed116f9 Merge: 0e1a9a5 1b733e7 Author: Simon Giesecke Date: Wed Mar 21 22:53:44 2018 +0100 Merge pull request #3016 from bluca/fix_docs Problem: some inaccuracies in manpages commit 1b733e75a26cbf9f9c31e8f045efcc1d738223aa Author: Luca Boccassi Date: Wed Mar 21 19:57:54 2018 +0000 Problem: zmq_connect doc says inproc has to be bound first Solution: fix it, as since 4.2.0 there is no ordering constraint anymore Fixes: #2854 doc/zmq_connect.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit dba4ef28cc3419a7fa87b71c2b46ea0996f94a2d Author: Luca Boccassi Date: Wed Mar 21 19:55:55 2018 +0000 Problem: zmq_close manpage does not say it's asynchronous Solution: clarify it since it's a common source of confusion doc/zmq_close.txt | 3 +++ 1 file changed, 3 insertions(+) commit 9f2f30b7ffa09acc51d3b87251a47e83b435d5d4 Author: Luca Boccassi Date: Wed Mar 21 19:54:29 2018 +0000 Problem: docs say STABLE API still in DRAFT Solution: update them doc/zmq_getsockopt.txt | 6 ------ doc/zmq_setsockopt.txt | 5 ----- 2 files changed, 11 deletions(-) commit 0e1a9a5252467cb04ffd03dd616ce13a787c3d86 Merge: 0b99710 6fa9362 Author: Luca Boccassi Date: Wed Mar 21 19:37:31 2018 +0000 Merge pull request #3015 from aytekinar/3012-gcc-fix Fix gcc build problem commit 6fa93623516dc57f930c5208ed5f1a83434810b8 Author: Arda Aytekin Date: Wed Mar 21 18:21:39 2018 +0100 Fix gcc build problem Fixed gcc-related build problem resulting from `-errwarn=%all` switch. Fixes #3012. CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 0b997109493f3e9df668bb1031c95b2b4ea81fd1 Merge: 7fb3bdd 3cb79f5 Author: Doron Somech Date: Wed Mar 21 19:03:26 2018 +0200 Merge pull request #3014 from bluca/draft Problems: some APIs have met stable conditions commit 3cb79f5042cf32cdb7b1b58d4acf17eba85ec9f7 Author: Luca Boccassi Date: Mon Mar 19 21:23:59 2018 +0000 Problem: ZMQ_BINDTODEVICE has met STABLE conditions Solution: move them from DRAFT to STABLE since it's been in a public release, committed for 6+ months and has not changed. NEWS | 4 ++++ include/zmq.h | 2 +- src/zmq_draft.h | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) commit 374da4207b8034b0fcd67a2cc2165d50e09b9387 Author: Luca Boccassi Date: Mon Mar 19 21:08:23 2018 +0000 Problem: ZMQ_MSG_GSSAPI_* have met STABLE conditions Solution: move them from DRAFT to STABLE since it's been in a public release, committed for 6+ months and has not changed. NEWS | 7 +++++++ include/zmq.h | 22 +++++++++++----------- src/zmq_draft.h | 11 ----------- tests/test_security_gssapi.cpp | 6 ------ 4 files changed, 18 insertions(+), 28 deletions(-) commit a4b74a7b05e9631be9593018092fbfb292600bea Author: Luca Boccassi Date: Mon Mar 19 20:15:24 2018 +0000 Problem: ZMQ_ZERO_COPY_RCV not marked as DRAFT in docs Solution: update manpages doc/zmq_ctx_get.txt | 1 + doc/zmq_ctx_set.txt | 1 + 2 files changed, 2 insertions(+) commit 6411c4a247c08ead50919d16b30eb030eaf44a7e Author: Luca Boccassi Date: Mon Mar 19 20:11:42 2018 +0000 Problem: ZMQ_MSG_T_SIZE has met STABLE conditions Solution: move it from DRAFT to STABLE since it's been in a public release, committed for 6+ months and has not changed. Given a new STABLE symbol has been added, bump minor version number. NEWS | 6 +++++- configure.ac | 2 +- doc/zmq_ctx_get.txt | 1 - include/zmq.h | 6 +++--- packaging/debian/changelog | 2 +- packaging/debian/zeromq.dsc.obs | 2 +- packaging/redhat/zeromq.spec | 2 +- src/zmq_draft.h | 1 - 8 files changed, 12 insertions(+), 10 deletions(-) commit 7fb3bdd59a506d3c6dc8de45aeb64dc37b8c9b95 Merge: 44f7158 f0378bf Author: Simon Giesecke Date: Wed Mar 21 17:17:35 2018 +0100 Merge pull request #3013 from bluca/newver Problem: 4.2.4 is out, version is out of date commit f0378bfbf780c379a54fefdf26c3d586d5acd48a Author: Luca Boccassi Date: Wed Mar 21 16:03:49 2018 +0000 Problem: 4.2.4 is out, version is out of date Solution: bump to 4.2.5 CMakeLists.txt | 2 +- NEWS | 4 ++++ configure.ac | 3 ++- include/zmq.h | 2 +- packaging/debian/changelog | 2 +- packaging/debian/zeromq.dsc.obs | 2 +- packaging/redhat/zeromq.spec | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) commit 44f7158b291941c5fe5e2ba76e57d1676de81430 Author: Luca Boccassi Date: Wed Mar 21 15:44:15 2018 +0000 Finalise changelog for 4.2.4 NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 4efc2bf44eec51f730fa45c6c86515a4670aa354 Author: Luca Boccassi Date: Wed Mar 21 15:42:17 2018 +0000 Problem: no mention of #2942 in NEWS Solution: add it NEWS | 4 ++++ 1 file changed, 4 insertions(+) commit 45681798b781ac395a4e49d6a10fd1d8bf54f393 Merge: 15b3dcc 84a3767 Author: Luca Boccassi Date: Wed Mar 21 15:43:26 2018 +0000 Merge pull request #3011 from sigiesec/migrate-to-unity Migrate test_reqrep_tcp to unity commit 84a3767d61d1f1c8720da40d370758c37dad5c30 Author: Simon Giesecke Date: Wed Mar 21 16:28:10 2018 +0100 Problem: open TODO comment regarding explicit zmq_disconnect/zmq_unbind Solution: replaced by a comment explaining why the calls are in the test tests/test_reqrep_tcp.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) commit 786a8d48d5a19a78dcaaf2df1f148d5f1ac98ded Author: Simon Giesecke Date: Wed Mar 21 15:05:33 2018 +0100 Problem: code duplication in test_reqrep_tcp Solution: extracted make_connect_address tests/test_reqrep_tcp.cpp | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) commit 8372797cc3b309df6563cfdba1d5cf64d7adbba6 Author: Simon Giesecke Date: Wed Mar 21 15:01:25 2018 +0100 Problem: code duplication in test_reqrep_tcp Solution: extracted bind_loopback tests/test_reqrep_tcp.cpp | 60 +++++++---------------------------------------- tests/testutil_unity.hpp | 16 +++++++++++-- 2 files changed, 23 insertions(+), 53 deletions(-) commit c84c3a525a42c33d4dc00ff3a5927a54e238dd32 Author: Simon Giesecke Date: Wed Mar 21 13:54:23 2018 +0100 Problem: test_reqrep_tcp not yet using unity Solution: migrate to unity Makefile.am | 3 +- tests/test_reqrep_tcp.cpp | 349 +++++++++++++++++++--------------------------- 2 files changed, 148 insertions(+), 204 deletions(-) commit 15b3dccf47179a88311c84d6ef250565abd05182 Merge: a415ede 780813c Author: Constantin Rack Date: Tue Mar 20 20:21:18 2018 +0100 Merge pull request #3009 from bluca/newver Problem: NEWS out of date commit 780813c4e7a28a07c422392e27d3846c8b2bf26e Author: Luca Boccassi Date: Tue Mar 20 19:18:40 2018 +0000 Problem: NEWS out of date Solution: note new features, APIs and major user-visible bug fixes NEWS | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) commit a415ede398553ba4ae86391e32352a712b0439a8 Merge: 9d3efcb 6a5af3d Author: Luca Boccassi Date: Tue Mar 20 13:46:30 2018 +0000 Merge pull request #3008 from eponsko/master Problem: Unnecessary errno_assert commit 6a5af3dae694010d097d383de2d14a6241f0c536 Author: Pontus Sköldström Date: Tue Mar 20 14:35:24 2018 +0100 Removed unnecessary errno_assert src/udp_engine.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) commit 9d3efcb03010ff95da1c807faa66278203d3bd1e Merge: e49a861 65a9670 Author: Luca Boccassi Date: Mon Mar 19 18:06:13 2018 +0000 Merge pull request #3002 from eponsko/master Problem: ZMQ_DISH over UDP triggers errno_assert() after hitting wate… commit 65a9670065ed7c155f9226a8d0164598eb9e1cb2 Author: Pontus Sköldström Date: Mon Mar 19 17:46:29 2018 +0100 Problem: ZMQ_DISH over UDP triggers errno_assert() after hitting watermark src/udp_engine.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) commit e49a861f7ce0bcf65700de32d314cdb122d5f703 Merge: 4d9fc80 8f5fc70 Author: Simon Giesecke Date: Mon Mar 19 17:25:33 2018 +0100 Merge pull request #3001 from bluca/sodium_global_init Problem: global random init/deinit breaks existing applications commit 8f5fc705e4483ba907e42a39b46a7741827c7345 Author: Luca Boccassi Date: Mon Mar 19 11:46:21 2018 +0000 Problem: global random init/deinit breaks existing applications Solution: restrict it only to the original issue #2632, Tweetnacl on *NIX when using /dev/urandom, ie: without the new Linux getrandom() syscall. Existing applications might use atexit to register cleanup functions (like CZMQ does), and the current change as-is imposes an ordering that did not exist before - the context MUST be created BEFORE registering the cleanup with atexit. This is a backward incompatible change that is reported to cause aborts in some applications. Although libsodium's documentation says that its initialisation APIs is not thread-safe, nobody has ever reported an issue with it, so avoiding the global init/deinit in the libsodium case is the less risky option we have. Tweetnacl users on Windows and on Linux with getrandom (glibc 2.25 and Linux kernel 3.17) are not affected by the original issue. Fixes #2991 src/random.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) commit 4d9fc8066fe75795e8ccd77526b16baa5615b6bf Merge: 8d0d4c7 6d89635 Author: Luca Boccassi Date: Fri Mar 16 17:14:12 2018 +0000 Merge pull request #2999 from sigiesec/migrate-to-unity Migrate further tests to unity commit 6d89635f9a6e1102c9d03bb03ed7cd6dcfa4565a Author: Simon Giesecke Date: Fri Mar 16 17:03:45 2018 +0100 Problem: test_udp not using unity Solution: migrate to unity, merge into test_radio_dish, and split up test cases Makefile.am | 4 -- tests/CMakeLists.txt | 1 - tests/test_radio_dish.cpp | 50 ++++++++++++++++- tests/test_udp.cpp | 134 ---------------------------------------------- 4 files changed, 48 insertions(+), 141 deletions(-) commit dc2764f58c7f6b3fc1b677fe9dfe98b5394a3416 Author: Simon Giesecke Date: Fri Mar 16 16:35:31 2018 +0100 Problem: test_last_endpoint not using unity Solution: migrate to unity Makefile.am | 3 ++- tests/test_last_endpoint.cpp | 40 +++++++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 16 deletions(-) commit 1747cbdcac23dd6223e9f37db68eb14118777055 Author: Simon Giesecke Date: Fri Mar 16 15:46:39 2018 +0100 Problem: test_immediate not using unity Solution: migrate to unity, and split test cases Makefile.am | 3 +- tests/test_immediate.cpp | 215 +++++++++++++++++++++-------------------------- 2 files changed, 100 insertions(+), 118 deletions(-) commit 6f8b6046483d2d3a8ff0f6cbbd028d67ded0ff4b Author: Simon Giesecke Date: Fri Mar 16 15:22:14 2018 +0100 Problem: test_radio_dish not using unity Solution: migrate to unity, and split test cases Makefile.am | 3 +- tests/test_radio_dish.cpp | 197 +++++++++++++++++++++++----------------------- 2 files changed, 99 insertions(+), 101 deletions(-) commit cdc298f56711e09e8f787b34ab6d6274e128df83 Author: Simon Giesecke Date: Fri Mar 16 15:21:39 2018 +0100 Problem: bind_loopback_ipv4 not reusable Solution: Moved bind_loopback_ipv4 to testutil_unity to allow for reuse tests/test_poller.cpp | 7 ------- tests/testutil_unity.hpp | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) commit 8d0d4c76ee4bb32c20725506fa04f712e5a33a34 Merge: 9079cf8 eb76ea0 Author: Doron Somech Date: Fri Mar 16 13:54:02 2018 +0200 Merge pull request #2998 from kachanovskiy/master Fix for #2997 commit eb76ea06bdcbe390067c7a734ad24ea1b858650c Author: Kachanovskiy Date: Fri Mar 16 12:48:00 2018 +0100 Fix for #2997 tests/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) commit 9079cf8ed4cd7028efb4d2f86e8c7aeb4757fd7b Merge: 4cb15ec 57422c7 Author: Luca Boccassi Date: Thu Mar 15 16:55:26 2018 +0000 Merge pull request #2995 from eponsko/master Problem: Documentation missing for ZMQ_METADATA socket option commit 4cb15ec6386bbfa541313693ceffd935975a9586 Merge: e388774 7bd57ba Author: Luca Boccassi Date: Thu Mar 15 16:55:05 2018 +0000 Merge pull request #2994 from sigiesec/migrate-to-unity Migrate further tests to unity, and split up into individual test cases commit 57422c7df16c4c2c8e14cb09839a7fc4b1c6f5cd Author: Pontus Sköldström Date: Thu Mar 15 17:24:32 2018 +0100 Problem: Documentation missing for ZMQ_METADATA socket option doc/zmq_msg_gets.txt | 10 ++++++---- doc/zmq_setsockopt.txt | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) commit 7bd57ba83b9cceea5fbce43abfbbe7cb0d127b9f Author: Simon Giesecke Date: Thu Mar 15 16:09:24 2018 +0100 Problem: test case tests multiple aspects Solution: split test case tests/test_poller.cpp | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) commit 3e374d98f1cb3d8819c42744fb5160831cd7c52b Author: Simon Giesecke Date: Thu Mar 15 16:01:09 2018 +0100 Problem: test case tests multiple aspects Solution: split test case tests/test_poller.cpp | 101 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 65 insertions(+), 36 deletions(-) commit eb0307a9a66c5ae021d7e32c071eff32223340d4 Author: Simon Giesecke Date: Thu Mar 15 15:04:24 2018 +0100 Problem: test case tests multiple aspects Solution: split test case tests/test_poller.cpp | 125 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 40 deletions(-) commit 10dae6e8300ed4839b3c1e0ed96dc45dd8edb236 Author: Simon Giesecke Date: Thu Mar 15 14:46:17 2018 +0100 Problem: test_poller not using unity Solution: migrate to unity, and split test cases Makefile.am | 3 +- tests/test_poller.cpp | 561 ++++++++++++++++++++++++++++------------------- tests/testutil_unity.hpp | 7 + 3 files changed, 345 insertions(+), 226 deletions(-) commit 991b2336e443ab0f12197198354b8fa5b331b5db Author: Simon Giesecke Date: Thu Mar 15 13:44:24 2018 +0100 Problem: test_thread_safe not using unity Solution: migrate to unity, and split test cases Makefile.am | 3 +- tests/test_thread_safe.cpp | 91 ++++++++++++++++++++++++++++++---------------- 2 files changed, 62 insertions(+), 32 deletions(-) commit 5d32828bbf1bc1e07a006094c3792927e29668d1 Author: Simon Giesecke Date: Thu Mar 15 11:47:57 2018 +0100 Problem: test_reconnect_ivl not using unity Solution: migrate to unity, and reduce code duplication Makefile.am | 3 +- tests/test_reconnect_ivl.cpp | 128 +++++++++++++++++-------------------------- 2 files changed, 52 insertions(+), 79 deletions(-) commit e3887747373cb9cb0a2f4bc77f15b225984c8376 Merge: b2e50d9 dd5eec3 Author: Luca Boccassi Date: Thu Mar 15 12:57:40 2018 +0000 Merge pull request #2981 from eponsko/master Problem: no support for ZMTP 3.1 application metadata commit 1e217ac06338897dcacdd1499b69184f6ea7625d Author: Simon Giesecke Date: Thu Mar 15 11:28:50 2018 +0100 Problem: unity built with unnecessary float but without command line argument support Solution: add appropriate definitions to build Makefile.am | 2 +- tests/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) commit f92cdf94705a77e37acc1a9330b481952334164b Author: Simon Giesecke Date: Thu Mar 15 10:58:56 2018 +0100 Problem: test_ctx_destroy not using unity, and mixing test cases Solution: migrate to unit and split up test cases Makefile.am | 3 +- tests/test_ctx_destroy.cpp | 80 +++++++++++++++++++++++++++------------------- 2 files changed, 50 insertions(+), 33 deletions(-) commit b2e50d9d03b9c124e067070d471fcaed63f79362 Merge: 59516ed fa89fb8 Author: Luca Boccassi Date: Wed Mar 14 23:04:53 2018 +0000 Merge pull request #2992 from sigiesec/migrate-to-unity Migrate more tests to unity commit fa89fb86397761f810d7f9eb264c64c8f812d3a5 Author: Simon Giesecke Date: Wed Mar 14 22:33:41 2018 +0100 Problem: Makefile.am missing unity dependencies Solution: add unity dependencies/flags Makefile.am | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit 9553a1f33e16c307985e665577422a30ac91fe4b Author: Simon Giesecke Date: Wed Mar 14 22:29:02 2018 +0100 Problem: test_connect_resolve not yet using unity Solution: migrate to unity tests/test_connect_resolve.cpp | 88 +++++++++++++++++++++++++++++------------- 1 file changed, 61 insertions(+), 27 deletions(-) commit 6f9459e3fb0e261d3fead93e4f52488240bd5ddd Author: Simon Giesecke Date: Wed Mar 14 19:05:19 2018 +0100 Migrate tests/test_conflate.cpp to unity tests/test_conflate.cpp | 70 ++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 33 deletions(-) commit d318c95bc2dba0b7bcd5047e743a109de4e008d0 Author: Simon Giesecke Date: Wed Mar 14 18:56:50 2018 +0100 Problem: different aspects mixed in one test case Solution: split up test case tests/test_client_server.cpp | 65 ++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 23 deletions(-) commit dbcd42c58d23d06e4e10c302810c570d157e7c12 Author: Simon Giesecke Date: Wed Mar 14 18:45:26 2018 +0100 Migrate tests/test_client_server.cpp to unity tests/test_client_server.cpp | 120 +++++++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 50 deletions(-) commit 0114572ce6d238a145f6b4d0cdfbee62c1b274ec Author: Simon Giesecke Date: Wed Mar 14 18:45:25 2018 +0100 Migrate tests/test_bind_src_address.cpp to unity tests/test_bind_src_address.cpp | 45 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 18 deletions(-) commit be33dce68e31df5ac61fa55704efb48378001e8e Author: Simon Giesecke Date: Wed Mar 14 18:45:25 2018 +0100 Migrate tests/test_bind_after_connect_tcp.cpp to unity tests/test_bind_after_connect_tcp.cpp | 100 +++++++++++++--------------------- 1 file changed, 38 insertions(+), 62 deletions(-) commit 631de94563f26fef7b958989535b973bc0f89988 Author: Simon Giesecke Date: Wed Mar 14 15:09:13 2018 +0100 Problem: test_router_hangover not yet using unity Solution: migrate to unity tests/test_router_handover.cpp | 111 ++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 58 deletions(-) commit 59516ed51a5c8ce7e1de0d9f938141f68507dd3c Merge: df03bf4 59157f0 Author: Luca Boccassi Date: Wed Mar 14 13:25:02 2018 +0000 Merge pull request #2990 from sigiesec/migrate-to-unity Problem: test assertion failures do not clean up properly commit dd5eec35be98c924d895ce0959d1f5e03bf84650 Author: Pontus Sköldström Date: Mon Mar 12 01:41:33 2018 +0100 Support application metadata through ZMQ_METADATA Lets the application set per-connection metadata. Metadata is specified as "X-key:value" and set using zmq_setsockopt, eg: zmq_setsockopt (s, ZMQ_METADATA, "X-key:value", 11); The peer can then obtain the metadata from a received message: char *data = zmq_msg_gets(msg, "X-key"); Makefile.am | 7 +- include/zmq.h | 1 + src/mechanism.cpp | 17 +++++ src/options.cpp | 20 ++++++ src/options.hpp | 4 ++ src/zmq_draft.h | 1 + tests/CMakeLists.txt | 1 + tests/test_address_tipc.cpp | 13 ++-- tests/test_app_meta.cpp | 167 ++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 226 insertions(+), 5 deletions(-) commit 59157f0e2fa518a16edda1e71ca398d860601661 Author: Simon Giesecke Date: Wed Mar 14 10:09:18 2018 +0100 Problem: missing guidelines on proper test cleanup Solution: add guidelines to tests/README.md tests/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) commit 9e3932b46bf1c27d8e12e4e1a87b90267718fe82 Author: Simon Giesecke Date: Wed Mar 14 09:59:16 2018 +0100 Problem: test assertion failures do not clean up properly Solution: provide test_context and manage sockets of test_context via setup and teardown tests/test_hwm.cpp | 52 +++++++--------------- tests/test_router_mandatory.cpp | 47 +++++++------------ tests/test_sockopt_hwm.cpp | 35 +++++++-------- tests/testutil_unity.hpp | 99 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 147 insertions(+), 86 deletions(-) commit df03bf4825a25bd1ae592c76520165edb82abfe9 Merge: c9437ab c602361 Author: Luca Boccassi Date: Wed Mar 14 08:14:34 2018 +0000 Merge pull request #2987 from sigiesec/migrate-to-unity Migrate further tests (test_hwm, test_router_mandatory) to unity commit c6023618360d7df5e3a42e9a5aa280da52171474 Author: Simon Giesecke Date: Tue Mar 13 12:20:29 2018 +0100 Problem: debug output in CMake file Solution: removed unittests/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) commit 437e9f4f5911b00c8d1f28ced79e93f4416c905f Author: Simon Giesecke Date: Tue Mar 13 12:08:09 2018 +0100 Problem: tests readme outdated Solution: fixed description for building tests, added references to unity and unittests tests/README.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) commit ae558706bfb839ed3acb7c54e20566c339cb9aee Author: Simon Giesecke Date: Tue Mar 13 12:00:41 2018 +0100 Problem: test_hwm and test_router_mandatory not yet using unity Solution: migrate to unity Makefile.am | 10 +- tests/CMakeLists.txt | 2 +- tests/test_hwm.cpp | 282 +++++++++++++++++++++------------------- tests/test_router_mandatory.cpp | 229 ++++++++++++++------------------ tests/testutil_unity.hpp | 87 +++++++++++++ 5 files changed, 342 insertions(+), 268 deletions(-) commit c9437ab755fc4f6962751e10da15ab1607ec2c36 Merge: d2293da 79d9f2b Author: Luca Boccassi Date: Mon Mar 12 15:41:10 2018 +0000 Merge pull request #2986 from wittmeie/ws/fix-for-windows-imported-target Missing IMPORTED_LOCATION_property for shared-library import-targets (see zeromq/libzmq#2985) commit d2293da6e5a3719e9db27ce283055f09ca7af8e6 Merge: 9c748f1 c7876c0 Author: Luca Boccassi Date: Mon Mar 12 14:00:39 2018 +0000 Merge pull request #2983 from tonytheodore/master Fixes for mingw cross-compilation commit 79d9f2ba1e0903f4c34b71409fb13bef04b1a7d8 Author: Steffen Wittmeier Date: Mon Mar 12 13:38:46 2018 +0100 Fixes missing IMPORTED_LOCATION in import-target CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) commit c7876c097fe493572d67f00d5326bc0bcb31d928 Author: Tony Theodore Date: Mon Mar 12 20:20:02 2018 +1100 Problem: mingw static/shared builds have different preprocessor defines Solution: remove objects optimisation in library build (similar to #2860) and set PUBLIC compile definitions on all static builds instead of MSVC only. CMakeLists.txt | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) commit 9c748f1bf1c039dd1f13927f5df3c8c16e3617dc Author: Sergey Kachanovskiy Date: Mon Mar 12 11:55:58 2018 +0100 Partial fix for issue 2963, removed invalid casts from fd_t to int (#2984) * Fixes issue 2963, ref stream_engine.cpp:981 * Fixes issue 2963, ref socks_connecter.cpp:158 * Fixes issue 2963, ref tcp_listener.cpp:144 * Fixes issue 2963, ref tcp_connecter.cpp:423 * Fixes issue 2963, ref socks_connecter.cpp:436 * Fixes issue 2963, ref tcp_listener.cpp:179 * Fixes issue 2963, ref tcp_listener.cpp:268 * Fixes issue 2963, ref tcp_connecter.cpp:160 src/socks_connecter.cpp | 4 ++-- src/stream_engine.cpp | 2 +- src/tcp_connecter.cpp | 4 ++-- src/tcp_listener.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) commit 794d7a3143e80ca102a5a7b7dedd3ba7a09d0c34 Author: Tony Theodore Date: Mon Mar 12 20:19:27 2018 +1100 Problem: certain windows header files are actually lowercase Solution: change case of `WinSock2.h Iphlpapi.h Rpc.h` to match the files on disk. This is only noticeable when cross-compiling from a case-sensitive system so wouldn't get picked up in MSVC or mingw builds running on a windows machine. MSDN uses capitalised versions in prose and lowercase in code examples: https://msdn.microsoft.com/en-us/library/windows/desktop/ms737629(v=vs.85).aspx Fixes #2978, the missing library message is a little misleading. CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 7bce4ffbc752db659779edc13a1afcca21d22c78 Merge: 4726f72 8d544ef Author: Constantin Rack Date: Sun Mar 11 19:07:23 2018 +0100 Merge pull request #2982 from bluca/formattweetnacl Problem: formatting issues in CI commit 8d544ef1c4861478d022ba3dbd2299232fd1e2a4 Author: Luca Boccassi Date: Sat Mar 10 12:44:27 2018 +0000 Problem: formatting issues in the CI Solution: commit clang-format-diff src/ip.cpp | 6 +++--- src/options.cpp | 8 ++++---- src/socket_base.cpp | 8 ++++---- src/socks_connecter.cpp | 2 +- src/tcp_connecter.cpp | 6 +++--- src/tweetnacl.c | 10 ++++++---- src/ypipe.hpp | 6 +++--- src/ypipe_conflate.hpp | 6 +++--- src/zmq.cpp | 2 +- 9 files changed, 28 insertions(+), 26 deletions(-) commit fef99d6c50d9157e3bb871da68f96e2d939ec355 Author: Luca Boccassi Date: Sat Mar 10 12:43:34 2018 +0000 Problem: tweetnacl is external code and clang-format parses it Solution: add pragma to make clang-format ignore the external code src/tweetnacl.c | 3 +++ 1 file changed, 3 insertions(+) commit 4726f7262d076ed0b20111cfcdc0df6b33cf7c82 Author: Manuel Segura Date: Sat Mar 10 03:03:02 2018 -0800 Pull request to merge porting to WindRiver VxWorks 6.x (#2966) * Problem: Still need to port over more files to VxWorks 6.x Solution: Port more files to VxWorks 6.x * Problem: Need to port over remaining files to VxWorks 6.x. Also remove POSIX thread dependency for VxWorks (because of priority inversion problem in POSIX mutexes with VxWorks 6.x processes) Solution: Port over remaining files to VxWorks 6.x. Also removed POSIX thread dependency for VxWorks * Problem: Needed to modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x. Solution: Modify TCP, UDP, TIPC classes with #ifdefs to be compatible with VxWorks 6.x builds/vxworks/platform.hpp | 306 ++++++++++++++++++++++++++++++++++++++++++++ src/address.cpp | 6 +- src/address.hpp | 7 +- src/atomic_ptr.hpp | 4 + src/clock.cpp | 9 +- src/condition_variable.hpp | 84 ++++++++++++ src/ip.cpp | 71 ++++++++-- src/ipc_address.cpp | 3 +- src/ipc_address.hpp | 3 +- src/ipc_connecter.cpp | 4 +- src/ipc_connecter.hpp | 3 +- src/ipc_listener.cpp | 6 +- src/ipc_listener.hpp | 3 +- src/mutex.hpp | 39 ++++++ src/options.cpp | 8 +- src/select.cpp | 4 + src/session_base.cpp | 3 +- src/signaler.cpp | 39 ++++++ src/socket_base.cpp | 17 ++- src/socket_poller.cpp | 6 + src/socket_poller.hpp | 4 + src/socks_connecter.cpp | 15 ++- src/tcp.cpp | 9 +- src/tcp_address.cpp | 14 +- src/tcp_connecter.cpp | 23 +++- src/tcp_listener.cpp | 14 +- src/thread.cpp | 62 +++++++++ src/thread.hpp | 22 +++- src/tipc_address.hpp | 4 + src/tipc_connecter.cpp | 14 +- src/tipc_listener.cpp | 21 +++ src/udp_engine.cpp | 20 +++ src/ypipe.hpp | 6 +- src/ypipe_conflate.hpp | 6 +- src/zmq.cpp | 10 +- 35 files changed, 809 insertions(+), 60 deletions(-) commit 0d23b5ca695fbd9899190bc404c42386a919058e Merge: 1906034 90342e0 Author: Simon Giesecke Date: Fri Mar 9 22:45:16 2018 +0100 Merge pull request #2980 from kachanovskiy/master Fixed issue #2979 commit 90342e0d29c17a3029d538f8c909fa4d8c003dc4 Author: Kachanovskiy Date: Fri Mar 9 22:24:23 2018 +0100 Fixed issue #2979 src/mtrie.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 19060345e4eb9e1e9410d8567364f25c94696689 Author: Luca Boccassi Date: Fri Mar 9 16:47:42 2018 +0000 Problem: TIPC availability check is too strict (#2977) * Problem: TIPC availability check is too strict Solution: at build time only check if the API is available. In the tests do a first check and a skip if the functionality is not available. TIPC needs an in-tree but not loaded by default kernel module, tipc.ko to be loaded, which requires root, so it is unlikely to be available on any build system by default. This will allow most distributions to ship with TIPC support built in, and to avoid tests failure if the module is not there. * Problem: no Travis tests for TIPC Solution: mark one job with sudo: required and load the kernel module * Problem: CMake fails when test returns 77 (skip) Solution: set property to let it mark the test as skipped as intended .travis.yml | 3 ++- builds/cmake/Modules/ZMQSourceRunChecks.cmake | 7 ------- ci_build.sh | 4 ++++ configure.ac | 7 ------- tests/CMakeLists.txt | 1 + tests/test_address_tipc.cpp | 5 +++++ tests/test_connect_delay_tipc.cpp | 5 +++++ tests/test_pair_tipc.cpp | 5 +++++ tests/test_reqrep_device_tipc.cpp | 5 +++++ tests/test_reqrep_tipc.cpp | 5 +++++ tests/test_router_mandatory_tipc.cpp | 5 +++++ tests/test_shutdown_stress_tipc.cpp | 5 +++++ tests/test_sub_forward_tipc.cpp | 5 +++++ tests/test_term_endpoint_tipc.cpp | 5 +++++ tests/testutil.hpp | 23 +++++++++++++++++++++++ 15 files changed, 75 insertions(+), 15 deletions(-) commit 7abb8388d61204502334396c1b309304144f5dfa Author: Pontus.Skoeldstroem Date: Wed Mar 7 18:31:26 2018 +0100 Problem: Tests for different TIPC address types missing (#2956) * Tests for different TIPC address types and code cleanup * Adds tests for binding/connecting with different TIPC address types using Unity * Adds error checking for address type misuse Makefile.am | 7 ++- src/socket_base.cpp | 9 +++ src/tipc_address.cpp | 85 +++++++++++++-------------- src/tipc_listener.cpp | 17 ++++-- tests/CMakeLists.txt | 1 + tests/test_address_tipc.cpp | 140 ++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 208 insertions(+), 51 deletions(-) commit 40c6c1a7c9cd47a68ede3a90dc3260804bf470e5 Merge: 0c6c935 cef9cfa Author: Luca Boccassi Date: Wed Mar 7 15:18:16 2018 +0000 Merge pull request #2976 from zeromq/revert-2974-static_init_gcc Revert "Problem: mis-detection of threadsafe_static_init causes test failures" commit cef9cfa0917f029826843cfe85657714ccec67ee Author: Simon Giesecke Date: Wed Mar 7 15:03:07 2018 +0100 Revert "Problem: mis-detection of threadsafe_static_init causes test failures" src/random.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) commit 0c6c935726b4b66ddf78616f4258c46fcaf11913 Merge: 677efea 9bd2d3f Author: Constantin Rack Date: Wed Mar 7 07:51:38 2018 +0100 Merge pull request #2974 from bluca/static_init_gcc Problem: mis-detection of threadsafe_static_init causes test failures commit 9bd2d3f9374edc0dec11c08dd663a0879b370e20 Author: Luca Boccassi Date: Tue Mar 6 23:10:15 2018 +0000 Problem: mis-detection of threadsafe_static_init causes test failures Solution: do not rely __cplusplus >= 201103L to detect whether the compiler supports thread safe static initialisation, but check only the proper feature preprocessor macro. GCC introduced it in version 8, and Clang in version 6. src/random.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) commit 677efea238cc2c73e024ed231ccffe0d4b52c47d Merge: ec58ba0 e0b1992 Author: Constantin Rack Date: Tue Mar 6 22:55:07 2018 +0100 Merge pull request #2973 from bluca/deb7 Problem: build broken with gcc-4.7 commit e0b1992dd7a3501ef9234034f8bded58eae0dd53 Author: Luca Boccassi Date: Tue Mar 6 20:27:16 2018 +0000 Problem: build broken with gcc-4.7 Solution: initialise variable in options.cpp to dummy value to fix compiler complaint: src/options.cpp: In function 'int zmq::do_setsockopt_int_as_bool_strict(const void*, size_t, bool*)': src/options.cpp:121:5: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] src/options.cpp: In function 'int zmq::do_setsockopt_int_as_bool_relaxed(const void*, size_t, bool*)': src/options.cpp:135:31: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized] src/options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit ec58ba04f32e24c897be7e6d4a33a9ad34157009 Merge: 10d2b28 6f967c3 Author: Luca Boccassi Date: Tue Mar 6 20:08:46 2018 +0000 Merge pull request #2972 from sigiesec/reduce-sockopt-code-duplication Problem: code duplication in getsockopt/setsockopt commit 6f967c3a13a1e02359768e9b6e8cc7a6f7debf8e Author: Simon Giesecke Date: Tue Mar 6 11:16:22 2018 +0100 Problem: code duplication in getsockopt/setsockopt Solution: extracted common code into do_getsockopt/do_setsockopt functions src/options.cpp | 412 +++++++++++++++++++++++++++------------------------- src/options.hpp | 31 ++++ src/router.cpp | 2 + src/socket_base.cpp | 57 ++------ src/stream.cpp | 13 +- src/sub.cpp | 5 +- 6 files changed, 264 insertions(+), 256 deletions(-) commit 10d2b2885e239730c14bc8d5bfeb5e48486aebe4 Merge: 494c2a7 8cdfc8b Author: Luca Boccassi Date: Tue Mar 6 09:18:52 2018 +0000 Merge pull request #2971 from ZMQers/fix-static-init Problem: static initialization order fiasco commit 494c2a71f8066adfeb4860311eca5cbe2aa4effb Merge: 4ea1e78 c36d8cb Author: Constantin Rack Date: Tue Mar 6 00:18:17 2018 +0100 Merge pull request #2970 from bluca/format Problem: CI check for format fails commit c36d8cb8e42ce8e95d46384bb48184d717b588a0 Author: Luca Boccassi Date: Mon Mar 5 22:45:00 2018 +0000 Problem: PR template does not mention clang-format Solution: add paragraph explaining how to run it to make sure code is correctly formatted. .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++++ 1 file changed, 8 insertions(+) commit 541ca30d8e6b0e94cc420d4220187b048ca91f99 Author: Luca Boccassi Date: Mon Mar 5 22:41:11 2018 +0000 Problem: make clang-format still shows error in the CI Solution: run make clang-format-diff and commit the changes. src/generic_mtrie_impl.hpp | 2 +- src/ip.cpp | 6 +++--- src/socket_base.cpp | 8 ++++---- src/tcp_connecter.cpp | 4 ++-- src/zmq.cpp | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) commit 4ea1e78d9d06255db275723bd71501eff6d265ca Merge: 3658b2b fcbd2a5 Author: Luca Boccassi Date: Mon Mar 5 17:40:33 2018 +0000 Merge pull request #2969 from skaes/master Problem: enormous memory increase due to zero copy decoding commit fcbd2a5710b317e81a544b07b3091d1de923bbb4 Author: Stefan Kaes Date: Mon Mar 5 13:19:20 2018 +0100 Problem: enormous memory increase due to zero copy decoding The zero copy decoding strategy implemented for 4.2.0 can lead to a large increase of main memory usage in some cases (I have seen one program go up to 40G from 10G after upgrading from 4.1.4). This commit adds a new option to contexts, called ZMQ_ZERO_COPY_RECV, which allows one to switch to the old decoding strategy. doc/zmq_ctx_get.txt | 6 ++++++ doc/zmq_ctx_set.txt | 12 +++++++++++ include/zmq.h | 1 + src/ctx.cpp | 10 +++++++-- src/ctx.hpp | 3 +++ src/norm_engine.cpp | 10 +++++---- src/norm_engine.hpp | 5 ++++- src/options.cpp | 3 ++- src/options.hpp | 3 +++ src/socket_base.cpp | 1 + src/stream_engine.cpp | 8 ++++---- src/v2_decoder.cpp | 10 ++++++--- src/v2_decoder.hpp | 3 ++- src/zmq_draft.h | 1 + tests/test_ctx_options.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++ tests/testutil.hpp | 2 +- 16 files changed, 112 insertions(+), 17 deletions(-) commit 3658b2b580c9e8b84058df11cdc1bfd68a5eec14 Author: Ryan Hileman Date: Mon Mar 5 08:36:10 2018 -0800 Problem: pthread condvar timeouts are broken (#2967) * fix pthread condvar timeouts This fixes a race condition / hang for threadsafe sockets. Context: https://github.com/zeromq/czmq/issues/1873#issuecomment-370279244 src/condition_variable.hpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) commit 8cdfc8b9dd9a4b51b053584d86c0597577c288c0 Author: Simon Giesecke Date: Mon Mar 5 15:29:36 2018 +0100 Problem: static initialization order fiasco Solution: use local statics when available in a thread-safe implementation src/random.cpp | 77 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 21 deletions(-) commit d54633add13e359d5c0f3d565b8e664ca69a5b76 Merge: 173b54a 23025f4 Author: Luca Boccassi Date: Fri Mar 2 19:06:51 2018 +0000 Merge pull request #2964 from bluca/fix_mtrie_32bit Problem: unittest_mtrie fails on 32bit *nix commit 23025f44c60a0e74d23784d61204647b52a4a57e Author: Luca Boccassi Date: Fri Mar 2 18:00:17 2018 +0000 Problem: unittest_mtrie fails on 32bit *nix Solution: correctly dereference pointer in test. unittests/unittest_mtrie.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 173b54a8c930f606c0f01b0830f911099e5840a7 Merge: 31387f8 9cd01bb Author: Luca Boccassi Date: Fri Mar 2 17:41:06 2018 +0000 Merge pull request #2950 from zeromq/add-unittests-mtrie Problem: no unit tests for mtrie commit 9cd01bb54fa450445806360075c441a826f7f4a9 Author: Simon Giesecke Date: Fri Mar 2 11:23:46 2018 +0100 Problem: inconsistent return values from mtrie_t::rm Solution: Return an enum from rm instead of a bool, and adapt existing uses src/generic_mtrie.hpp | 22 +++++++++++++--------- src/generic_mtrie_impl.hpp | 38 +++++++++++++++----------------------- src/xpub.cpp | 29 +++++++++++++++++------------ unittests/unittest_mtrie.cpp | 37 ++++++++++++++++++------------------- 4 files changed, 63 insertions(+), 63 deletions(-) commit 36cdcc6c1a0cb76658b907a272004396e61ad95c Author: Simon Giesecke Date: Wed Feb 28 15:04:34 2018 +0100 Problem: docs of mtrie referring to subscriptions and pipes Solution: generalized terms to entries/values src/generic_mtrie.hpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) commit e34e03d1a6f25ad2ae6dc08417e10269b07fb0f9 Author: Simon Giesecke Date: Wed Feb 28 14:52:26 2018 +0100 Problem: missing test case for addition of duplicate entry Solution: added test case unittests/unittest_mtrie.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) commit d57422819aabc1ca7cbfcc64bc1b84292ce81994 Author: Luca Boccassi Date: Sun Feb 25 20:29:20 2018 +0000 Problem: documentation for ZMQ_XPUB_VERBOSE(R) is unclear Solultion: clarify that notifications for unique subs/unsubs are always passed, and these option only affect the behaviour for duplicated ones. NEWS | 3 +++ doc/zmq_setsockopt.txt | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) commit 354491ddf2ca4d7623f887371b6d4ed250e08b4b Author: Luca Boccassi Date: Sun Feb 25 20:20:44 2018 +0000 Problem: no test for ZMQ_XPUB_VERBOSE(R) Solution: add test_xpub_verbose to cover those APIs Makefile.am | 5 + tests/CMakeLists.txt | 1 + tests/test_xpub_verbose.cpp | 499 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 505 insertions(+) commit 5d5def40b5add44cc835523475a2fc1845f957d3 Author: Simon Giesecke Date: Wed Feb 21 12:06:23 2018 +0100 Problem: casts required due to void* arguments in a C++ class Solution: introduce a type template argument src/generic_mtrie.hpp | 20 +++++++++++--------- src/generic_mtrie_impl.hpp | 17 ++++++++++------- src/xpub.cpp | 26 ++++++++++++-------------- src/xpub.hpp | 4 ++-- unittests/unittest_mtrie.cpp | 20 +++++++++----------- 5 files changed, 44 insertions(+), 43 deletions(-) commit 15b4f596a815f0e02bc6ad0e2babbef005e875e3 Author: Simon Giesecke Date: Wed Feb 21 11:31:56 2018 +0100 Problem: insufficient unit tests for mtrie Solution: added further test cases unittests/unittest_mtrie.cpp | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) commit 5fb0e97ab71a49170c04877debc6cf48db9d3110 Author: Simon Giesecke Date: Wed Feb 21 11:31:00 2018 +0100 Problem: semantic issues Solution: added some TODO comments, improved existing documentation src/generic_mtrie.hpp | 13 +++++++++---- src/generic_mtrie_impl.hpp | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) commit 8bb055ece81bae3cce5094cc52be281a7708fe18 Author: Simon Giesecke Date: Tue Feb 20 17:39:06 2018 +0100 Problem: insufficient unit tests for mtrie Solution: added test case, reduced code duplication in tests unittests/unittest_mtrie.cpp | 91 ++++++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 29 deletions(-) commit 0e34d13063d0f57aaff6bceb876fdf32fec23420 Author: Simon Giesecke Date: Sun Feb 18 19:18:57 2018 +0100 Problem: insufficient unit tests for mtrie Solution: added unit test and assertions unittests/unittest_mtrie.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) commit 506f0e5c445fe0a3e191b29a2dc858d363d016ec Author: Simon Giesecke Date: Sun Feb 18 18:59:30 2018 +0100 Problem: insufficient unit tests for mtrie Solution: add test case unittests/unittest_mtrie.cpp | 50 +++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 15 deletions(-) commit 56d806a9efaf58ca6aa04f528ae15029bd6c1f87 Author: Simon Giesecke Date: Sun Feb 18 18:33:38 2018 +0100 Problem: infufficient unit tests for mtrie Solution: added some test cases for rm unittests/unittest_mtrie.cpp | 124 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) commit b42a59a839bf2528d538eda78158f0da787755e7 Author: Simon Giesecke Date: Fri Feb 16 13:21:50 2018 +0100 Problem: insufficient unit tests for mtrie Solution: added test case unittests/unittest_mtrie.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) commit 96fb17cb55eb40e52664529f2639f5bf4afcd865 Author: Simon Giesecke Date: Fri Feb 16 12:43:02 2018 +0100 Problem: unittests not recognized by code coverage measurement Solution: add CODE_COVERAGE_*FLAGS to unit tests build Fixes #2949 .clang-format | 53 + .github/PULL_REQUEST_TEMPLATE.md | 28 + .github/issue_template.md | 22 + .gitignore | 180 ++ .hgeol | 2 + .mailmap | 81 + .travis.yml | 129 ++ AUTHORS | 151 ++ CMakeLists.txt | 1282 +++++++++++ COPYING | 674 ++++++ COPYING.LESSER | 181 ++ Dockerfile | 11 + Doxygen.cfg | 2320 ++++++++++++++++++++ INSTALL | 311 +++ Jenkinsfile | 485 ++++ Makefile.am | 1005 +++++++++ NEWS | 1585 +++++++++++++ README.cygwin.md | 15 + README.doxygen.md | 48 + README.md | 102 + RELICENSE/AndreLouisCaron.md | 15 + RELICENSE/Asmod4n.md | 13 + RELICENSE/BerndPrager.md | 13 + RELICENSE/Bklyn.md | 15 + RELICENSE/BrianBuchanan.md | 15 + RELICENSE/ChuckRemes.md | 15 + RELICENSE/FrancoFichtner.md | 15 + RELICENSE/GavinMcNiff.md | 15 + RELICENSE/GhislainPutois.md | 15 + RELICENSE/GiuseppeCorbelli.md | 15 + RELICENSE/HaraldAchitz.md | 17 + RELICENSE/Hugne.md | 17 + RELICENSE/JimHague.md | 16 + RELICENSE/JohanMabille.md | 16 + RELICENSE/LeonardMichelet | 14 + RELICENSE/LeonardoConsoni.md | 15 + RELICENSE/LionelOrry.md | 15 + RELICENSE/OsirisPedroso.md | 15 + RELICENSE/README.md | 23 + RELICENSE/RobGagnon.md | 13 + RELICENSE/SebastienRombauts.md | 15 + RELICENSE/StoianIvanov.md | 15 + RELICENSE/SylvainCorlay.md | 16 + RELICENSE/TimotheeBesset.md | 15 + RELICENSE/VincentTellier.md | 15 + RELICENSE/VolodymyrKorniichuk.md | 15 + RELICENSE/abbradar.md | 16 + RELICENSE/agronholm.md | 15 + RELICENSE/amuraru.md | 15 + RELICENSE/arsenm.md | 15 + RELICENSE/aseering.md | 15 + RELICENSE/bjorntopel.md | 16 + RELICENSE/bjovke.md | 16 + RELICENSE/brocade_communications_systems.md | 15 + RELICENSE/brunobodin.md | 13 + RELICENSE/c-rack.md | 15 + RELICENSE/camachat.md | 15 + RELICENSE/cdolan.md | 15 + RELICENSE/chrisstaite.md | 14 + RELICENSE/chugga_fan.md | 15 + RELICENSE/cjuniet.md | 15 + RELICENSE/ckamm.md | 15 + RELICENSE/clkao.md | 15 + RELICENSE/danielhtshih.md | 15 + RELICENSE/danriegsecker.md | 16 + RELICENSE/dfons.md | 16 + RELICENSE/djelenc.md | 15 + RELICENSE/drodri.md | 15 + RELICENSE/eburkitt.md | 15 + RELICENSE/egomotion.md | 16 + RELICENSE/evoskuil.md | 15 + RELICENSE/febeling.md | 16 + RELICENSE/fidlej.md | 15 + RELICENSE/flub.md | 14 + RELICENSE/gena-moscow.md | 15 + RELICENSE/gonzus.md | 15 + RELICENSE/goodfella_ltd.md | 13 + RELICENSE/google.md | 13 + RELICENSE/ianbarber.md | 15 + RELICENSE/imatix.md | 23 + RELICENSE/jakecobb.md | 13 + RELICENSE/jemc.md | 15 + RELICENSE/jimklimov.md | 17 + RELICENSE/jkryl.md | 15 + RELICENSE/johntconklin.md | 15 + RELICENSE/jruffin.md | 14 + RELICENSE/kentzo.md | 15 + RELICENSE/kevinsapper.md | 13 + RELICENSE/kobolog.md | 12 + RELICENSE/kurdybacha.md | 15 + RELICENSE/linville.md | 15 + RELICENSE/loachfish.md | 15 + RELICENSE/lodagro.md | 15 + RELICENSE/madebr.md | 15 + RELICENSE/mattconnolly.md | 15 + RELICENSE/mauri-melato.md | 13 + RELICENSE/mditzel.md | 15 + RELICENSE/meox.md | 15 + RELICENSE/michael-fox.md | 16 + RELICENSE/michicc.md | 15 + RELICENSE/minrk.md | 15 + RELICENSE/mipaaa.md | 15 + RELICENSE/mkluwe.md | 15 + RELICENSE/montoyaedu.md | 15 + RELICENSE/naos_ltd.md | 19 + RELICENSE/natano.md | 15 + RELICENSE/olafmandel.md | 13 + RELICENSE/pijyoi.md | 13 + RELICENSE/ptroja.md | 14 + RELICENSE/reunanen.md | 15 + RELICENSE/reza-ebrahimi.md | 15 + RELICENSE/rikvdh.md | 15 + RELICENSE/rlenferink.md | 15 + RELICENSE/roalz.md | 13 + RELICENSE/rodgert.md | 17 + RELICENSE/rotty.md | 16 + RELICENSE/sabae.md | 15 + RELICENSE/scemama.md | 15 + RELICENSE/sheremetyev.md | 13 + RELICENSE/shripchenko.md | 15 + RELICENSE/sigiesec.md | 17 + RELICENSE/soulik.md | 15 + RELICENSE/swansontec.md | 15 + RELICENSE/t-b.md | 15 + RELICENSE/tSed.md | 15 + RELICENSE/tabe.md | 15 + RELICENSE/tailhook.md | 16 + RELICENSE/taotetek.md | 13 + .../templates/relicense-template-mplv2-any-osi.txt | 15 + .../relicense-template-mplv2-share-alike-osi.txt | 15 + RELICENSE/templates/relicense-template-mplv2.txt | 13 + RELICENSE/thompsa.md | 15 + RELICENSE/torehalvorsen.md | 15 + RELICENSE/twhittock.md | 15 + RELICENSE/ulikoehler.md | 16 + RELICENSE/vyskocilm.md | 7 + RELICENSE/willstrang.md | 15 + RELICENSE/xaqq.md | 13 + RELICENSE/yuvallanger.md | 15 + acinclude.m4 | 1122 ++++++++++ appveyor.yml | 106 + autogen.sh | 49 + branding.bmp | Bin 0 -> 25818 bytes builds/Makefile.am | 29 + builds/README | 4 + builds/android/Dockerfile | 22 + builds/android/README.md | 78 + builds/android/android_build_helper.sh | 316 +++ builds/android/build.sh | 70 + builds/android/ci_build.sh | 30 + builds/cmake/Modules/ClangFormat.cmake | 41 + builds/cmake/Modules/FindAsciiDoc.cmake | 26 + builds/cmake/Modules/FindSodium.cmake | 40 + builds/cmake/Modules/TestZMQVersion.cmake | 8 + builds/cmake/Modules/ZMQSourceRunChecks.cmake | 301 +++ builds/cmake/NSIS.template32.in | 952 ++++++++ builds/cmake/NSIS.template64.in | 960 ++++++++ builds/cmake/ZeroMQConfig.cmake.in | 25 + builds/cmake/ci_build.sh | 49 + builds/cmake/clang-format-check.sh.in | 14 + builds/cmake/platform.hpp.in | 104 + builds/coverage/ci_build.sh | 32 + builds/cygwin/Makefile.cygwin | 48 + builds/gyp/.gitignore | 5 + builds/gyp/build.bat | 4 + builds/gyp/platform.hpp | 80 + builds/gyp/project-tests.gsl | 19 + builds/gyp/project-tests.gypi | 895 ++++++++ builds/gyp/project-tests.xml | 83 + builds/gyp/project.gyp | 295 +++ builds/mingw32/Makefile.mingw32 | 49 + builds/mingw32/platform.hpp | 43 + builds/msvc/.gitignore | 256 +++ builds/msvc/Makefile.am | 94 + builds/msvc/build/build.bat | 33 + builds/msvc/build/buildall.bat | 16 + builds/msvc/build/buildbase.bat | 73 + builds/msvc/errno.cpp | 32 + builds/msvc/errno.hpp | 56 + builds/msvc/platform.hpp | 14 + builds/msvc/properties/Common.props | 21 + builds/msvc/properties/DLL.props | 16 + builds/msvc/properties/Debug.props | 29 + builds/msvc/properties/DebugDEXE.props | 21 + builds/msvc/properties/DebugDLL.props | 20 + builds/msvc/properties/DebugLEXE.props | 20 + builds/msvc/properties/DebugLIB.props | 21 + builds/msvc/properties/DebugLTCG.props | 20 + builds/msvc/properties/DebugSEXE.props | 21 + builds/msvc/properties/EXE.props | 17 + builds/msvc/properties/LIB.props | 16 + builds/msvc/properties/LTCG.props | 13 + builds/msvc/properties/Link.props | 21 + builds/msvc/properties/Messages.props | 15 + builds/msvc/properties/Output.props | 30 + builds/msvc/properties/Release.props | 41 + builds/msvc/properties/ReleaseDEXE.props | 20 + builds/msvc/properties/ReleaseDLL.props | 19 + builds/msvc/properties/ReleaseLEXE.props | 20 + builds/msvc/properties/ReleaseLIB.props | 19 + builds/msvc/properties/ReleaseLTCG.props | 19 + builds/msvc/properties/ReleaseSEXE.props | 20 + builds/msvc/properties/Win32.props | 20 + builds/msvc/properties/x64.props | 23 + builds/msvc/readme.txt | 27 + builds/msvc/resource.h | 14 + builds/msvc/resource.rc | Bin 0 -> 4650 bytes builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj | 52 + builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj | 52 + builds/msvc/vs2008/libzmq.sln | 95 + builds/msvc/vs2008/libzmq/libzmq.vcproj | 338 +++ builds/msvc/vs2008/local_lat/local_lat.vcproj | 52 + builds/msvc/vs2008/local_thr/local_thr.vcproj | 52 + builds/msvc/vs2008/remote_lat/remote_lat.vcproj | 52 + builds/msvc/vs2008/remote_thr/remote_thr.vcproj | 52 + builds/msvc/vs2010/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2010/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2010/libsodium.import.props | 52 + builds/msvc/vs2010/libsodium.import.xml | 17 + builds/msvc/vs2010/libzmq.import.props | 64 + builds/msvc/vs2010/libzmq.import.xml | 49 + builds/msvc/vs2010/libzmq.sln | 206 ++ builds/msvc/vs2010/libzmq/libzmq.props | 76 + builds/msvc/vs2010/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2010/libzmq/libzmq.xml | 40 + builds/msvc/vs2010/local_lat/local_lat.props | 49 + builds/msvc/vs2010/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2010/local_thr/local_thr.props | 49 + builds/msvc/vs2010/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2010/remote_lat/remote_lat.props | 49 + builds/msvc/vs2010/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2010/remote_thr/remote_thr.props | 49 + builds/msvc/vs2010/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2012/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2012/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2012/libsodium.import.props | 52 + builds/msvc/vs2012/libsodium.import.xml | 17 + builds/msvc/vs2012/libzmq.import.props | 64 + builds/msvc/vs2012/libzmq.import.xml | 49 + builds/msvc/vs2012/libzmq.sln | 206 ++ builds/msvc/vs2012/libzmq/libzmq.props | 76 + builds/msvc/vs2012/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2012/libzmq/libzmq.xml | 40 + builds/msvc/vs2012/local_lat/local_lat.props | 49 + builds/msvc/vs2012/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2012/local_thr/local_thr.props | 49 + builds/msvc/vs2012/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2012/remote_lat/remote_lat.props | 49 + builds/msvc/vs2012/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2012/remote_thr/remote_thr.props | 49 + builds/msvc/vs2012/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2013/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2013/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2013/libsodium.import.props | 52 + builds/msvc/vs2013/libsodium.import.xml | 17 + builds/msvc/vs2013/libzmq.import.props | 64 + builds/msvc/vs2013/libzmq.import.xml | 49 + builds/msvc/vs2013/libzmq.sln | 208 ++ builds/msvc/vs2013/libzmq/libzmq.props | 76 + builds/msvc/vs2013/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2013/libzmq/libzmq.xml | 40 + builds/msvc/vs2013/local_lat/local_lat.props | 49 + builds/msvc/vs2013/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2013/local_thr/local_thr.props | 49 + builds/msvc/vs2013/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2013/remote_lat/remote_lat.props | 49 + builds/msvc/vs2013/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2013/remote_thr/remote_thr.props | 49 + builds/msvc/vs2013/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2015/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2015/libsodium.import.props | 52 + builds/msvc/vs2015/libsodium.import.xml | 17 + builds/msvc/vs2015/libzmq.import.props | 64 + builds/msvc/vs2015/libzmq.import.xml | 49 + builds/msvc/vs2015/libzmq.sln | 208 ++ builds/msvc/vs2015/libzmq/libzmq.props | 76 + builds/msvc/vs2015/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2015/libzmq/libzmq.xml | 40 + builds/msvc/vs2015/local_lat/local_lat.props | 49 + builds/msvc/vs2015/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2015/local_thr/local_thr.props | 49 + builds/msvc/vs2015/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2015/remote_lat/remote_lat.props | 49 + builds/msvc/vs2015/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2015/remote_thr/remote_thr.props | 49 + builds/msvc/vs2015/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015_xp/libzmq.vcxproj | 258 +++ builds/msvc/vs2015_xp/platform.hpp | 15 + .../msvc/vs2015_xp/test_zmq/test_multithread.cpp | 229 ++ builds/msvc/vs2015_xp/test_zmq/test_zmq.vcxproj | 155 ++ builds/msvc/vs2017/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2017/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2017/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2017/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2017/libsodium.import.props | 52 + builds/msvc/vs2017/libsodium.import.xml | 17 + builds/msvc/vs2017/libzmq.import.props | 64 + builds/msvc/vs2017/libzmq.import.xml | 49 + builds/msvc/vs2017/libzmq.sln | 208 ++ builds/msvc/vs2017/libzmq/libzmq.props | 76 + builds/msvc/vs2017/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2017/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2017/libzmq/libzmq.xml | 40 + builds/msvc/vs2017/local_lat/local_lat.props | 49 + builds/msvc/vs2017/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2017/local_thr/local_thr.props | 49 + builds/msvc/vs2017/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2017/remote_lat/remote_lat.props | 49 + builds/msvc/vs2017/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2017/remote_thr/remote_thr.props | 49 + builds/msvc/vs2017/remote_thr/remote_thr.vcxproj | 82 + builds/nuget/libzmq.autopkg | 52 + builds/nuget/readme.nuget | 20 + builds/openwrt/Makefile | 70 + builds/valgrind/ci_build.sh | 30 + builds/valgrind/valgrind.supp | 22 + builds/valgrind/vg | 1 + builds/zos/README.md | 463 ++++ builds/zos/cxxall | 62 + builds/zos/makeclean | 36 + builds/zos/makelibzmq | 54 + builds/zos/maketests | 102 + builds/zos/platform.hpp | 300 +++ builds/zos/runtests | 188 ++ builds/zos/test_fork.cpp | 95 + builds/zos/zc++ | 42 + ci_build.sh | 70 + ci_deploy.sh | 34 + configure.ac | 844 +++++++ doc/Makefile.am | 64 + doc/asciidoc.conf | 56 + doc/zmq.txt | 276 +++ doc/zmq_atomic_counter_dec.txt | 62 + doc/zmq_atomic_counter_destroy.txt | 62 + doc/zmq_atomic_counter_inc.txt | 61 + doc/zmq_atomic_counter_new.txt | 62 + doc/zmq_atomic_counter_set.txt | 61 + doc/zmq_atomic_counter_value.txt | 62 + doc/zmq_bind.txt | 103 + doc/zmq_close.txt | 56 + doc/zmq_connect.txt | 101 + doc/zmq_ctx_destroy.txt | 67 + doc/zmq_ctx_get.txt | 105 + doc/zmq_ctx_new.txt | 50 + doc/zmq_ctx_set.txt | 184 ++ doc/zmq_ctx_shutdown.txt | 52 + doc/zmq_ctx_term.txt | 68 + doc/zmq_curve.txt | 92 + doc/zmq_curve_keypair.txt | 56 + doc/zmq_curve_public.txt | 62 + doc/zmq_disconnect.txt | 75 + doc/zmq_errno.txt | 50 + doc/zmq_getsockopt.txt | 944 ++++++++ doc/zmq_gssapi.txt | 78 + doc/zmq_has.txt | 44 + doc/zmq_init.txt | 52 + doc/zmq_inproc.txt | 88 + doc/zmq_ipc.txt | 106 + doc/zmq_msg_close.txt | 56 + doc/zmq_msg_copy.txt | 72 + doc/zmq_msg_data.txt | 48 + doc/zmq_msg_get.txt | 83 + doc/zmq_msg_gets.txt | 81 + doc/zmq_msg_init.txt | 64 + doc/zmq_msg_init_data.txt | 89 + doc/zmq_msg_init_size.txt | 58 + doc/zmq_msg_more.txt | 65 + doc/zmq_msg_move.txt | 52 + doc/zmq_msg_recv.txt | 124 ++ doc/zmq_msg_routing_id.txt | 61 + doc/zmq_msg_send.txt | 127 ++ doc/zmq_msg_set.txt | 46 + doc/zmq_msg_set_routing_id.txt | 46 + doc/zmq_msg_size.txt | 48 + doc/zmq_null.txt | 27 + doc/zmq_pgm.txt | 164 ++ doc/zmq_plain.txt | 37 + doc/zmq_poll.txt | 135 ++ doc/zmq_proxy.txt | 99 + doc/zmq_proxy_steerable.txt | 111 + doc/zmq_recv.txt | 91 + doc/zmq_recvmsg.txt | 121 + doc/zmq_send.txt | 104 + doc/zmq_send_const.txt | 103 + doc/zmq_sendmsg.txt | 121 + doc/zmq_setsockopt.txt | 1318 +++++++++++ doc/zmq_socket.txt | 609 +++++ doc/zmq_socket_monitor.txt | 294 +++ doc/zmq_strerror.txt | 56 + doc/zmq_tcp.txt | 118 + doc/zmq_term.txt | 66 + doc/zmq_tipc.txt | 83 + doc/zmq_udp.txt | 99 + doc/zmq_unbind.txt | 90 + doc/zmq_version.txt | 54 + doc/zmq_vmci.txt | 97 + doc/zmq_z85_decode.txt | 51 + doc/zmq_z85_encode.txt | 58 + external/unity/license.txt | 21 + external/unity/unity.c | 1570 +++++++++++++ external/unity/unity.h | 503 +++++ external/unity/unity_internals.h | 872 ++++++++ external/unity/version.txt | 1 + include/zmq.h | 732 ++++++ include/zmq_utils.h | 50 + installer.ico | Bin 0 -> 2842 bytes m4/ax_check_compile_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 +++ m4/ax_cxx_compile_stdcxx.m4 | 562 +++++ m4/ax_cxx_compile_stdcxx_11.m4 | 40 + m4/ax_valgrind_check.m4 | 233 ++ packaging/README | 4 + packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 64 + packaging/debian/copyright | 116 + packaging/debian/libzmq3-dev.install | 4 + packaging/debian/libzmq3-dev.manpages | 2 + packaging/debian/libzmq5.docs | 2 + packaging/debian/libzmq5.install | 1 + packaging/debian/rules | 67 + packaging/debian/source/format | 1 + packaging/debian/zeromq.dsc.obs | 15 + packaging/nuget/package.bat | 14 + packaging/nuget/package.config | 6 + packaging/nuget/package.gsl | 264 +++ packaging/nuget/package.nuspec | 98 + packaging/nuget/package.targets | 129 ++ packaging/nuget/package.xml | 22 + packaging/obs/_service | 98 + packaging/redhat/zeromq.spec | 234 ++ perf/inproc_lat.cpp | 238 ++ perf/inproc_thr.cpp | 247 +++ perf/local_lat.cpp | 116 + perf/local_thr.cpp | 161 ++ perf/remote_lat.cpp | 129 ++ perf/remote_thr.cpp | 138 ++ src/address.cpp | 129 ++ src/address.hpp | 81 + src/array.hpp | 135 ++ src/atomic_counter.hpp | 235 ++ src/atomic_ptr.hpp | 301 +++ src/blob.hpp | 186 ++ src/client.cpp | 115 + src/client.hpp | 75 + src/clock.cpp | 258 +++ src/clock.hpp | 79 + src/command.hpp | 204 ++ src/condition_variable.hpp | 250 +++ src/config.hpp | 96 + src/ctx.cpp | 696 ++++++ src/ctx.hpp | 263 +++ src/curve_client.cpp | 290 +++ src/curve_client.hpp | 84 + src/curve_client_tools.hpp | 305 +++ src/curve_mechanism_base.cpp | 179 ++ src/curve_mechanism_base.hpp | 79 + src/curve_server.cpp | 492 +++++ src/curve_server.hpp | 91 + src/dbuffer.hpp | 141 ++ src/dealer.cpp | 145 ++ src/dealer.hpp | 83 + src/decoder.hpp | 193 ++ src/decoder_allocators.cpp | 151 ++ src/decoder_allocators.hpp | 131 ++ src/devpoll.cpp | 203 ++ src/devpoll.hpp | 115 + src/dgram.cpp | 175 ++ src/dgram.hpp | 76 + src/dish.cpp | 368 ++++ src/dish.hpp | 121 + src/dist.cpp | 228 ++ src/dist.hpp | 116 + src/encoder.hpp | 180 ++ src/epoll.cpp | 211 ++ src/epoll.hpp | 105 + src/err.cpp | 467 ++++ src/err.hpp | 173 ++ src/fd.hpp | 61 + src/fq.cpp | 156 ++ src/fq.hpp | 88 + src/gather.cpp | 93 + src/gather.hpp | 68 + src/generic_mtrie.hpp | 104 + src/generic_mtrie_impl.hpp | 450 ++++ src/gssapi_client.cpp | 236 ++ src/gssapi_client.hpp | 92 + src/gssapi_mechanism_base.cpp | 402 ++++ src/gssapi_mechanism_base.hpp | 132 ++ src/gssapi_server.cpp | 248 +++ src/gssapi_server.hpp | 92 + src/i_decoder.hpp | 60 + src/i_encoder.hpp | 57 + src/i_engine.hpp | 65 + src/i_mailbox.hpp | 57 + src/i_poll_events.hpp | 53 + src/io_object.cpp | 116 + src/io_object.hpp | 84 + src/io_thread.cpp | 118 + src/io_thread.hpp | 95 + src/ip.cpp | 611 ++++++ src/ip.hpp | 72 + src/ipc_address.cpp | 107 + src/ipc_address.hpp | 68 + src/ipc_connecter.cpp | 275 +++ src/ipc_connecter.hpp | 135 ++ src/ipc_listener.cpp | 434 ++++ src/ipc_listener.hpp | 118 + src/kqueue.cpp | 230 ++ src/kqueue.hpp | 110 + src/lb.cpp | 165 ++ src/lb.hpp | 84 + src/libzmq.pc.cmake.in | 11 + src/libzmq.pc.in | 11 + src/libzmq.vers | 4 + src/likely.hpp | 42 + src/macros.hpp | 13 + src/mailbox.cpp | 106 + src/mailbox.hpp | 88 + src/mailbox_safe.cpp | 117 + src/mailbox_safe.hpp | 90 + src/mechanism.cpp | 329 +++ src/mechanism.hpp | 144 ++ src/mechanism_base.cpp | 69 + src/mechanism_base.hpp | 54 + src/metadata.cpp | 58 + src/metadata.hpp | 69 + src/msg.cpp | 566 +++++ src/msg.hpp | 273 +++ src/mtrie.cpp | 37 + src/mtrie.hpp | 52 + src/mutex.hpp | 177 ++ src/norm_engine.cpp | 714 ++++++ src/norm_engine.hpp | 185 ++ src/null_mechanism.cpp | 213 ++ src/null_mechanism.hpp | 71 + src/object.cpp | 478 ++++ src/object.hpp | 149 ++ src/options.cpp | 1100 ++++++++++ src/options.hpp | 257 +++ src/own.cpp | 214 ++ src/own.hpp | 149 ++ src/pair.cpp | 141 ++ src/pair.hpp | 73 + src/pgm_receiver.cpp | 304 +++ src/pgm_receiver.hpp | 143 ++ src/pgm_sender.cpp | 251 +++ src/pgm_sender.hpp | 122 + src/pgm_socket.cpp | 687 ++++++ src/pgm_socket.hpp | 128 ++ src/pipe.cpp | 550 +++++ src/pipe.hpp | 258 +++ src/plain_client.cpp | 217 ++ src/plain_client.hpp | 73 + src/plain_server.cpp | 258 +++ src/plain_server.hpp | 67 + src/poll.cpp | 209 ++ src/poll.hpp | 107 + src/poller.hpp | 64 + src/poller_base.cpp | 136 ++ src/poller_base.hpp | 196 ++ src/pollset.cpp | 254 +++ src/pollset.hpp | 117 + src/precompiled.cpp | 30 + src/precompiled.hpp | 124 ++ src/proxy.cpp | 656 ++++++ src/proxy.hpp | 42 + src/pub.cpp | 67 + src/pub.hpp | 59 + src/pull.cpp | 78 + src/pull.hpp | 68 + src/push.cpp | 77 + src/push.hpp | 67 + src/radio.cpp | 277 +++ src/radio.hpp | 115 + src/random.cpp | 119 + src/random.hpp | 51 + src/raw_decoder.cpp | 74 + src/raw_decoder.hpp | 70 + src/raw_encoder.cpp | 51 + src/raw_encoder.hpp | 60 + src/reaper.cpp | 149 ++ src/reaper.hpp | 90 + src/rep.cpp | 133 ++ src/rep.hpp | 68 + src/req.cpp | 326 +++ src/req.hpp | 117 + src/router.cpp | 548 +++++ src/router.hpp | 141 ++ src/scatter.cpp | 83 + src/scatter.hpp | 67 + src/select.cpp | 616 ++++++ src/select.hpp | 173 ++ src/server.cpp | 182 ++ src/server.hpp | 90 + src/session_base.cpp | 710 ++++++ src/session_base.hpp | 172 ++ src/signaler.cpp | 382 ++++ src/signaler.hpp | 89 + src/socket_base.cpp | 1778 +++++++++++++++ src/socket_base.hpp | 304 +++ src/socket_poller.cpp | 683 ++++++ src/socket_poller.hpp | 146 ++ src/socks.cpp | 290 +++ src/socks.hpp | 133 ++ src/socks_connecter.cpp | 466 ++++ src/socks_connecter.hpp | 171 ++ src/stdint.hpp | 77 + src/stream.cpp | 319 +++ src/stream.hpp | 104 + src/stream_engine.cpp | 1095 +++++++++ src/stream_engine.hpp | 238 ++ src/sub.cpp | 87 + src/sub.hpp | 59 + src/tcp.cpp | 358 +++ src/tcp.hpp | 73 + src/tcp_address.cpp | 904 ++++++++ src/tcp_address.hpp | 121 + src/tcp_connecter.cpp | 425 ++++ src/tcp_connecter.hpp | 139 ++ src/tcp_listener.cpp | 366 +++ src/tcp_listener.hpp | 95 + src/thread.cpp | 266 +++ src/thread.hpp | 110 + src/timers.cpp | 199 ++ src/timers.hpp | 109 + src/tipc_address.cpp | 180 ++ src/tipc_address.hpp | 76 + src/tipc_connecter.cpp | 271 +++ src/tipc_connecter.hpp | 137 ++ src/tipc_listener.cpp | 207 ++ src/tipc_listener.hpp | 103 + src/trie.cpp | 321 +++ src/trie.hpp | 85 + src/tweetnacl.c | 988 +++++++++ src/tweetnacl.h | 78 + src/udp_address.cpp | 170 ++ src/udp_address.hpp | 77 + src/udp_engine.cpp | 391 ++++ src/udp_engine.hpp | 73 + src/v1_decoder.cpp | 152 ++ src/v1_decoder.hpp | 64 + src/v1_encoder.cpp | 75 + src/v1_encoder.hpp | 56 + src/v2_decoder.cpp | 162 ++ src/v2_decoder.hpp | 72 + src/v2_encoder.cpp | 77 + src/v2_encoder.hpp | 56 + src/v2_protocol.hpp | 49 + src/version.rc.in | 93 + src/vmci.cpp | 100 + src/vmci.hpp | 66 + src/vmci_address.cpp | 167 ++ src/vmci_address.hpp | 71 + src/vmci_connecter.cpp | 298 +++ src/vmci_connecter.hpp | 137 ++ src/vmci_listener.cpp | 266 +++ src/vmci_listener.hpp | 98 + src/windows.hpp | 97 + src/wire.hpp | 96 + src/xpub.cpp | 320 +++ src/xpub.hpp | 122 + src/xsub.cpp | 248 +++ src/xsub.hpp | 96 + src/ypipe.hpp | 211 ++ src/ypipe_base.hpp | 54 + src/ypipe_conflate.hpp | 119 + src/yqueue.hpp | 215 ++ src/zap_client.cpp | 305 +++ src/zap_client.hpp | 101 + src/zmq.cpp | 1506 +++++++++++++ src/zmq_draft.h | 189 ++ src/zmq_utils.cpp | 321 +++ tests/CMakeLists.txt | 233 ++ tests/README.md | 28 + tests/test_abstract_ipc.cpp | 67 + tests/test_ancillaries.cpp | 50 + tests/test_atomics.cpp | 48 + tests/test_base85.cpp | 164 ++ tests/test_bind_after_connect_tcp.cpp | 97 + tests/test_bind_src_address.cpp | 57 + tests/test_capabilities.cpp | 82 + tests/test_client_server.cpp | 106 + tests/test_conflate.cpp | 86 + tests/test_connect_delay_tipc.cpp | 238 ++ tests/test_connect_resolve.cpp | 70 + tests/test_connect_rid.cpp | 201 ++ tests/test_ctx_destroy.cpp | 110 + tests/test_ctx_options.cpp | 211 ++ tests/test_dgram.cpp | 99 + tests/test_diffserv.cpp | 84 + tests/test_disconnect_inproc.cpp | 151 ++ tests/test_filter_ipc.cpp | 164 ++ tests/test_fork.cpp | 98 + tests/test_getsockopt_memset.cpp | 64 + tests/test_heartbeats.cpp | 346 +++ tests/test_hwm.cpp | 321 +++ tests/test_hwm_pubsub.cpp | 248 +++ tests/test_immediate.cpp | 250 +++ tests/test_inproc_connect.cpp | 529 +++++ tests/test_invalid_rep.cpp | 97 + tests/test_iov.cpp | 156 ++ tests/test_ipc_wildcard.cpp | 65 + tests/test_issue_566.cpp | 99 + tests/test_last_endpoint.cpp | 65 + tests/test_many_sockets.cpp | 100 + tests/test_metadata.cpp | 130 ++ tests/test_monitor.cpp | 116 + tests/test_msg_ffn.cpp | 146 ++ tests/test_msg_flags.cpp | 126 ++ tests/test_pair_inproc.cpp | 81 + tests/test_pair_ipc.cpp | 60 + tests/test_pair_tcp.cpp | 92 + tests/test_pair_tipc.cpp | 62 + tests/test_pair_vmci.cpp | 68 + tests/test_poller.cpp | 413 ++++ tests/test_probe_router.cpp | 86 + tests/test_proxy.cpp | 503 +++++ tests/test_proxy_single_socket.cpp | 119 + tests/test_proxy_terminate.cpp | 131 ++ tests/test_pub_invert_matching.cpp | 136 ++ tests/test_radio_dish.cpp | 192 ++ tests/test_rebind_ipc.cpp | 84 + tests/test_reconnect_ivl.cpp | 149 ++ tests/test_req_correlate.cpp | 140 ++ tests/test_req_relaxed.cpp | 220 ++ tests/test_reqrep_device.cpp | 153 ++ tests/test_reqrep_device_tipc.cpp | 146 ++ tests/test_reqrep_inproc.cpp | 60 + tests/test_reqrep_ipc.cpp | 112 + tests/test_reqrep_tcp.cpp | 336 +++ tests/test_reqrep_tipc.cpp | 61 + tests/test_reqrep_vmci.cpp | 68 + tests/test_router_handover.cpp | 117 + tests/test_router_mandatory.cpp | 292 +++ tests/test_router_mandatory_hwm.cpp | 136 ++ tests/test_router_mandatory_tipc.cpp | 71 + tests/test_scatter_gather.cpp | 84 + tests/test_security_curve.cpp | 690 ++++++ tests/test_security_gssapi.cpp | 370 ++++ tests/test_security_null.cpp | 207 ++ tests/test_security_plain.cpp | 213 ++ tests/test_security_zap.cpp | 417 ++++ tests/test_setsockopt.cpp | 153 ++ tests/test_shutdown_stress.cpp | 100 + tests/test_shutdown_stress_tipc.cpp | 93 + tests/test_socket_null.cpp | 146 ++ tests/test_sockopt_hwm.cpp | 209 ++ tests/test_sodium.cpp | 99 + tests/test_spec_dealer.cpp | 267 +++ tests/test_spec_pushpull.cpp | 303 +++ tests/test_spec_rep.cpp | 169 ++ tests/test_spec_req.cpp | 268 +++ tests/test_spec_router.cpp | 219 ++ tests/test_srcfd.cpp | 126 ++ tests/test_stream.cpp | 336 +++ tests/test_stream_disconnect.cpp | 299 +++ tests/test_stream_empty.cpp | 75 + tests/test_stream_exceeds_buffer.cpp | 124 ++ tests/test_stream_timeout.cpp | 234 ++ tests/test_sub_forward.cpp | 109 + tests/test_sub_forward_tipc.cpp | 102 + tests/test_system.cpp | 101 + tests/test_term_endpoint.cpp | 226 ++ tests/test_term_endpoint_tipc.cpp | 120 + tests/test_thread_safe.cpp | 90 + tests/test_timeo.cpp | 93 + tests/test_timers.cpp | 245 +++ tests/test_udp.cpp | 134 ++ tests/test_unbind_inproc.cpp | 43 + tests/test_unbind_wildcard.cpp | 216 ++ tests/test_use_fd_ipc.cpp | 222 ++ tests/test_use_fd_tcp.cpp | 237 ++ tests/test_xpub_manual.cpp | 597 +++++ tests/test_xpub_nodrop.cpp | 117 + tests/test_xpub_welcome_msg.cpp | 81 + tests/test_zmq_poll_fd.cpp | 99 + tests/testutil.hpp | 401 ++++ tests/testutil_security.hpp | 684 ++++++ tools/curve_keygen.cpp | 64 + unittests/CMakeLists.txt | 65 + unittests/unittest_mtrie.cpp | 160 ++ unittests/unittest_poller.cpp | 222 ++ unittests/unittest_ypipe.cpp | 87 + version.sh | 21 + 798 files changed, 115123 insertions(+) commit 31387f84e4ea4567e3504ce8bafb217546b40ac3 Merge: b575b05 1e03f7b Author: Luca Boccassi Date: Tue Feb 27 11:00:49 2018 +0000 Merge pull request #2960 from Romain-Geissler-1A/fix-gcc-8-build Fix gcc 8 build warning/error with -O3. commit 1e03f7b2d486bb4bcedc897df7048b92f850a892 Author: Romain Geissler Date: Tue Feb 27 10:12:22 2018 +0100 Fix gcc 8 build warning/error with -O3. src/msg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b575b05d2c79157a4a6933e790b95f2af7706808 Merge: 4c7c9b8 78aa9b1 Author: Luca Boccassi Date: Mon Feb 19 17:24:24 2018 +0000 Merge pull request #2951 from eponsko/master Problem: No support for addressing using TIPC Port Identity commit 78aa9b19837ce91da6fde0ebfa6ee967c96d249a Author: Pontus Sköldström Date: Mon Feb 19 17:34:40 2018 +0100 Support addressing TIPC Port Identity ZeroMQ currently supports location independent addressing using TIPC Port Names with tipc://{type,instance}. This commits adds support for connecting and binding using TIPC Port Identity addresses. To connect using Port Identities the expected format is tipc://, e.g. "tipc://<1.2.3:123123>". To bind using TIPC Port Identities the expected format is "tipc://<*>". src/tipc_address.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++++----- src/tipc_address.hpp | 6 +++++ src/tipc_connecter.cpp | 5 ++++ src/tipc_listener.cpp | 23 ++++++++++++++--- 4 files changed, 93 insertions(+), 10 deletions(-) commit 4c7c9b87bf18b2561e65305dabe5a9bc97624ae1 Merge: 2700c15 5224b87 Author: Luca Boccassi Date: Wed Feb 14 18:19:44 2018 +0000 Merge pull request #2947 from sigiesec/fix-unittest-poller-race Problem: race condition in unittest_poller commit 2700c15d67d15abff918ee88d21ffc626496c516 Merge: 487c275 ef7cb96 Author: Luca Boccassi Date: Wed Feb 14 15:10:56 2018 +0000 Merge pull request #2946 from hartcw/master Minor fixes for windows cmake build commit ef7cb9678299053e6ae1732e70c375d96cd2d0a8 Author: Francis Hart Date: Wed Feb 14 15:00:21 2018 +0200 Fix cmake install error when BUILD_SHARED is off This fixes an error with the cmake install configuration, which attempted an invalid copy of a .pdb file on windows, when the BUILD_SHARED option is disabled. CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit d470475272ac518dc3f97baf4dfa317d6245eed0 Author: Francis Hart Date: Wed Feb 14 14:58:58 2018 +0200 Add cmake build option for disabling tests This adds a new cmake build option called BUILD_TESTS, that can be used to enable/disable building of the tests. This is enabled by default. CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit dee0213108d94f0ea7b5ee1b85fe24e9f4274190 Author: Francis Hart Date: Wed Nov 16 17:28:18 2016 +0200 Ensure correct cmake target suffix for all builds This updates the cmake set_target_properperties usage, so that the suffix is specified for the MinSizeRel build type. CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) commit 5224b8704a39c56bf063698ac2adb70755dc2e05 Author: Simon Giesecke Date: Tue Feb 13 22:24:38 2018 -0500 Problem: race condition in unit test Solution: fix order of statements in test_events_t unittests/unittest_poller.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 487c275809cc46a095efef7daad079b4c487aba0 Merge: bc467f0 e10464e Author: Luca Boccassi Date: Tue Feb 13 22:29:38 2018 +0000 Merge pull request #2945 from kachanovskiy/master Fix build break when SIO_LOOPBACK_FAST_PATH is not defined (i.e. in VS2010) commit e10464e45ef6a0afbf168c739ebcb8eed794f289 Author: Kachanovskiy Date: Tue Feb 13 23:04:08 2018 +0100 Fix for build break when SIO_LOOPBACK_FAST_PATH is not defined (i.e. in VS2010) src/tcp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bc467f063113f113439e56c701b599198cd98bf9 Merge: e57afec 94743fd Author: Luca Boccassi Date: Tue Feb 13 19:05:51 2018 +0000 Merge pull request #2944 from sigiesec/unity Problem: insufficient unit tests for poller concept and ypipe commit 94743fd21f378027241d80eb7594781301c18aa6 Author: Simon Giesecke Date: Tue Feb 13 18:01:27 2018 +0100 Problem: wrong formatting in several files Solution: apply clang-format src/select.cpp | 2 +- src/tcp_connecter.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 90c6d993bedce4edd1ccafdcb0835ccf261f50a9 Author: Simon Giesecke Date: Tue Feb 13 16:17:08 2018 +0100 Problem: kqueue_t fails unittest_poller Solution: fix shutdown of kqueue_t src/kqueue.cpp | 33 ++++++++++++++++++--------------- src/kqueue.hpp | 15 +-------------- 2 files changed, 19 insertions(+), 29 deletions(-) commit 3b90ad8c63e72b51a6764374d9b4609ae90c24d8 Author: Simon Giesecke Date: Tue Feb 13 15:50:57 2018 +0100 Problem: support of std::atomic is incomplete in VS <2015 Solution: use std::atomic only from VS 2015 src/atomic_counter.hpp | 2 +- src/atomic_ptr.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) commit 9aa957b445d2cb53e5218cf7d4afdf7b521bdb2a Author: Simon Giesecke Date: Tue Feb 13 10:42:02 2018 +0100 Problem: appveyor builds fails if they are not the most recent commit Solution: use shallow_clone option instead of clone_depth appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 815c7db06be5f8d4eb67a6f4640b4fb69d6369da Author: Simon Giesecke Date: Tue Feb 13 10:40:54 2018 +0100 Problem: poll build runs as last appveyor build Solution: change order of appveyor build jobs to enable faster feedback on more diverse builds appveyor.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) commit 0458b85dec17acf0a079afef69dc4e44aaa141e5 Author: Simon Giesecke Date: Tue Feb 13 10:08:57 2018 +0100 Problem: Some tests timeout on appveyor for POLLER=poll Solution: Increase test timeouts for poll poller under Windows tests/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) commit 96131b5b4e9d706f925e67b3e311dadffe66a81d Author: Simon Giesecke Date: Tue Feb 13 09:58:24 2018 +0100 Problem: no documentation of the poller concept Solution: added documentation src/poller_base.hpp | 101 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 11 deletions(-) commit fafea72b928eebfa618f7682737c57aca98e2997 Author: Simon Giesecke Date: Tue Feb 13 08:56:13 2018 +0100 Problem: header files not included in VS project files Solution: add to list of sources .clang-format | 53 + .github/PULL_REQUEST_TEMPLATE.md | 28 + .github/issue_template.md | 22 + .gitignore | 180 ++ .hgeol | 2 + .mailmap | 81 + .travis.yml | 129 ++ AUTHORS | 151 ++ CMakeLists.txt | 1276 +++++++++++ COPYING | 674 ++++++ COPYING.LESSER | 181 ++ Dockerfile | 11 + Doxygen.cfg | 2320 ++++++++++++++++++++ INSTALL | 311 +++ Jenkinsfile | 485 ++++ Makefile.am | 990 +++++++++ NEWS | 1585 +++++++++++++ README.cygwin.md | 15 + README.doxygen.md | 48 + README.md | 102 + RELICENSE/AndreLouisCaron.md | 15 + RELICENSE/Asmod4n.md | 13 + RELICENSE/BerndPrager.md | 13 + RELICENSE/Bklyn.md | 15 + RELICENSE/BrianBuchanan.md | 15 + RELICENSE/ChuckRemes.md | 15 + RELICENSE/FrancoFichtner.md | 15 + RELICENSE/GavinMcNiff.md | 15 + RELICENSE/GhislainPutois.md | 15 + RELICENSE/GiuseppeCorbelli.md | 15 + RELICENSE/HaraldAchitz.md | 17 + RELICENSE/Hugne.md | 17 + RELICENSE/JimHague.md | 16 + RELICENSE/JohanMabille.md | 16 + RELICENSE/LeonardMichelet | 14 + RELICENSE/LeonardoConsoni.md | 15 + RELICENSE/LionelOrry.md | 15 + RELICENSE/OsirisPedroso.md | 15 + RELICENSE/README.md | 23 + RELICENSE/RobGagnon.md | 13 + RELICENSE/SebastienRombauts.md | 15 + RELICENSE/StoianIvanov.md | 15 + RELICENSE/SylvainCorlay.md | 16 + RELICENSE/TimotheeBesset.md | 15 + RELICENSE/VincentTellier.md | 15 + RELICENSE/VolodymyrKorniichuk.md | 15 + RELICENSE/abbradar.md | 16 + RELICENSE/agronholm.md | 15 + RELICENSE/amuraru.md | 15 + RELICENSE/arsenm.md | 15 + RELICENSE/aseering.md | 15 + RELICENSE/bjorntopel.md | 16 + RELICENSE/bjovke.md | 16 + RELICENSE/brocade_communications_systems.md | 15 + RELICENSE/brunobodin.md | 13 + RELICENSE/c-rack.md | 15 + RELICENSE/camachat.md | 15 + RELICENSE/cdolan.md | 15 + RELICENSE/chrisstaite.md | 14 + RELICENSE/chugga_fan.md | 15 + RELICENSE/cjuniet.md | 15 + RELICENSE/ckamm.md | 15 + RELICENSE/clkao.md | 15 + RELICENSE/danielhtshih.md | 15 + RELICENSE/danriegsecker.md | 16 + RELICENSE/dfons.md | 16 + RELICENSE/djelenc.md | 15 + RELICENSE/drodri.md | 15 + RELICENSE/eburkitt.md | 15 + RELICENSE/egomotion.md | 16 + RELICENSE/evoskuil.md | 15 + RELICENSE/febeling.md | 16 + RELICENSE/fidlej.md | 15 + RELICENSE/flub.md | 14 + RELICENSE/gena-moscow.md | 15 + RELICENSE/gonzus.md | 15 + RELICENSE/goodfella_ltd.md | 13 + RELICENSE/google.md | 13 + RELICENSE/ianbarber.md | 15 + RELICENSE/imatix.md | 23 + RELICENSE/jakecobb.md | 13 + RELICENSE/jemc.md | 15 + RELICENSE/jimklimov.md | 17 + RELICENSE/jkryl.md | 15 + RELICENSE/johntconklin.md | 15 + RELICENSE/jruffin.md | 14 + RELICENSE/kentzo.md | 15 + RELICENSE/kevinsapper.md | 13 + RELICENSE/kobolog.md | 12 + RELICENSE/kurdybacha.md | 15 + RELICENSE/linville.md | 15 + RELICENSE/loachfish.md | 15 + RELICENSE/lodagro.md | 15 + RELICENSE/madebr.md | 15 + RELICENSE/mattconnolly.md | 15 + RELICENSE/mauri-melato.md | 13 + RELICENSE/mditzel.md | 15 + RELICENSE/meox.md | 15 + RELICENSE/michael-fox.md | 16 + RELICENSE/michicc.md | 15 + RELICENSE/minrk.md | 15 + RELICENSE/mipaaa.md | 15 + RELICENSE/mkluwe.md | 15 + RELICENSE/montoyaedu.md | 15 + RELICENSE/naos_ltd.md | 19 + RELICENSE/natano.md | 15 + RELICENSE/olafmandel.md | 13 + RELICENSE/pijyoi.md | 13 + RELICENSE/ptroja.md | 14 + RELICENSE/reunanen.md | 15 + RELICENSE/reza-ebrahimi.md | 15 + RELICENSE/rikvdh.md | 15 + RELICENSE/rlenferink.md | 15 + RELICENSE/roalz.md | 13 + RELICENSE/rodgert.md | 17 + RELICENSE/rotty.md | 16 + RELICENSE/sabae.md | 15 + RELICENSE/scemama.md | 15 + RELICENSE/sheremetyev.md | 13 + RELICENSE/shripchenko.md | 15 + RELICENSE/sigiesec.md | 17 + RELICENSE/soulik.md | 15 + RELICENSE/swansontec.md | 15 + RELICENSE/t-b.md | 15 + RELICENSE/tSed.md | 15 + RELICENSE/tabe.md | 15 + RELICENSE/tailhook.md | 16 + RELICENSE/taotetek.md | 13 + .../templates/relicense-template-mplv2-any-osi.txt | 15 + .../relicense-template-mplv2-share-alike-osi.txt | 15 + RELICENSE/templates/relicense-template-mplv2.txt | 13 + RELICENSE/thompsa.md | 15 + RELICENSE/torehalvorsen.md | 15 + RELICENSE/twhittock.md | 15 + RELICENSE/ulikoehler.md | 16 + RELICENSE/vyskocilm.md | 7 + RELICENSE/willstrang.md | 15 + RELICENSE/xaqq.md | 13 + RELICENSE/yuvallanger.md | 15 + acinclude.m4 | 1122 ++++++++++ appveyor.yml | 106 + autogen.sh | 49 + branding.bmp | Bin 0 -> 25818 bytes builds/Makefile.am | 29 + builds/README | 4 + builds/android/Dockerfile | 22 + builds/android/README.md | 78 + builds/android/android_build_helper.sh | 316 +++ builds/android/build.sh | 70 + builds/android/ci_build.sh | 30 + builds/cmake/Modules/ClangFormat.cmake | 41 + builds/cmake/Modules/FindAsciiDoc.cmake | 26 + builds/cmake/Modules/FindSodium.cmake | 40 + builds/cmake/Modules/TestZMQVersion.cmake | 8 + builds/cmake/Modules/ZMQSourceRunChecks.cmake | 301 +++ builds/cmake/NSIS.template32.in | 952 ++++++++ builds/cmake/NSIS.template64.in | 960 ++++++++ builds/cmake/ZeroMQConfig.cmake.in | 25 + builds/cmake/ci_build.sh | 49 + builds/cmake/clang-format-check.sh.in | 14 + builds/cmake/platform.hpp.in | 104 + builds/coverage/ci_build.sh | 32 + builds/cygwin/Makefile.cygwin | 48 + builds/gyp/.gitignore | 5 + builds/gyp/build.bat | 4 + builds/gyp/platform.hpp | 80 + builds/gyp/project-tests.gsl | 19 + builds/gyp/project-tests.gypi | 895 ++++++++ builds/gyp/project-tests.xml | 83 + builds/gyp/project.gyp | 295 +++ builds/mingw32/Makefile.mingw32 | 49 + builds/mingw32/platform.hpp | 43 + builds/msvc/.gitignore | 256 +++ builds/msvc/Makefile.am | 94 + builds/msvc/build/build.bat | 33 + builds/msvc/build/buildall.bat | 16 + builds/msvc/build/buildbase.bat | 73 + builds/msvc/errno.cpp | 32 + builds/msvc/errno.hpp | 56 + builds/msvc/platform.hpp | 14 + builds/msvc/properties/Common.props | 21 + builds/msvc/properties/DLL.props | 16 + builds/msvc/properties/Debug.props | 29 + builds/msvc/properties/DebugDEXE.props | 21 + builds/msvc/properties/DebugDLL.props | 20 + builds/msvc/properties/DebugLEXE.props | 20 + builds/msvc/properties/DebugLIB.props | 21 + builds/msvc/properties/DebugLTCG.props | 20 + builds/msvc/properties/DebugSEXE.props | 21 + builds/msvc/properties/EXE.props | 17 + builds/msvc/properties/LIB.props | 16 + builds/msvc/properties/LTCG.props | 13 + builds/msvc/properties/Link.props | 21 + builds/msvc/properties/Messages.props | 15 + builds/msvc/properties/Output.props | 30 + builds/msvc/properties/Release.props | 41 + builds/msvc/properties/ReleaseDEXE.props | 20 + builds/msvc/properties/ReleaseDLL.props | 19 + builds/msvc/properties/ReleaseLEXE.props | 20 + builds/msvc/properties/ReleaseLIB.props | 19 + builds/msvc/properties/ReleaseLTCG.props | 19 + builds/msvc/properties/ReleaseSEXE.props | 20 + builds/msvc/properties/Win32.props | 20 + builds/msvc/properties/x64.props | 23 + builds/msvc/readme.txt | 27 + builds/msvc/resource.h | 14 + builds/msvc/resource.rc | Bin 0 -> 4650 bytes builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj | 52 + builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj | 52 + builds/msvc/vs2008/libzmq.sln | 95 + builds/msvc/vs2008/libzmq/libzmq.vcproj | 338 +++ builds/msvc/vs2008/local_lat/local_lat.vcproj | 52 + builds/msvc/vs2008/local_thr/local_thr.vcproj | 52 + builds/msvc/vs2008/remote_lat/remote_lat.vcproj | 52 + builds/msvc/vs2008/remote_thr/remote_thr.vcproj | 52 + builds/msvc/vs2010/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2010/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2010/libsodium.import.props | 52 + builds/msvc/vs2010/libsodium.import.xml | 17 + builds/msvc/vs2010/libzmq.import.props | 64 + builds/msvc/vs2010/libzmq.import.xml | 49 + builds/msvc/vs2010/libzmq.sln | 206 ++ builds/msvc/vs2010/libzmq/libzmq.props | 76 + builds/msvc/vs2010/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2010/libzmq/libzmq.xml | 40 + builds/msvc/vs2010/local_lat/local_lat.props | 49 + builds/msvc/vs2010/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2010/local_thr/local_thr.props | 49 + builds/msvc/vs2010/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2010/remote_lat/remote_lat.props | 49 + builds/msvc/vs2010/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2010/remote_thr/remote_thr.props | 49 + builds/msvc/vs2010/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2012/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2012/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2012/libsodium.import.props | 52 + builds/msvc/vs2012/libsodium.import.xml | 17 + builds/msvc/vs2012/libzmq.import.props | 64 + builds/msvc/vs2012/libzmq.import.xml | 49 + builds/msvc/vs2012/libzmq.sln | 206 ++ builds/msvc/vs2012/libzmq/libzmq.props | 76 + builds/msvc/vs2012/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2012/libzmq/libzmq.xml | 40 + builds/msvc/vs2012/local_lat/local_lat.props | 49 + builds/msvc/vs2012/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2012/local_thr/local_thr.props | 49 + builds/msvc/vs2012/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2012/remote_lat/remote_lat.props | 49 + builds/msvc/vs2012/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2012/remote_thr/remote_thr.props | 49 + builds/msvc/vs2012/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2013/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2013/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2013/libsodium.import.props | 52 + builds/msvc/vs2013/libsodium.import.xml | 17 + builds/msvc/vs2013/libzmq.import.props | 64 + builds/msvc/vs2013/libzmq.import.xml | 49 + builds/msvc/vs2013/libzmq.sln | 208 ++ builds/msvc/vs2013/libzmq/libzmq.props | 76 + builds/msvc/vs2013/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2013/libzmq/libzmq.xml | 40 + builds/msvc/vs2013/local_lat/local_lat.props | 49 + builds/msvc/vs2013/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2013/local_thr/local_thr.props | 49 + builds/msvc/vs2013/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2013/remote_lat/remote_lat.props | 49 + builds/msvc/vs2013/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2013/remote_thr/remote_thr.props | 49 + builds/msvc/vs2013/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2015/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2015/libsodium.import.props | 52 + builds/msvc/vs2015/libsodium.import.xml | 17 + builds/msvc/vs2015/libzmq.import.props | 64 + builds/msvc/vs2015/libzmq.import.xml | 49 + builds/msvc/vs2015/libzmq.sln | 208 ++ builds/msvc/vs2015/libzmq/libzmq.props | 76 + builds/msvc/vs2015/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2015/libzmq/libzmq.xml | 40 + builds/msvc/vs2015/local_lat/local_lat.props | 49 + builds/msvc/vs2015/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2015/local_thr/local_thr.props | 49 + builds/msvc/vs2015/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2015/remote_lat/remote_lat.props | 49 + builds/msvc/vs2015/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2015/remote_thr/remote_thr.props | 49 + builds/msvc/vs2015/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015_xp/libzmq.vcxproj | 258 +++ builds/msvc/vs2015_xp/platform.hpp | 15 + .../msvc/vs2015_xp/test_zmq/test_multithread.cpp | 229 ++ builds/msvc/vs2015_xp/test_zmq/test_zmq.vcxproj | 155 ++ builds/msvc/vs2017/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2017/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2017/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2017/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2017/libsodium.import.props | 52 + builds/msvc/vs2017/libsodium.import.xml | 17 + builds/msvc/vs2017/libzmq.import.props | 64 + builds/msvc/vs2017/libzmq.import.xml | 49 + builds/msvc/vs2017/libzmq.sln | 208 ++ builds/msvc/vs2017/libzmq/libzmq.props | 76 + builds/msvc/vs2017/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2017/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2017/libzmq/libzmq.xml | 40 + builds/msvc/vs2017/local_lat/local_lat.props | 49 + builds/msvc/vs2017/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2017/local_thr/local_thr.props | 49 + builds/msvc/vs2017/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2017/remote_lat/remote_lat.props | 49 + builds/msvc/vs2017/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2017/remote_thr/remote_thr.props | 49 + builds/msvc/vs2017/remote_thr/remote_thr.vcxproj | 82 + builds/nuget/libzmq.autopkg | 52 + builds/nuget/readme.nuget | 20 + builds/openwrt/Makefile | 70 + builds/valgrind/ci_build.sh | 30 + builds/valgrind/valgrind.supp | 22 + builds/valgrind/vg | 1 + builds/zos/README.md | 463 ++++ builds/zos/cxxall | 62 + builds/zos/makeclean | 36 + builds/zos/makelibzmq | 54 + builds/zos/maketests | 102 + builds/zos/platform.hpp | 300 +++ builds/zos/runtests | 188 ++ builds/zos/test_fork.cpp | 95 + builds/zos/zc++ | 42 + ci_build.sh | 70 + ci_deploy.sh | 34 + configure.ac | 844 +++++++ doc/Makefile.am | 64 + doc/asciidoc.conf | 56 + doc/zmq.txt | 276 +++ doc/zmq_atomic_counter_dec.txt | 62 + doc/zmq_atomic_counter_destroy.txt | 62 + doc/zmq_atomic_counter_inc.txt | 61 + doc/zmq_atomic_counter_new.txt | 62 + doc/zmq_atomic_counter_set.txt | 61 + doc/zmq_atomic_counter_value.txt | 62 + doc/zmq_bind.txt | 103 + doc/zmq_close.txt | 56 + doc/zmq_connect.txt | 101 + doc/zmq_ctx_destroy.txt | 67 + doc/zmq_ctx_get.txt | 105 + doc/zmq_ctx_new.txt | 50 + doc/zmq_ctx_set.txt | 184 ++ doc/zmq_ctx_shutdown.txt | 52 + doc/zmq_ctx_term.txt | 68 + doc/zmq_curve.txt | 92 + doc/zmq_curve_keypair.txt | 56 + doc/zmq_curve_public.txt | 62 + doc/zmq_disconnect.txt | 75 + doc/zmq_errno.txt | 50 + doc/zmq_getsockopt.txt | 944 ++++++++ doc/zmq_gssapi.txt | 78 + doc/zmq_has.txt | 44 + doc/zmq_init.txt | 52 + doc/zmq_inproc.txt | 88 + doc/zmq_ipc.txt | 106 + doc/zmq_msg_close.txt | 56 + doc/zmq_msg_copy.txt | 72 + doc/zmq_msg_data.txt | 48 + doc/zmq_msg_get.txt | 83 + doc/zmq_msg_gets.txt | 81 + doc/zmq_msg_init.txt | 64 + doc/zmq_msg_init_data.txt | 89 + doc/zmq_msg_init_size.txt | 58 + doc/zmq_msg_more.txt | 65 + doc/zmq_msg_move.txt | 52 + doc/zmq_msg_recv.txt | 124 ++ doc/zmq_msg_routing_id.txt | 61 + doc/zmq_msg_send.txt | 127 ++ doc/zmq_msg_set.txt | 46 + doc/zmq_msg_set_routing_id.txt | 46 + doc/zmq_msg_size.txt | 48 + doc/zmq_null.txt | 27 + doc/zmq_pgm.txt | 164 ++ doc/zmq_plain.txt | 37 + doc/zmq_poll.txt | 135 ++ doc/zmq_proxy.txt | 99 + doc/zmq_proxy_steerable.txt | 111 + doc/zmq_recv.txt | 91 + doc/zmq_recvmsg.txt | 121 + doc/zmq_send.txt | 104 + doc/zmq_send_const.txt | 103 + doc/zmq_sendmsg.txt | 121 + doc/zmq_setsockopt.txt | 1318 +++++++++++ doc/zmq_socket.txt | 609 +++++ doc/zmq_socket_monitor.txt | 294 +++ doc/zmq_strerror.txt | 56 + doc/zmq_tcp.txt | 118 + doc/zmq_term.txt | 66 + doc/zmq_tipc.txt | 83 + doc/zmq_udp.txt | 99 + doc/zmq_unbind.txt | 90 + doc/zmq_version.txt | 54 + doc/zmq_vmci.txt | 97 + doc/zmq_z85_decode.txt | 51 + doc/zmq_z85_encode.txt | 58 + external/unity/license.txt | 21 + external/unity/unity.c | 1570 +++++++++++++ external/unity/unity.h | 503 +++++ external/unity/unity_internals.h | 872 ++++++++ external/unity/version.txt | 1 + include/zmq.h | 732 ++++++ include/zmq_utils.h | 50 + installer.ico | Bin 0 -> 2842 bytes m4/ax_check_compile_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 +++ m4/ax_cxx_compile_stdcxx.m4 | 562 +++++ m4/ax_cxx_compile_stdcxx_11.m4 | 40 + m4/ax_valgrind_check.m4 | 233 ++ packaging/README | 4 + packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 64 + packaging/debian/copyright | 116 + packaging/debian/libzmq3-dev.install | 4 + packaging/debian/libzmq3-dev.manpages | 2 + packaging/debian/libzmq5.docs | 2 + packaging/debian/libzmq5.install | 1 + packaging/debian/rules | 67 + packaging/debian/source/format | 1 + packaging/debian/zeromq.dsc.obs | 15 + packaging/nuget/package.bat | 14 + packaging/nuget/package.config | 6 + packaging/nuget/package.gsl | 264 +++ packaging/nuget/package.nuspec | 98 + packaging/nuget/package.targets | 129 ++ packaging/nuget/package.xml | 22 + packaging/obs/_service | 98 + packaging/redhat/zeromq.spec | 234 ++ perf/inproc_lat.cpp | 238 ++ perf/inproc_thr.cpp | 247 +++ perf/local_lat.cpp | 116 + perf/local_thr.cpp | 161 ++ perf/remote_lat.cpp | 129 ++ perf/remote_thr.cpp | 138 ++ src/address.cpp | 129 ++ src/address.hpp | 81 + src/array.hpp | 135 ++ src/atomic_counter.hpp | 235 ++ src/atomic_ptr.hpp | 301 +++ src/blob.hpp | 186 ++ src/client.cpp | 115 + src/client.hpp | 75 + src/clock.cpp | 258 +++ src/clock.hpp | 79 + src/command.hpp | 204 ++ src/condition_variable.hpp | 250 +++ src/config.hpp | 96 + src/ctx.cpp | 696 ++++++ src/ctx.hpp | 263 +++ src/curve_client.cpp | 290 +++ src/curve_client.hpp | 84 + src/curve_client_tools.hpp | 305 +++ src/curve_mechanism_base.cpp | 179 ++ src/curve_mechanism_base.hpp | 79 + src/curve_server.cpp | 492 +++++ src/curve_server.hpp | 91 + src/dbuffer.hpp | 141 ++ src/dealer.cpp | 145 ++ src/dealer.hpp | 83 + src/decoder.hpp | 193 ++ src/decoder_allocators.cpp | 151 ++ src/decoder_allocators.hpp | 131 ++ src/devpoll.cpp | 203 ++ src/devpoll.hpp | 115 + src/dgram.cpp | 175 ++ src/dgram.hpp | 76 + src/dish.cpp | 368 ++++ src/dish.hpp | 121 + src/dist.cpp | 228 ++ src/dist.hpp | 116 + src/encoder.hpp | 180 ++ src/epoll.cpp | 211 ++ src/epoll.hpp | 105 + src/err.cpp | 467 ++++ src/err.hpp | 173 ++ src/fd.hpp | 61 + src/fq.cpp | 156 ++ src/fq.hpp | 88 + src/gather.cpp | 93 + src/gather.hpp | 68 + src/gssapi_client.cpp | 236 ++ src/gssapi_client.hpp | 92 + src/gssapi_mechanism_base.cpp | 402 ++++ src/gssapi_mechanism_base.hpp | 132 ++ src/gssapi_server.cpp | 248 +++ src/gssapi_server.hpp | 92 + src/i_decoder.hpp | 60 + src/i_encoder.hpp | 57 + src/i_engine.hpp | 65 + src/i_mailbox.hpp | 57 + src/i_poll_events.hpp | 53 + src/io_object.cpp | 116 + src/io_object.hpp | 84 + src/io_thread.cpp | 118 + src/io_thread.hpp | 95 + src/ip.cpp | 611 ++++++ src/ip.hpp | 72 + src/ipc_address.cpp | 107 + src/ipc_address.hpp | 68 + src/ipc_connecter.cpp | 275 +++ src/ipc_connecter.hpp | 135 ++ src/ipc_listener.cpp | 434 ++++ src/ipc_listener.hpp | 118 + src/kqueue.cpp | 227 ++ src/kqueue.hpp | 123 ++ src/lb.cpp | 165 ++ src/lb.hpp | 84 + src/libzmq.pc.cmake.in | 11 + src/libzmq.pc.in | 11 + src/libzmq.vers | 4 + src/likely.hpp | 42 + src/macros.hpp | 13 + src/mailbox.cpp | 106 + src/mailbox.hpp | 88 + src/mailbox_safe.cpp | 117 + src/mailbox_safe.hpp | 90 + src/mechanism.cpp | 329 +++ src/mechanism.hpp | 144 ++ src/mechanism_base.cpp | 69 + src/mechanism_base.hpp | 54 + src/metadata.cpp | 58 + src/metadata.hpp | 69 + src/msg.cpp | 566 +++++ src/msg.hpp | 273 +++ src/mtrie.cpp | 422 ++++ src/mtrie.hpp | 103 + src/mutex.hpp | 177 ++ src/norm_engine.cpp | 714 ++++++ src/norm_engine.hpp | 185 ++ src/null_mechanism.cpp | 213 ++ src/null_mechanism.hpp | 71 + src/object.cpp | 478 ++++ src/object.hpp | 149 ++ src/options.cpp | 1100 ++++++++++ src/options.hpp | 257 +++ src/own.cpp | 214 ++ src/own.hpp | 149 ++ src/pair.cpp | 141 ++ src/pair.hpp | 73 + src/pgm_receiver.cpp | 304 +++ src/pgm_receiver.hpp | 143 ++ src/pgm_sender.cpp | 251 +++ src/pgm_sender.hpp | 122 + src/pgm_socket.cpp | 687 ++++++ src/pgm_socket.hpp | 128 ++ src/pipe.cpp | 550 +++++ src/pipe.hpp | 258 +++ src/plain_client.cpp | 217 ++ src/plain_client.hpp | 73 + src/plain_server.cpp | 258 +++ src/plain_server.hpp | 67 + src/poll.cpp | 209 ++ src/poll.hpp | 107 + src/poller.hpp | 64 + src/poller_base.cpp | 136 ++ src/poller_base.hpp | 117 + src/pollset.cpp | 254 +++ src/pollset.hpp | 117 + src/precompiled.cpp | 30 + src/precompiled.hpp | 124 ++ src/proxy.cpp | 656 ++++++ src/proxy.hpp | 42 + src/pub.cpp | 67 + src/pub.hpp | 59 + src/pull.cpp | 78 + src/pull.hpp | 68 + src/push.cpp | 77 + src/push.hpp | 67 + src/radio.cpp | 277 +++ src/radio.hpp | 115 + src/random.cpp | 119 + src/random.hpp | 51 + src/raw_decoder.cpp | 74 + src/raw_decoder.hpp | 70 + src/raw_encoder.cpp | 51 + src/raw_encoder.hpp | 60 + src/reaper.cpp | 149 ++ src/reaper.hpp | 90 + src/rep.cpp | 133 ++ src/rep.hpp | 68 + src/req.cpp | 326 +++ src/req.hpp | 117 + src/router.cpp | 548 +++++ src/router.hpp | 141 ++ src/scatter.cpp | 83 + src/scatter.hpp | 67 + src/select.cpp | 616 ++++++ src/select.hpp | 173 ++ src/server.cpp | 182 ++ src/server.hpp | 90 + src/session_base.cpp | 710 ++++++ src/session_base.hpp | 172 ++ src/signaler.cpp | 382 ++++ src/signaler.hpp | 89 + src/socket_base.cpp | 1778 +++++++++++++++ src/socket_base.hpp | 304 +++ src/socket_poller.cpp | 683 ++++++ src/socket_poller.hpp | 146 ++ src/socks.cpp | 290 +++ src/socks.hpp | 133 ++ src/socks_connecter.cpp | 466 ++++ src/socks_connecter.hpp | 171 ++ src/stdint.hpp | 77 + src/stream.cpp | 319 +++ src/stream.hpp | 104 + src/stream_engine.cpp | 1095 +++++++++ src/stream_engine.hpp | 238 ++ src/sub.cpp | 87 + src/sub.hpp | 59 + src/tcp.cpp | 358 +++ src/tcp.hpp | 73 + src/tcp_address.cpp | 904 ++++++++ src/tcp_address.hpp | 121 + src/tcp_connecter.cpp | 425 ++++ src/tcp_connecter.hpp | 139 ++ src/tcp_listener.cpp | 366 +++ src/tcp_listener.hpp | 95 + src/thread.cpp | 266 +++ src/thread.hpp | 110 + src/timers.cpp | 199 ++ src/timers.hpp | 109 + src/tipc_address.cpp | 123 ++ src/tipc_address.hpp | 70 + src/tipc_connecter.cpp | 266 +++ src/tipc_connecter.hpp | 137 ++ src/tipc_listener.cpp | 192 ++ src/tipc_listener.hpp | 103 + src/trie.cpp | 321 +++ src/trie.hpp | 85 + src/tweetnacl.c | 988 +++++++++ src/tweetnacl.h | 78 + src/udp_address.cpp | 170 ++ src/udp_address.hpp | 77 + src/udp_engine.cpp | 391 ++++ src/udp_engine.hpp | 73 + src/v1_decoder.cpp | 152 ++ src/v1_decoder.hpp | 64 + src/v1_encoder.cpp | 75 + src/v1_encoder.hpp | 56 + src/v2_decoder.cpp | 162 ++ src/v2_decoder.hpp | 72 + src/v2_encoder.cpp | 77 + src/v2_encoder.hpp | 56 + src/v2_protocol.hpp | 49 + src/version.rc.in | 93 + src/vmci.cpp | 100 + src/vmci.hpp | 66 + src/vmci_address.cpp | 167 ++ src/vmci_address.hpp | 71 + src/vmci_connecter.cpp | 298 +++ src/vmci_connecter.hpp | 137 ++ src/vmci_listener.cpp | 266 +++ src/vmci_listener.hpp | 98 + src/windows.hpp | 97 + src/wire.hpp | 96 + src/xpub.cpp | 320 +++ src/xpub.hpp | 121 + src/xsub.cpp | 248 +++ src/xsub.hpp | 96 + src/ypipe.hpp | 211 ++ src/ypipe_base.hpp | 54 + src/ypipe_conflate.hpp | 119 + src/yqueue.hpp | 215 ++ src/zap_client.cpp | 305 +++ src/zap_client.hpp | 101 + src/zmq.cpp | 1506 +++++++++++++ src/zmq_draft.h | 189 ++ src/zmq_utils.cpp | 321 +++ tests/CMakeLists.txt | 228 ++ tests/README.md | 28 + tests/test_abstract_ipc.cpp | 67 + tests/test_ancillaries.cpp | 50 + tests/test_atomics.cpp | 48 + tests/test_base85.cpp | 164 ++ tests/test_bind_after_connect_tcp.cpp | 97 + tests/test_bind_src_address.cpp | 57 + tests/test_capabilities.cpp | 82 + tests/test_client_server.cpp | 106 + tests/test_conflate.cpp | 86 + tests/test_connect_delay_tipc.cpp | 238 ++ tests/test_connect_resolve.cpp | 70 + tests/test_connect_rid.cpp | 201 ++ tests/test_ctx_destroy.cpp | 110 + tests/test_ctx_options.cpp | 211 ++ tests/test_dgram.cpp | 99 + tests/test_diffserv.cpp | 84 + tests/test_disconnect_inproc.cpp | 151 ++ tests/test_filter_ipc.cpp | 164 ++ tests/test_fork.cpp | 98 + tests/test_getsockopt_memset.cpp | 64 + tests/test_heartbeats.cpp | 346 +++ tests/test_hwm.cpp | 321 +++ tests/test_hwm_pubsub.cpp | 248 +++ tests/test_immediate.cpp | 250 +++ tests/test_inproc_connect.cpp | 529 +++++ tests/test_invalid_rep.cpp | 97 + tests/test_iov.cpp | 156 ++ tests/test_ipc_wildcard.cpp | 65 + tests/test_issue_566.cpp | 99 + tests/test_last_endpoint.cpp | 65 + tests/test_many_sockets.cpp | 100 + tests/test_metadata.cpp | 130 ++ tests/test_monitor.cpp | 116 + tests/test_msg_ffn.cpp | 146 ++ tests/test_msg_flags.cpp | 126 ++ tests/test_pair_inproc.cpp | 81 + tests/test_pair_ipc.cpp | 60 + tests/test_pair_tcp.cpp | 92 + tests/test_pair_tipc.cpp | 62 + tests/test_pair_vmci.cpp | 68 + tests/test_poller.cpp | 413 ++++ tests/test_probe_router.cpp | 86 + tests/test_proxy.cpp | 503 +++++ tests/test_proxy_single_socket.cpp | 119 + tests/test_proxy_terminate.cpp | 131 ++ tests/test_pub_invert_matching.cpp | 136 ++ tests/test_radio_dish.cpp | 192 ++ tests/test_rebind_ipc.cpp | 84 + tests/test_reconnect_ivl.cpp | 149 ++ tests/test_req_correlate.cpp | 140 ++ tests/test_req_relaxed.cpp | 220 ++ tests/test_reqrep_device.cpp | 153 ++ tests/test_reqrep_device_tipc.cpp | 146 ++ tests/test_reqrep_inproc.cpp | 60 + tests/test_reqrep_ipc.cpp | 112 + tests/test_reqrep_tcp.cpp | 336 +++ tests/test_reqrep_tipc.cpp | 61 + tests/test_reqrep_vmci.cpp | 68 + tests/test_router_handover.cpp | 117 + tests/test_router_mandatory.cpp | 292 +++ tests/test_router_mandatory_hwm.cpp | 136 ++ tests/test_router_mandatory_tipc.cpp | 71 + tests/test_scatter_gather.cpp | 84 + tests/test_security_curve.cpp | 690 ++++++ tests/test_security_gssapi.cpp | 370 ++++ tests/test_security_null.cpp | 207 ++ tests/test_security_plain.cpp | 213 ++ tests/test_security_zap.cpp | 417 ++++ tests/test_setsockopt.cpp | 153 ++ tests/test_shutdown_stress.cpp | 100 + tests/test_shutdown_stress_tipc.cpp | 93 + tests/test_socket_null.cpp | 146 ++ tests/test_sockopt_hwm.cpp | 209 ++ tests/test_sodium.cpp | 99 + tests/test_spec_dealer.cpp | 267 +++ tests/test_spec_pushpull.cpp | 303 +++ tests/test_spec_rep.cpp | 169 ++ tests/test_spec_req.cpp | 268 +++ tests/test_spec_router.cpp | 219 ++ tests/test_srcfd.cpp | 126 ++ tests/test_stream.cpp | 336 +++ tests/test_stream_disconnect.cpp | 299 +++ tests/test_stream_empty.cpp | 75 + tests/test_stream_exceeds_buffer.cpp | 124 ++ tests/test_stream_timeout.cpp | 234 ++ tests/test_sub_forward.cpp | 109 + tests/test_sub_forward_tipc.cpp | 102 + tests/test_system.cpp | 101 + tests/test_term_endpoint.cpp | 226 ++ tests/test_term_endpoint_tipc.cpp | 120 + tests/test_thread_safe.cpp | 90 + tests/test_timeo.cpp | 93 + tests/test_timers.cpp | 245 +++ tests/test_udp.cpp | 134 ++ tests/test_unbind_inproc.cpp | 43 + tests/test_unbind_wildcard.cpp | 216 ++ tests/test_use_fd_ipc.cpp | 222 ++ tests/test_use_fd_tcp.cpp | 237 ++ tests/test_xpub_manual.cpp | 597 +++++ tests/test_xpub_nodrop.cpp | 117 + tests/test_xpub_welcome_msg.cpp | 81 + tests/test_zmq_poll_fd.cpp | 99 + tests/testutil.hpp | 401 ++++ tests/testutil_security.hpp | 684 ++++++ tools/curve_keygen.cpp | 64 + unittests/CMakeLists.txt | 64 + unittests/unittest_poller.cpp | 218 ++ unittests/unittest_ypipe.cpp | 87 + version.sh | 21 + 795 files changed, 114661 insertions(+) commit e57afec80efc652ce563c4362534ac943267a503 Merge: a30133d c62574f Author: Luca Boccassi Date: Mon Feb 12 16:09:08 2018 +0000 Merge pull request #2943 from sigiesec/fix-select-unix Problem: data races in select/poll poller implementations commit c62574ffca7a7ec6c0196552c344fd9df92377a9 Author: Simon Giesecke Date: Fri Feb 9 20:36:41 2018 -0500 Problem: segfault in select_t::trigger_events Solution: fixed access to stale vector src/select.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) commit 11a53886370dd16a9623dbb225adab5c4336a95b Author: Simon Giesecke Date: Mon Feb 12 13:51:52 2018 +0100 Problem: data race w.r.t. select_t::stopping Solution: change termination condition of select_t src/select.cpp | 109 ++++++++++++++++++++++++++++++--------------------------- src/select.hpp | 21 +++-------- 2 files changed, 62 insertions(+), 68 deletions(-) commit e650240580d9d7ecb8fda0505eb8cdcf0a1c8350 Author: Simon Giesecke Date: Mon Feb 12 13:14:26 2018 +0100 Problem: data race w.r.t. poll_t::stopping Solution: remove stopping, stop on thread-safe conditions; add additional checks for correct thread-safe usage src/poll.cpp | 35 ++++++++++++++++++----------------- src/poll.hpp | 20 ++++---------------- src/poller_base.cpp | 28 ++++++++++++++++++++++++++++ src/poller_base.hpp | 27 +++++++++++++++++++++++++++ src/thread.cpp | 15 +++++++++++++++ src/thread.hpp | 7 +++++++ 6 files changed, 99 insertions(+), 33 deletions(-) commit 08201bc1b941f1e2cbd1767f652335ae84930401 Author: Simon Giesecke Date: Fri Feb 9 16:14:42 2018 -0500 Problem: select blocks forever under Unix Solution: fixed call of select, and initialization of poll_t members src/select.cpp | 14 +++++++------- src/select.hpp | 5 ----- 2 files changed, 7 insertions(+), 12 deletions(-) commit a30133d8f5e731e0cf5f635371a48ad4ea494a9d Merge: d0e01b4 9ec95f9 Author: Luca Boccassi Date: Mon Feb 12 11:01:08 2018 +0000 Merge pull request #2935 from ZMQers/unity-base Problem: no test framework, no unit tests commit d0e01b4bb25600dd3552660e25755466433b5ba1 Author: Luca Boccassi Date: Mon Feb 12 08:01:03 2018 +0000 Problem: regression with "select" on *nix (#2940) * Problem: build failure with select as polling mechanism Solution: cast mailbox_handle argument to (poller_t::handle_t) like in the reaper thread class. * Problem: build failure due to INT_MAX use without include Solution: include limits and climits in src/select.cpp where INT_MAX is used * Problem: build failure due to unused variable in select.cpp Solution: move the declaration of int rc inside the ifdef block where it is actually used * Problem: reference to wrong variable in select.cpp breaks build Solution: fix it * Problem: family_entry_t constructor has no body, build fails on *nix Solution: add empty inline function in the struct * Problem: no test coverage for poll and select Solution: add Travis jobs for them on Linux * Problem: Travis jobs cannot run in container infra Solution: set sudo: false as it is not required anymore .travis.yml | 6 +++++- ci_build.sh | 4 ++++ src/io_thread.cpp | 2 +- src/select.cpp | 7 ++++--- src/select.hpp | 4 ++++ 5 files changed, 18 insertions(+), 5 deletions(-) commit 9ec95f9d4666eadc9db1922a85d6a2bc5c397c35 Author: Simon Giesecke Date: Sun Feb 11 14:33:48 2018 +0100 Problem: build failure with VS <2015, has no snprintf Solution: use _snprintf when snprintf is not available tests/test_security_curve.cpp | 4 ++++ 1 file changed, 4 insertions(+) commit 29e304ea5c2309ebd44ded3cdf83aa0bc35e50ba Author: Luca Boccassi Date: Sun Feb 11 11:59:24 2018 +0000 Problem: unity license not mentioned in debian/copyright Solution: add it packaging/debian/copyright | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) commit 1478fd0022a034e3b286a3cf38afe5e8b122e1ae Author: Luca Boccassi Date: Sat Feb 10 19:18:33 2018 +0000 Problem: unittests not built with autotools Solution: add them to Makefile.am, linking to the static libzmq.a library and its dependencies Makefile.am | 26 +++++++++++++++++++++++++- configure.ac | 3 +++ 2 files changed, 28 insertions(+), 1 deletion(-) commit f6f67cbf96e09bd822751f92d728586d865e936f Author: Luca Boccassi Date: Sat Feb 10 18:51:51 2018 +0000 Problem: no autotools support for building with unity Solution: add a noinst convenience static library and use it with the tests that require it Makefile.am | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) commit 7ea924c76314d86d3191889b04477805b84f1005 Author: Simon Giesecke Date: Thu Feb 8 19:12:28 2018 +0100 Problem: segfault on thread_t::stop if thread was never started Solution: add started flag src/thread.cpp | 18 ++++++++++++------ src/thread.hpp | 3 +++ 2 files changed, 15 insertions(+), 6 deletions(-) commit 56c726d42566a2970e1778f6ecfa2c4be9db38a7 Author: Simon Giesecke Date: Thu Feb 8 17:48:15 2018 +0100 Problem: no unit tests Solution: set up initial unit tests .clang-format | 53 + .github/PULL_REQUEST_TEMPLATE.md | 28 + .github/issue_template.md | 22 + .gitignore | 180 ++ .hgeol | 2 + .mailmap | 81 + .travis.yml | 125 ++ AUTHORS | 151 ++ CMakeLists.txt | 1147 ++++++++++ COPYING | 674 ++++++ COPYING.LESSER | 181 ++ Dockerfile | 11 + Doxygen.cfg | 2320 ++++++++++++++++++++ INSTALL | 311 +++ Jenkinsfile | 485 ++++ Makefile.am | 958 ++++++++ NEWS | 1585 +++++++++++++ README.cygwin.md | 15 + README.doxygen.md | 48 + README.md | 102 + RELICENSE/AndreLouisCaron.md | 15 + RELICENSE/Asmod4n.md | 13 + RELICENSE/BerndPrager.md | 13 + RELICENSE/Bklyn.md | 15 + RELICENSE/BrianBuchanan.md | 15 + RELICENSE/ChuckRemes.md | 15 + RELICENSE/FrancoFichtner.md | 15 + RELICENSE/GavinMcNiff.md | 15 + RELICENSE/GhislainPutois.md | 15 + RELICENSE/GiuseppeCorbelli.md | 15 + RELICENSE/HaraldAchitz.md | 17 + RELICENSE/Hugne.md | 17 + RELICENSE/JimHague.md | 16 + RELICENSE/JohanMabille.md | 16 + RELICENSE/LeonardMichelet | 14 + RELICENSE/LeonardoConsoni.md | 15 + RELICENSE/LionelOrry.md | 15 + RELICENSE/OsirisPedroso.md | 15 + RELICENSE/README.md | 23 + RELICENSE/RobGagnon.md | 13 + RELICENSE/SebastienRombauts.md | 15 + RELICENSE/StoianIvanov.md | 15 + RELICENSE/SylvainCorlay.md | 16 + RELICENSE/TimotheeBesset.md | 15 + RELICENSE/VincentTellier.md | 15 + RELICENSE/VolodymyrKorniichuk.md | 15 + RELICENSE/abbradar.md | 16 + RELICENSE/agronholm.md | 15 + RELICENSE/amuraru.md | 15 + RELICENSE/arsenm.md | 15 + RELICENSE/aseering.md | 15 + RELICENSE/bjorntopel.md | 16 + RELICENSE/bjovke.md | 16 + RELICENSE/brocade_communications_systems.md | 15 + RELICENSE/brunobodin.md | 13 + RELICENSE/c-rack.md | 15 + RELICENSE/camachat.md | 15 + RELICENSE/cdolan.md | 15 + RELICENSE/chrisstaite.md | 14 + RELICENSE/chugga_fan.md | 15 + RELICENSE/cjuniet.md | 15 + RELICENSE/ckamm.md | 15 + RELICENSE/clkao.md | 15 + RELICENSE/danielhtshih.md | 15 + RELICENSE/danriegsecker.md | 16 + RELICENSE/dfons.md | 16 + RELICENSE/djelenc.md | 15 + RELICENSE/drodri.md | 15 + RELICENSE/eburkitt.md | 15 + RELICENSE/egomotion.md | 16 + RELICENSE/evoskuil.md | 15 + RELICENSE/febeling.md | 16 + RELICENSE/fidlej.md | 15 + RELICENSE/flub.md | 14 + RELICENSE/gena-moscow.md | 15 + RELICENSE/gonzus.md | 15 + RELICENSE/goodfella_ltd.md | 13 + RELICENSE/google.md | 13 + RELICENSE/ianbarber.md | 15 + RELICENSE/imatix.md | 23 + RELICENSE/jakecobb.md | 13 + RELICENSE/jemc.md | 15 + RELICENSE/jimklimov.md | 17 + RELICENSE/jkryl.md | 15 + RELICENSE/johntconklin.md | 15 + RELICENSE/jruffin.md | 14 + RELICENSE/kentzo.md | 15 + RELICENSE/kevinsapper.md | 13 + RELICENSE/kobolog.md | 12 + RELICENSE/kurdybacha.md | 15 + RELICENSE/linville.md | 15 + RELICENSE/loachfish.md | 15 + RELICENSE/lodagro.md | 15 + RELICENSE/madebr.md | 15 + RELICENSE/mattconnolly.md | 15 + RELICENSE/mauri-melato.md | 13 + RELICENSE/mditzel.md | 15 + RELICENSE/meox.md | 15 + RELICENSE/michael-fox.md | 16 + RELICENSE/michicc.md | 15 + RELICENSE/minrk.md | 15 + RELICENSE/mipaaa.md | 15 + RELICENSE/mkluwe.md | 15 + RELICENSE/montoyaedu.md | 15 + RELICENSE/naos_ltd.md | 19 + RELICENSE/natano.md | 15 + RELICENSE/olafmandel.md | 13 + RELICENSE/pijyoi.md | 13 + RELICENSE/ptroja.md | 14 + RELICENSE/reunanen.md | 15 + RELICENSE/reza-ebrahimi.md | 15 + RELICENSE/rikvdh.md | 15 + RELICENSE/rlenferink.md | 15 + RELICENSE/roalz.md | 13 + RELICENSE/rodgert.md | 17 + RELICENSE/rotty.md | 16 + RELICENSE/sabae.md | 15 + RELICENSE/scemama.md | 15 + RELICENSE/sheremetyev.md | 13 + RELICENSE/shripchenko.md | 15 + RELICENSE/sigiesec.md | 17 + RELICENSE/soulik.md | 15 + RELICENSE/swansontec.md | 15 + RELICENSE/t-b.md | 15 + RELICENSE/tSed.md | 15 + RELICENSE/tabe.md | 15 + RELICENSE/tailhook.md | 16 + RELICENSE/taotetek.md | 13 + .../templates/relicense-template-mplv2-any-osi.txt | 15 + .../relicense-template-mplv2-share-alike-osi.txt | 15 + RELICENSE/templates/relicense-template-mplv2.txt | 13 + RELICENSE/thompsa.md | 15 + RELICENSE/torehalvorsen.md | 15 + RELICENSE/twhittock.md | 15 + RELICENSE/ulikoehler.md | 16 + RELICENSE/vyskocilm.md | 7 + RELICENSE/willstrang.md | 15 + RELICENSE/xaqq.md | 13 + RELICENSE/yuvallanger.md | 15 + acinclude.m4 | 1122 ++++++++++ appveyor.yml | 106 + autogen.sh | 49 + branding.bmp | Bin 0 -> 25818 bytes builds/Makefile.am | 29 + builds/README | 4 + builds/android/Dockerfile | 22 + builds/android/README.md | 78 + builds/android/android_build_helper.sh | 316 +++ builds/android/build.sh | 70 + builds/android/ci_build.sh | 30 + builds/cmake/Modules/ClangFormat.cmake | 41 + builds/cmake/Modules/FindAsciiDoc.cmake | 26 + builds/cmake/Modules/FindSodium.cmake | 40 + builds/cmake/Modules/TestZMQVersion.cmake | 8 + builds/cmake/Modules/ZMQSourceRunChecks.cmake | 301 +++ builds/cmake/NSIS.template32.in | 952 ++++++++ builds/cmake/NSIS.template64.in | 960 ++++++++ builds/cmake/ZeroMQConfig.cmake.in | 25 + builds/cmake/ci_build.sh | 48 + builds/cmake/clang-format-check.sh.in | 14 + builds/cmake/platform.hpp.in | 104 + builds/coverage/ci_build.sh | 32 + builds/cygwin/Makefile.cygwin | 48 + builds/gyp/.gitignore | 5 + builds/gyp/build.bat | 4 + builds/gyp/platform.hpp | 80 + builds/gyp/project-tests.gsl | 19 + builds/gyp/project-tests.gypi | 895 ++++++++ builds/gyp/project-tests.xml | 83 + builds/gyp/project.gyp | 295 +++ builds/mingw32/Makefile.mingw32 | 49 + builds/mingw32/platform.hpp | 43 + builds/msvc/.gitignore | 256 +++ builds/msvc/Makefile.am | 94 + builds/msvc/build/build.bat | 33 + builds/msvc/build/buildall.bat | 16 + builds/msvc/build/buildbase.bat | 73 + builds/msvc/errno.cpp | 32 + builds/msvc/errno.hpp | 56 + builds/msvc/platform.hpp | 14 + builds/msvc/properties/Common.props | 21 + builds/msvc/properties/DLL.props | 16 + builds/msvc/properties/Debug.props | 29 + builds/msvc/properties/DebugDEXE.props | 21 + builds/msvc/properties/DebugDLL.props | 20 + builds/msvc/properties/DebugLEXE.props | 20 + builds/msvc/properties/DebugLIB.props | 21 + builds/msvc/properties/DebugLTCG.props | 20 + builds/msvc/properties/DebugSEXE.props | 21 + builds/msvc/properties/EXE.props | 17 + builds/msvc/properties/LIB.props | 16 + builds/msvc/properties/LTCG.props | 13 + builds/msvc/properties/Link.props | 21 + builds/msvc/properties/Messages.props | 15 + builds/msvc/properties/Output.props | 30 + builds/msvc/properties/Release.props | 41 + builds/msvc/properties/ReleaseDEXE.props | 20 + builds/msvc/properties/ReleaseDLL.props | 19 + builds/msvc/properties/ReleaseLEXE.props | 20 + builds/msvc/properties/ReleaseLIB.props | 19 + builds/msvc/properties/ReleaseLTCG.props | 19 + builds/msvc/properties/ReleaseSEXE.props | 20 + builds/msvc/properties/Win32.props | 20 + builds/msvc/properties/x64.props | 23 + builds/msvc/readme.txt | 27 + builds/msvc/resource.h | 14 + builds/msvc/resource.rc | Bin 0 -> 4650 bytes builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj | 52 + builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj | 52 + builds/msvc/vs2008/libzmq.sln | 95 + builds/msvc/vs2008/libzmq/libzmq.vcproj | 338 +++ builds/msvc/vs2008/local_lat/local_lat.vcproj | 52 + builds/msvc/vs2008/local_thr/local_thr.vcproj | 52 + builds/msvc/vs2008/remote_lat/remote_lat.vcproj | 52 + builds/msvc/vs2008/remote_thr/remote_thr.vcproj | 52 + builds/msvc/vs2010/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2010/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2010/libsodium.import.props | 52 + builds/msvc/vs2010/libsodium.import.xml | 17 + builds/msvc/vs2010/libzmq.import.props | 64 + builds/msvc/vs2010/libzmq.import.xml | 49 + builds/msvc/vs2010/libzmq.sln | 206 ++ builds/msvc/vs2010/libzmq/libzmq.props | 76 + builds/msvc/vs2010/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2010/libzmq/libzmq.xml | 40 + builds/msvc/vs2010/local_lat/local_lat.props | 49 + builds/msvc/vs2010/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2010/local_thr/local_thr.props | 49 + builds/msvc/vs2010/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2010/remote_lat/remote_lat.props | 49 + builds/msvc/vs2010/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2010/remote_thr/remote_thr.props | 49 + builds/msvc/vs2010/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2012/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2012/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2012/libsodium.import.props | 52 + builds/msvc/vs2012/libsodium.import.xml | 17 + builds/msvc/vs2012/libzmq.import.props | 64 + builds/msvc/vs2012/libzmq.import.xml | 49 + builds/msvc/vs2012/libzmq.sln | 206 ++ builds/msvc/vs2012/libzmq/libzmq.props | 76 + builds/msvc/vs2012/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2012/libzmq/libzmq.xml | 40 + builds/msvc/vs2012/local_lat/local_lat.props | 49 + builds/msvc/vs2012/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2012/local_thr/local_thr.props | 49 + builds/msvc/vs2012/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2012/remote_lat/remote_lat.props | 49 + builds/msvc/vs2012/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2012/remote_thr/remote_thr.props | 49 + builds/msvc/vs2012/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2013/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2013/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2013/libsodium.import.props | 52 + builds/msvc/vs2013/libsodium.import.xml | 17 + builds/msvc/vs2013/libzmq.import.props | 64 + builds/msvc/vs2013/libzmq.import.xml | 49 + builds/msvc/vs2013/libzmq.sln | 208 ++ builds/msvc/vs2013/libzmq/libzmq.props | 76 + builds/msvc/vs2013/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2013/libzmq/libzmq.xml | 40 + builds/msvc/vs2013/local_lat/local_lat.props | 49 + builds/msvc/vs2013/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2013/local_thr/local_thr.props | 49 + builds/msvc/vs2013/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2013/remote_lat/remote_lat.props | 49 + builds/msvc/vs2013/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2013/remote_thr/remote_thr.props | 49 + builds/msvc/vs2013/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2015/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2015/libsodium.import.props | 52 + builds/msvc/vs2015/libsodium.import.xml | 17 + builds/msvc/vs2015/libzmq.import.props | 64 + builds/msvc/vs2015/libzmq.import.xml | 49 + builds/msvc/vs2015/libzmq.sln | 208 ++ builds/msvc/vs2015/libzmq/libzmq.props | 76 + builds/msvc/vs2015/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2015/libzmq/libzmq.xml | 40 + builds/msvc/vs2015/local_lat/local_lat.props | 49 + builds/msvc/vs2015/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2015/local_thr/local_thr.props | 49 + builds/msvc/vs2015/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2015/remote_lat/remote_lat.props | 49 + builds/msvc/vs2015/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2015/remote_thr/remote_thr.props | 49 + builds/msvc/vs2015/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015_xp/libzmq.vcxproj | 258 +++ builds/msvc/vs2015_xp/platform.hpp | 15 + .../msvc/vs2015_xp/test_zmq/test_multithread.cpp | 229 ++ builds/msvc/vs2015_xp/test_zmq/test_zmq.vcxproj | 155 ++ builds/msvc/vs2017/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2017/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2017/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2017/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2017/libsodium.import.props | 52 + builds/msvc/vs2017/libsodium.import.xml | 17 + builds/msvc/vs2017/libzmq.import.props | 64 + builds/msvc/vs2017/libzmq.import.xml | 49 + builds/msvc/vs2017/libzmq.sln | 208 ++ builds/msvc/vs2017/libzmq/libzmq.props | 76 + builds/msvc/vs2017/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2017/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2017/libzmq/libzmq.xml | 40 + builds/msvc/vs2017/local_lat/local_lat.props | 49 + builds/msvc/vs2017/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2017/local_thr/local_thr.props | 49 + builds/msvc/vs2017/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2017/remote_lat/remote_lat.props | 49 + builds/msvc/vs2017/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2017/remote_thr/remote_thr.props | 49 + builds/msvc/vs2017/remote_thr/remote_thr.vcxproj | 82 + builds/nuget/libzmq.autopkg | 52 + builds/nuget/readme.nuget | 20 + builds/openwrt/Makefile | 70 + builds/valgrind/ci_build.sh | 30 + builds/valgrind/valgrind.supp | 22 + builds/valgrind/vg | 1 + builds/zos/README.md | 463 ++++ builds/zos/cxxall | 62 + builds/zos/makeclean | 36 + builds/zos/makelibzmq | 54 + builds/zos/maketests | 102 + builds/zos/platform.hpp | 300 +++ builds/zos/runtests | 188 ++ builds/zos/test_fork.cpp | 95 + builds/zos/zc++ | 42 + ci_build.sh | 66 + ci_deploy.sh | 34 + configure.ac | 841 +++++++ doc/Makefile.am | 64 + doc/asciidoc.conf | 56 + doc/zmq.txt | 276 +++ doc/zmq_atomic_counter_dec.txt | 62 + doc/zmq_atomic_counter_destroy.txt | 62 + doc/zmq_atomic_counter_inc.txt | 61 + doc/zmq_atomic_counter_new.txt | 62 + doc/zmq_atomic_counter_set.txt | 61 + doc/zmq_atomic_counter_value.txt | 62 + doc/zmq_bind.txt | 103 + doc/zmq_close.txt | 56 + doc/zmq_connect.txt | 101 + doc/zmq_ctx_destroy.txt | 67 + doc/zmq_ctx_get.txt | 105 + doc/zmq_ctx_new.txt | 50 + doc/zmq_ctx_set.txt | 184 ++ doc/zmq_ctx_shutdown.txt | 52 + doc/zmq_ctx_term.txt | 68 + doc/zmq_curve.txt | 92 + doc/zmq_curve_keypair.txt | 56 + doc/zmq_curve_public.txt | 62 + doc/zmq_disconnect.txt | 75 + doc/zmq_errno.txt | 50 + doc/zmq_getsockopt.txt | 944 ++++++++ doc/zmq_gssapi.txt | 78 + doc/zmq_has.txt | 44 + doc/zmq_init.txt | 52 + doc/zmq_inproc.txt | 88 + doc/zmq_ipc.txt | 106 + doc/zmq_msg_close.txt | 56 + doc/zmq_msg_copy.txt | 72 + doc/zmq_msg_data.txt | 48 + doc/zmq_msg_get.txt | 83 + doc/zmq_msg_gets.txt | 81 + doc/zmq_msg_init.txt | 64 + doc/zmq_msg_init_data.txt | 89 + doc/zmq_msg_init_size.txt | 58 + doc/zmq_msg_more.txt | 65 + doc/zmq_msg_move.txt | 52 + doc/zmq_msg_recv.txt | 124 ++ doc/zmq_msg_routing_id.txt | 61 + doc/zmq_msg_send.txt | 127 ++ doc/zmq_msg_set.txt | 46 + doc/zmq_msg_set_routing_id.txt | 46 + doc/zmq_msg_size.txt | 48 + doc/zmq_null.txt | 27 + doc/zmq_pgm.txt | 164 ++ doc/zmq_plain.txt | 37 + doc/zmq_poll.txt | 135 ++ doc/zmq_proxy.txt | 99 + doc/zmq_proxy_steerable.txt | 111 + doc/zmq_recv.txt | 91 + doc/zmq_recvmsg.txt | 121 + doc/zmq_send.txt | 104 + doc/zmq_send_const.txt | 103 + doc/zmq_sendmsg.txt | 121 + doc/zmq_setsockopt.txt | 1318 +++++++++++ doc/zmq_socket.txt | 609 +++++ doc/zmq_socket_monitor.txt | 294 +++ doc/zmq_strerror.txt | 56 + doc/zmq_tcp.txt | 118 + doc/zmq_term.txt | 66 + doc/zmq_tipc.txt | 83 + doc/zmq_udp.txt | 99 + doc/zmq_unbind.txt | 90 + doc/zmq_version.txt | 54 + doc/zmq_vmci.txt | 97 + doc/zmq_z85_decode.txt | 51 + doc/zmq_z85_encode.txt | 58 + external/unity/license.txt | 21 + external/unity/unity.c | 1570 +++++++++++++ external/unity/unity.h | 503 +++++ external/unity/unity_internals.h | 872 ++++++++ external/unity/version.txt | 1 + include/zmq.h | 732 ++++++ include/zmq_utils.h | 50 + installer.ico | Bin 0 -> 2842 bytes m4/ax_check_compile_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 +++ m4/ax_cxx_compile_stdcxx.m4 | 562 +++++ m4/ax_cxx_compile_stdcxx_11.m4 | 40 + m4/ax_valgrind_check.m4 | 233 ++ packaging/README | 4 + packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 64 + packaging/debian/copyright | 93 + packaging/debian/libzmq3-dev.install | 4 + packaging/debian/libzmq3-dev.manpages | 2 + packaging/debian/libzmq5.docs | 2 + packaging/debian/libzmq5.install | 1 + packaging/debian/rules | 67 + packaging/debian/source/format | 1 + packaging/debian/zeromq.dsc.obs | 15 + packaging/nuget/package.bat | 14 + packaging/nuget/package.config | 6 + packaging/nuget/package.gsl | 264 +++ packaging/nuget/package.nuspec | 98 + packaging/nuget/package.targets | 129 ++ packaging/nuget/package.xml | 22 + packaging/obs/_service | 98 + packaging/redhat/zeromq.spec | 234 ++ perf/inproc_lat.cpp | 238 ++ perf/inproc_thr.cpp | 247 +++ perf/local_lat.cpp | 116 + perf/local_thr.cpp | 161 ++ perf/remote_lat.cpp | 129 ++ perf/remote_thr.cpp | 138 ++ src/address.cpp | 129 ++ src/address.hpp | 81 + src/array.hpp | 135 ++ src/atomic_counter.hpp | 235 ++ src/atomic_ptr.hpp | 301 +++ src/blob.hpp | 186 ++ src/client.cpp | 115 + src/client.hpp | 75 + src/clock.cpp | 258 +++ src/clock.hpp | 79 + src/command.hpp | 204 ++ src/condition_variable.hpp | 250 +++ src/config.hpp | 96 + src/ctx.cpp | 696 ++++++ src/ctx.hpp | 263 +++ src/curve_client.cpp | 290 +++ src/curve_client.hpp | 84 + src/curve_client_tools.hpp | 305 +++ src/curve_mechanism_base.cpp | 179 ++ src/curve_mechanism_base.hpp | 79 + src/curve_server.cpp | 492 +++++ src/curve_server.hpp | 91 + src/dbuffer.hpp | 141 ++ src/dealer.cpp | 145 ++ src/dealer.hpp | 83 + src/decoder.hpp | 193 ++ src/decoder_allocators.cpp | 151 ++ src/decoder_allocators.hpp | 131 ++ src/devpoll.cpp | 203 ++ src/devpoll.hpp | 115 + src/dgram.cpp | 175 ++ src/dgram.hpp | 76 + src/dish.cpp | 368 ++++ src/dish.hpp | 121 + src/dist.cpp | 228 ++ src/dist.hpp | 116 + src/encoder.hpp | 180 ++ src/epoll.cpp | 207 ++ src/epoll.hpp | 115 + src/err.cpp | 467 ++++ src/err.hpp | 173 ++ src/fd.hpp | 61 + src/fq.cpp | 156 ++ src/fq.hpp | 88 + src/gather.cpp | 93 + src/gather.hpp | 68 + src/gssapi_client.cpp | 236 ++ src/gssapi_client.hpp | 92 + src/gssapi_mechanism_base.cpp | 402 ++++ src/gssapi_mechanism_base.hpp | 132 ++ src/gssapi_server.cpp | 248 +++ src/gssapi_server.hpp | 92 + src/i_decoder.hpp | 60 + src/i_encoder.hpp | 57 + src/i_engine.hpp | 65 + src/i_mailbox.hpp | 57 + src/i_poll_events.hpp | 53 + src/io_object.cpp | 116 + src/io_object.hpp | 84 + src/io_thread.cpp | 119 + src/io_thread.hpp | 95 + src/ip.cpp | 231 ++ src/ip.hpp | 62 + src/ipc_address.cpp | 107 + src/ipc_address.hpp | 68 + src/ipc_connecter.cpp | 275 +++ src/ipc_connecter.hpp | 135 ++ src/ipc_listener.cpp | 434 ++++ src/ipc_listener.hpp | 118 + src/kqueue.cpp | 227 ++ src/kqueue.hpp | 123 ++ src/lb.cpp | 165 ++ src/lb.hpp | 84 + src/libzmq.pc.cmake.in | 11 + src/libzmq.pc.in | 11 + src/libzmq.vers | 4 + src/likely.hpp | 42 + src/macros.hpp | 13 + src/mailbox.cpp | 106 + src/mailbox.hpp | 88 + src/mailbox_safe.cpp | 117 + src/mailbox_safe.hpp | 90 + src/mechanism.cpp | 329 +++ src/mechanism.hpp | 144 ++ src/mechanism_base.cpp | 69 + src/mechanism_base.hpp | 54 + src/metadata.cpp | 58 + src/metadata.hpp | 69 + src/msg.cpp | 566 +++++ src/msg.hpp | 273 +++ src/mtrie.cpp | 422 ++++ src/mtrie.hpp | 103 + src/mutex.hpp | 177 ++ src/norm_engine.cpp | 714 ++++++ src/norm_engine.hpp | 185 ++ src/null_mechanism.cpp | 213 ++ src/null_mechanism.hpp | 71 + src/object.cpp | 478 ++++ src/object.hpp | 149 ++ src/options.cpp | 1100 ++++++++++ src/options.hpp | 257 +++ src/own.cpp | 214 ++ src/own.hpp | 149 ++ src/pair.cpp | 141 ++ src/pair.hpp | 73 + src/pgm_receiver.cpp | 304 +++ src/pgm_receiver.hpp | 143 ++ src/pgm_sender.cpp | 251 +++ src/pgm_sender.hpp | 122 + src/pgm_socket.cpp | 687 ++++++ src/pgm_socket.hpp | 128 ++ src/pipe.cpp | 550 +++++ src/pipe.hpp | 258 +++ src/plain_client.cpp | 217 ++ src/plain_client.hpp | 73 + src/plain_server.cpp | 258 +++ src/plain_server.hpp | 67 + src/poll.cpp | 208 ++ src/poll.hpp | 119 + src/poller.hpp | 64 + src/poller_base.cpp | 108 + src/poller_base.hpp | 90 + src/pollset.cpp | 254 +++ src/pollset.hpp | 117 + src/precompiled.cpp | 30 + src/precompiled.hpp | 124 ++ src/proxy.cpp | 656 ++++++ src/proxy.hpp | 42 + src/pub.cpp | 67 + src/pub.hpp | 59 + src/pull.cpp | 78 + src/pull.hpp | 68 + src/push.cpp | 77 + src/push.hpp | 67 + src/radio.cpp | 277 +++ src/radio.hpp | 115 + src/random.cpp | 119 + src/random.hpp | 51 + src/raw_decoder.cpp | 74 + src/raw_decoder.hpp | 70 + src/raw_encoder.cpp | 51 + src/raw_encoder.hpp | 60 + src/reaper.cpp | 149 ++ src/reaper.hpp | 90 + src/rep.cpp | 133 ++ src/rep.hpp | 68 + src/req.cpp | 326 +++ src/req.hpp | 117 + src/router.cpp | 548 +++++ src/router.hpp | 141 ++ src/scatter.cpp | 83 + src/scatter.hpp | 67 + src/select.cpp | 607 +++++ src/select.hpp | 187 ++ src/server.cpp | 182 ++ src/server.hpp | 90 + src/session_base.cpp | 710 ++++++ src/session_base.hpp | 172 ++ src/signaler.cpp | 696 ++++++ src/signaler.hpp | 93 + src/socket_base.cpp | 1778 +++++++++++++++ src/socket_base.hpp | 304 +++ src/socket_poller.cpp | 683 ++++++ src/socket_poller.hpp | 146 ++ src/socks.cpp | 290 +++ src/socks.hpp | 133 ++ src/socks_connecter.cpp | 466 ++++ src/socks_connecter.hpp | 171 ++ src/stdint.hpp | 77 + src/stream.cpp | 319 +++ src/stream.hpp | 104 + src/stream_engine.cpp | 1095 +++++++++ src/stream_engine.hpp | 238 ++ src/sub.cpp | 87 + src/sub.hpp | 59 + src/tcp.cpp | 358 +++ src/tcp.hpp | 73 + src/tcp_address.cpp | 904 ++++++++ src/tcp_address.hpp | 121 + src/tcp_connecter.cpp | 425 ++++ src/tcp_connecter.hpp | 139 ++ src/tcp_listener.cpp | 366 +++ src/tcp_listener.hpp | 95 + src/thread.cpp | 245 +++ src/thread.hpp | 100 + src/timers.cpp | 199 ++ src/timers.hpp | 109 + src/tipc_address.cpp | 123 ++ src/tipc_address.hpp | 70 + src/tipc_connecter.cpp | 266 +++ src/tipc_connecter.hpp | 137 ++ src/tipc_listener.cpp | 192 ++ src/tipc_listener.hpp | 103 + src/trie.cpp | 321 +++ src/trie.hpp | 85 + src/tweetnacl.c | 988 +++++++++ src/tweetnacl.h | 78 + src/udp_address.cpp | 170 ++ src/udp_address.hpp | 77 + src/udp_engine.cpp | 391 ++++ src/udp_engine.hpp | 73 + src/v1_decoder.cpp | 152 ++ src/v1_decoder.hpp | 64 + src/v1_encoder.cpp | 75 + src/v1_encoder.hpp | 56 + src/v2_decoder.cpp | 162 ++ src/v2_decoder.hpp | 72 + src/v2_encoder.cpp | 77 + src/v2_encoder.hpp | 56 + src/v2_protocol.hpp | 49 + src/version.rc.in | 93 + src/vmci.cpp | 100 + src/vmci.hpp | 66 + src/vmci_address.cpp | 167 ++ src/vmci_address.hpp | 71 + src/vmci_connecter.cpp | 298 +++ src/vmci_connecter.hpp | 137 ++ src/vmci_listener.cpp | 266 +++ src/vmci_listener.hpp | 98 + src/windows.hpp | 97 + src/wire.hpp | 96 + src/xpub.cpp | 320 +++ src/xpub.hpp | 121 + src/xsub.cpp | 248 +++ src/xsub.hpp | 96 + src/ypipe.hpp | 211 ++ src/ypipe_base.hpp | 54 + src/ypipe_conflate.hpp | 119 + src/yqueue.hpp | 215 ++ src/zap_client.cpp | 305 +++ src/zap_client.hpp | 101 + src/zmq.cpp | 1546 +++++++++++++ src/zmq_draft.h | 189 ++ src/zmq_utils.cpp | 321 +++ tests/CMakeLists.txt | 228 ++ tests/README.md | 28 + tests/test_abstract_ipc.cpp | 67 + tests/test_ancillaries.cpp | 50 + tests/test_atomics.cpp | 48 + tests/test_base85.cpp | 164 ++ tests/test_bind_after_connect_tcp.cpp | 97 + tests/test_bind_src_address.cpp | 57 + tests/test_capabilities.cpp | 82 + tests/test_client_server.cpp | 106 + tests/test_conflate.cpp | 86 + tests/test_connect_delay_tipc.cpp | 238 ++ tests/test_connect_resolve.cpp | 70 + tests/test_connect_rid.cpp | 201 ++ tests/test_ctx_destroy.cpp | 110 + tests/test_ctx_options.cpp | 211 ++ tests/test_dgram.cpp | 99 + tests/test_diffserv.cpp | 84 + tests/test_disconnect_inproc.cpp | 151 ++ tests/test_filter_ipc.cpp | 164 ++ tests/test_fork.cpp | 98 + tests/test_getsockopt_memset.cpp | 64 + tests/test_heartbeats.cpp | 346 +++ tests/test_hwm.cpp | 321 +++ tests/test_hwm_pubsub.cpp | 248 +++ tests/test_immediate.cpp | 250 +++ tests/test_inproc_connect.cpp | 529 +++++ tests/test_invalid_rep.cpp | 97 + tests/test_iov.cpp | 156 ++ tests/test_ipc_wildcard.cpp | 65 + tests/test_issue_566.cpp | 99 + tests/test_last_endpoint.cpp | 65 + tests/test_many_sockets.cpp | 100 + tests/test_metadata.cpp | 130 ++ tests/test_monitor.cpp | 116 + tests/test_msg_ffn.cpp | 146 ++ tests/test_msg_flags.cpp | 126 ++ tests/test_pair_inproc.cpp | 81 + tests/test_pair_ipc.cpp | 60 + tests/test_pair_tcp.cpp | 92 + tests/test_pair_tipc.cpp | 62 + tests/test_pair_vmci.cpp | 68 + tests/test_poller.cpp | 413 ++++ tests/test_probe_router.cpp | 86 + tests/test_proxy.cpp | 503 +++++ tests/test_proxy_single_socket.cpp | 119 + tests/test_proxy_terminate.cpp | 131 ++ tests/test_pub_invert_matching.cpp | 136 ++ tests/test_radio_dish.cpp | 192 ++ tests/test_rebind_ipc.cpp | 84 + tests/test_reconnect_ivl.cpp | 149 ++ tests/test_req_correlate.cpp | 140 ++ tests/test_req_relaxed.cpp | 220 ++ tests/test_reqrep_device.cpp | 153 ++ tests/test_reqrep_device_tipc.cpp | 146 ++ tests/test_reqrep_inproc.cpp | 60 + tests/test_reqrep_ipc.cpp | 112 + tests/test_reqrep_tcp.cpp | 336 +++ tests/test_reqrep_tipc.cpp | 61 + tests/test_reqrep_vmci.cpp | 68 + tests/test_router_handover.cpp | 117 + tests/test_router_mandatory.cpp | 292 +++ tests/test_router_mandatory_hwm.cpp | 136 ++ tests/test_router_mandatory_tipc.cpp | 71 + tests/test_scatter_gather.cpp | 84 + tests/test_security_curve.cpp | 686 ++++++ tests/test_security_gssapi.cpp | 370 ++++ tests/test_security_null.cpp | 207 ++ tests/test_security_plain.cpp | 213 ++ tests/test_security_zap.cpp | 417 ++++ tests/test_setsockopt.cpp | 153 ++ tests/test_shutdown_stress.cpp | 100 + tests/test_shutdown_stress_tipc.cpp | 93 + tests/test_socket_null.cpp | 146 ++ tests/test_sockopt_hwm.cpp | 193 ++ tests/test_sodium.cpp | 99 + tests/test_spec_dealer.cpp | 267 +++ tests/test_spec_pushpull.cpp | 303 +++ tests/test_spec_rep.cpp | 169 ++ tests/test_spec_req.cpp | 268 +++ tests/test_spec_router.cpp | 219 ++ tests/test_srcfd.cpp | 126 ++ tests/test_stream.cpp | 336 +++ tests/test_stream_disconnect.cpp | 299 +++ tests/test_stream_empty.cpp | 75 + tests/test_stream_exceeds_buffer.cpp | 124 ++ tests/test_stream_timeout.cpp | 234 ++ tests/test_sub_forward.cpp | 109 + tests/test_sub_forward_tipc.cpp | 102 + tests/test_system.cpp | 101 + tests/test_term_endpoint.cpp | 226 ++ tests/test_term_endpoint_tipc.cpp | 120 + tests/test_thread_safe.cpp | 90 + tests/test_timeo.cpp | 93 + tests/test_timers.cpp | 245 +++ tests/test_udp.cpp | 134 ++ tests/test_unbind_inproc.cpp | 43 + tests/test_unbind_wildcard.cpp | 216 ++ tests/test_use_fd_ipc.cpp | 222 ++ tests/test_use_fd_tcp.cpp | 237 ++ tests/test_xpub_manual.cpp | 597 +++++ tests/test_xpub_nodrop.cpp | 117 + tests/test_xpub_welcome_msg.cpp | 81 + tests/test_zmq_poll_fd.cpp | 99 + tests/testutil.hpp | 401 ++++ tests/testutil_security.hpp | 684 ++++++ tools/curve_keygen.cpp | 64 + unittests/CMakeLists.txt | 64 + unittests/unittest_poller.cpp | 47 + unittests/unittest_ypipe.cpp | 46 + version.sh | 21 + 795 files changed, 114138 insertions(+) commit afd5d9f721b6de0068c6f86a10d99f1e86eda029 Merge: ac777ba 5873894 Author: Luca Boccassi Date: Sun Feb 11 17:06:36 2018 +0000 Merge pull request #2939 from sigiesec/fix-poll-timer-event-retiring Fixed a deadlock and an assertion failure in poll_t commit 5873894c8364332f89902e5e39f0bde2c22bef1e Author: Simon Giesecke Date: Sun Feb 11 12:19:20 2018 +0100 Problem: wrong assertion macro used on Windows Solution: use wsa_assert instead of errno_assert src/poll.cpp | 4 ++++ 1 file changed, 4 insertions(+) commit 2f27bcd74bcd335f8dac4eb97b7c92e1d2309c9d Author: Simon Giesecke Date: Sun Feb 11 13:45:40 2018 +0100 Problem: assertion failure in poll_t::poll if timer_event retired a pollset entry Solution: clean up retired entries before poll src/poll.cpp | 27 ++++++++++++++++----------- src/poll.hpp | 2 ++ 2 files changed, 18 insertions(+), 11 deletions(-) commit a2af3d18cc81a13ae894d9068cf0c20192bb132a Author: Simon Giesecke Date: Sun Feb 11 13:15:37 2018 +0100 Problem: unittest_poller fails for poll_t Solution: fixed behaviour in corner cases src/poll.cpp | 6 ++++++ 1 file changed, 6 insertions(+) commit ac777bad946d2082606ed4abdedcce89256340f3 Merge: 504e6d0 d832267 Author: Simon Giesecke Date: Sat Feb 10 15:26:53 2018 -0500 Merge pull request #2938 from bluca/format_autotools Problem: make format-check not implemented with autotools commit 504e6d0ecca596d6dd912503ffbb6a4d9584197a Merge: c33cb38 9b1ce59 Author: Simon Giesecke Date: Sat Feb 10 15:25:54 2018 -0500 Merge pull request #2937 from bluca/gcc_4_build Problem: DRAFT build broken with GCC 4.7 commit d832267e2367e6377a08501c6a590a63460f6e1d Author: Luca Boccassi Date: Sat Feb 10 17:34:01 2018 +0000 Problem: make format-check not implemented with autotools Solution: port implementation from zproject Makefile.am | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 13 +++++++++++++ 2 files changed, 64 insertions(+) commit 9b1ce597199a22b82dd6579fd61a958c780c58d2 Author: Luca Boccassi Date: Sat Feb 10 17:08:01 2018 +0000 Problem: DRAFT build broken with GCC 4.7 Solution: change variable type in test_timers to match public API tests/test_timers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c33cb38af28612d9d87dcafd16f94178ab635514 Merge: eded1f8 a57f7e3 Author: Luca Boccassi Date: Fri Feb 9 17:15:47 2018 +0000 Merge pull request #2928 from eponsko/master Add support for ZMQ_XPUB_NODROP on ZMQ_RADIO sockets commit eded1f8b9076e7512be9a929d8562efed93eda37 Author: Luca Boccassi Date: Fri Feb 9 17:08:51 2018 +0000 Merge pull request #2923 from sigiesec/fastpath Add support for SIO_LOOPBACK_FAST_PATH on Windows .clang-format | 53 + .github/PULL_REQUEST_TEMPLATE.md | 28 + .github/issue_template.md | 22 + .gitignore | 180 ++ .hgeol | 2 + .mailmap | 81 + .travis.yml | 125 ++ AUTHORS | 151 ++ CMakeLists.txt | 1142 ++++++++++ COPYING | 674 ++++++ COPYING.LESSER | 181 ++ Dockerfile | 11 + Doxygen.cfg | 2320 ++++++++++++++++++++ INSTALL | 311 +++ Jenkinsfile | 485 ++++ Makefile.am | 907 ++++++++ NEWS | 1585 +++++++++++++ README.cygwin.md | 15 + README.doxygen.md | 48 + README.md | 102 + RELICENSE/AndreLouisCaron.md | 15 + RELICENSE/Asmod4n.md | 13 + RELICENSE/BerndPrager.md | 13 + RELICENSE/Bklyn.md | 15 + RELICENSE/BrianBuchanan.md | 15 + RELICENSE/ChuckRemes.md | 15 + RELICENSE/FrancoFichtner.md | 15 + RELICENSE/GavinMcNiff.md | 15 + RELICENSE/GhislainPutois.md | 15 + RELICENSE/GiuseppeCorbelli.md | 15 + RELICENSE/HaraldAchitz.md | 17 + RELICENSE/Hugne.md | 17 + RELICENSE/JimHague.md | 16 + RELICENSE/JohanMabille.md | 16 + RELICENSE/LeonardMichelet | 14 + RELICENSE/LeonardoConsoni.md | 15 + RELICENSE/LionelOrry.md | 15 + RELICENSE/OsirisPedroso.md | 15 + RELICENSE/README.md | 23 + RELICENSE/RobGagnon.md | 13 + RELICENSE/SebastienRombauts.md | 15 + RELICENSE/StoianIvanov.md | 15 + RELICENSE/SylvainCorlay.md | 16 + RELICENSE/TimotheeBesset.md | 15 + RELICENSE/VincentTellier.md | 15 + RELICENSE/VolodymyrKorniichuk.md | 15 + RELICENSE/abbradar.md | 16 + RELICENSE/agronholm.md | 15 + RELICENSE/amuraru.md | 15 + RELICENSE/arsenm.md | 15 + RELICENSE/aseering.md | 15 + RELICENSE/bjorntopel.md | 16 + RELICENSE/bjovke.md | 16 + RELICENSE/brocade_communications_systems.md | 15 + RELICENSE/brunobodin.md | 13 + RELICENSE/c-rack.md | 15 + RELICENSE/camachat.md | 15 + RELICENSE/cdolan.md | 15 + RELICENSE/chrisstaite.md | 14 + RELICENSE/chugga_fan.md | 15 + RELICENSE/cjuniet.md | 15 + RELICENSE/ckamm.md | 15 + RELICENSE/clkao.md | 15 + RELICENSE/danielhtshih.md | 15 + RELICENSE/danriegsecker.md | 16 + RELICENSE/dfons.md | 16 + RELICENSE/djelenc.md | 15 + RELICENSE/drodri.md | 15 + RELICENSE/eburkitt.md | 15 + RELICENSE/egomotion.md | 16 + RELICENSE/evoskuil.md | 15 + RELICENSE/febeling.md | 16 + RELICENSE/fidlej.md | 15 + RELICENSE/flub.md | 14 + RELICENSE/gena-moscow.md | 15 + RELICENSE/gonzus.md | 15 + RELICENSE/goodfella_ltd.md | 13 + RELICENSE/google.md | 13 + RELICENSE/ianbarber.md | 15 + RELICENSE/imatix.md | 23 + RELICENSE/jakecobb.md | 13 + RELICENSE/jemc.md | 15 + RELICENSE/jimklimov.md | 17 + RELICENSE/jkryl.md | 15 + RELICENSE/johntconklin.md | 15 + RELICENSE/jruffin.md | 14 + RELICENSE/kentzo.md | 15 + RELICENSE/kevinsapper.md | 13 + RELICENSE/kobolog.md | 12 + RELICENSE/kurdybacha.md | 15 + RELICENSE/linville.md | 15 + RELICENSE/loachfish.md | 15 + RELICENSE/lodagro.md | 15 + RELICENSE/madebr.md | 15 + RELICENSE/mattconnolly.md | 15 + RELICENSE/mauri-melato.md | 13 + RELICENSE/mditzel.md | 15 + RELICENSE/meox.md | 15 + RELICENSE/michael-fox.md | 16 + RELICENSE/michicc.md | 15 + RELICENSE/minrk.md | 15 + RELICENSE/mipaaa.md | 15 + RELICENSE/mkluwe.md | 15 + RELICENSE/montoyaedu.md | 15 + RELICENSE/naos_ltd.md | 19 + RELICENSE/natano.md | 15 + RELICENSE/olafmandel.md | 13 + RELICENSE/pijyoi.md | 13 + RELICENSE/ptroja.md | 14 + RELICENSE/reunanen.md | 15 + RELICENSE/reza-ebrahimi.md | 15 + RELICENSE/rikvdh.md | 15 + RELICENSE/rlenferink.md | 15 + RELICENSE/roalz.md | 13 + RELICENSE/rodgert.md | 17 + RELICENSE/rotty.md | 16 + RELICENSE/sabae.md | 15 + RELICENSE/scemama.md | 15 + RELICENSE/sheremetyev.md | 13 + RELICENSE/shripchenko.md | 15 + RELICENSE/sigiesec.md | 17 + RELICENSE/soulik.md | 15 + RELICENSE/swansontec.md | 15 + RELICENSE/t-b.md | 15 + RELICENSE/tSed.md | 15 + RELICENSE/tabe.md | 15 + RELICENSE/tailhook.md | 16 + RELICENSE/taotetek.md | 13 + .../templates/relicense-template-mplv2-any-osi.txt | 15 + .../relicense-template-mplv2-share-alike-osi.txt | 15 + RELICENSE/templates/relicense-template-mplv2.txt | 13 + RELICENSE/thompsa.md | 15 + RELICENSE/torehalvorsen.md | 15 + RELICENSE/twhittock.md | 15 + RELICENSE/ulikoehler.md | 16 + RELICENSE/vyskocilm.md | 7 + RELICENSE/willstrang.md | 15 + RELICENSE/xaqq.md | 13 + RELICENSE/yuvallanger.md | 15 + acinclude.m4 | 1122 ++++++++++ appveyor.yml | 106 + autogen.sh | 49 + branding.bmp | Bin 0 -> 25818 bytes builds/Makefile.am | 29 + builds/README | 4 + builds/android/Dockerfile | 22 + builds/android/README.md | 78 + builds/android/android_build_helper.sh | 316 +++ builds/android/build.sh | 70 + builds/android/ci_build.sh | 30 + builds/cmake/Modules/ClangFormat.cmake | 41 + builds/cmake/Modules/FindAsciiDoc.cmake | 26 + builds/cmake/Modules/FindSodium.cmake | 40 + builds/cmake/Modules/TestZMQVersion.cmake | 8 + builds/cmake/Modules/ZMQSourceRunChecks.cmake | 301 +++ builds/cmake/NSIS.template32.in | 952 ++++++++ builds/cmake/NSIS.template64.in | 960 ++++++++ builds/cmake/ZeroMQConfig.cmake.in | 25 + builds/cmake/ci_build.sh | 48 + builds/cmake/clang-format-check.sh.in | 14 + builds/cmake/platform.hpp.in | 104 + builds/coverage/ci_build.sh | 32 + builds/cygwin/Makefile.cygwin | 48 + builds/gyp/.gitignore | 5 + builds/gyp/build.bat | 4 + builds/gyp/platform.hpp | 80 + builds/gyp/project-tests.gsl | 19 + builds/gyp/project-tests.gypi | 895 ++++++++ builds/gyp/project-tests.xml | 83 + builds/gyp/project.gyp | 295 +++ builds/mingw32/Makefile.mingw32 | 49 + builds/mingw32/platform.hpp | 43 + builds/msvc/.gitignore | 256 +++ builds/msvc/Makefile.am | 94 + builds/msvc/build/build.bat | 33 + builds/msvc/build/buildall.bat | 16 + builds/msvc/build/buildbase.bat | 73 + builds/msvc/errno.cpp | 32 + builds/msvc/errno.hpp | 56 + builds/msvc/platform.hpp | 14 + builds/msvc/properties/Common.props | 21 + builds/msvc/properties/DLL.props | 16 + builds/msvc/properties/Debug.props | 29 + builds/msvc/properties/DebugDEXE.props | 21 + builds/msvc/properties/DebugDLL.props | 20 + builds/msvc/properties/DebugLEXE.props | 20 + builds/msvc/properties/DebugLIB.props | 21 + builds/msvc/properties/DebugLTCG.props | 20 + builds/msvc/properties/DebugSEXE.props | 21 + builds/msvc/properties/EXE.props | 17 + builds/msvc/properties/LIB.props | 16 + builds/msvc/properties/LTCG.props | 13 + builds/msvc/properties/Link.props | 21 + builds/msvc/properties/Messages.props | 15 + builds/msvc/properties/Output.props | 30 + builds/msvc/properties/Release.props | 41 + builds/msvc/properties/ReleaseDEXE.props | 20 + builds/msvc/properties/ReleaseDLL.props | 19 + builds/msvc/properties/ReleaseLEXE.props | 20 + builds/msvc/properties/ReleaseLIB.props | 19 + builds/msvc/properties/ReleaseLTCG.props | 19 + builds/msvc/properties/ReleaseSEXE.props | 20 + builds/msvc/properties/Win32.props | 20 + builds/msvc/properties/x64.props | 23 + builds/msvc/readme.txt | 27 + builds/msvc/resource.h | 14 + builds/msvc/resource.rc | Bin 0 -> 4650 bytes builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj | 52 + builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj | 52 + builds/msvc/vs2008/libzmq.sln | 95 + builds/msvc/vs2008/libzmq/libzmq.vcproj | 338 +++ builds/msvc/vs2008/local_lat/local_lat.vcproj | 52 + builds/msvc/vs2008/local_thr/local_thr.vcproj | 52 + builds/msvc/vs2008/remote_lat/remote_lat.vcproj | 52 + builds/msvc/vs2008/remote_thr/remote_thr.vcproj | 52 + builds/msvc/vs2010/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2010/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2010/libsodium.import.props | 52 + builds/msvc/vs2010/libsodium.import.xml | 17 + builds/msvc/vs2010/libzmq.import.props | 64 + builds/msvc/vs2010/libzmq.import.xml | 49 + builds/msvc/vs2010/libzmq.sln | 206 ++ builds/msvc/vs2010/libzmq/libzmq.props | 76 + builds/msvc/vs2010/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2010/libzmq/libzmq.xml | 40 + builds/msvc/vs2010/local_lat/local_lat.props | 49 + builds/msvc/vs2010/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2010/local_thr/local_thr.props | 49 + builds/msvc/vs2010/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2010/remote_lat/remote_lat.props | 49 + builds/msvc/vs2010/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2010/remote_thr/remote_thr.props | 49 + builds/msvc/vs2010/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2012/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2012/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2012/libsodium.import.props | 52 + builds/msvc/vs2012/libsodium.import.xml | 17 + builds/msvc/vs2012/libzmq.import.props | 64 + builds/msvc/vs2012/libzmq.import.xml | 49 + builds/msvc/vs2012/libzmq.sln | 206 ++ builds/msvc/vs2012/libzmq/libzmq.props | 76 + builds/msvc/vs2012/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2012/libzmq/libzmq.xml | 40 + builds/msvc/vs2012/local_lat/local_lat.props | 49 + builds/msvc/vs2012/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2012/local_thr/local_thr.props | 49 + builds/msvc/vs2012/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2012/remote_lat/remote_lat.props | 49 + builds/msvc/vs2012/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2012/remote_thr/remote_thr.props | 49 + builds/msvc/vs2012/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2013/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2013/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2013/libsodium.import.props | 52 + builds/msvc/vs2013/libsodium.import.xml | 17 + builds/msvc/vs2013/libzmq.import.props | 64 + builds/msvc/vs2013/libzmq.import.xml | 49 + builds/msvc/vs2013/libzmq.sln | 208 ++ builds/msvc/vs2013/libzmq/libzmq.props | 76 + builds/msvc/vs2013/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2013/libzmq/libzmq.xml | 40 + builds/msvc/vs2013/local_lat/local_lat.props | 49 + builds/msvc/vs2013/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2013/local_thr/local_thr.props | 49 + builds/msvc/vs2013/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2013/remote_lat/remote_lat.props | 49 + builds/msvc/vs2013/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2013/remote_thr/remote_thr.props | 49 + builds/msvc/vs2013/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2015/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2015/libsodium.import.props | 52 + builds/msvc/vs2015/libsodium.import.xml | 17 + builds/msvc/vs2015/libzmq.import.props | 64 + builds/msvc/vs2015/libzmq.import.xml | 49 + builds/msvc/vs2015/libzmq.sln | 208 ++ builds/msvc/vs2015/libzmq/libzmq.props | 76 + builds/msvc/vs2015/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2015/libzmq/libzmq.xml | 40 + builds/msvc/vs2015/local_lat/local_lat.props | 49 + builds/msvc/vs2015/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2015/local_thr/local_thr.props | 49 + builds/msvc/vs2015/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2015/remote_lat/remote_lat.props | 49 + builds/msvc/vs2015/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2015/remote_thr/remote_thr.props | 49 + builds/msvc/vs2015/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015_xp/libzmq.vcxproj | 258 +++ builds/msvc/vs2015_xp/platform.hpp | 15 + .../msvc/vs2015_xp/test_zmq/test_multithread.cpp | 229 ++ builds/msvc/vs2015_xp/test_zmq/test_zmq.vcxproj | 155 ++ builds/msvc/vs2017/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2017/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2017/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2017/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2017/libsodium.import.props | 52 + builds/msvc/vs2017/libsodium.import.xml | 17 + builds/msvc/vs2017/libzmq.import.props | 64 + builds/msvc/vs2017/libzmq.import.xml | 49 + builds/msvc/vs2017/libzmq.sln | 208 ++ builds/msvc/vs2017/libzmq/libzmq.props | 76 + builds/msvc/vs2017/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2017/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2017/libzmq/libzmq.xml | 40 + builds/msvc/vs2017/local_lat/local_lat.props | 49 + builds/msvc/vs2017/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2017/local_thr/local_thr.props | 49 + builds/msvc/vs2017/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2017/remote_lat/remote_lat.props | 49 + builds/msvc/vs2017/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2017/remote_thr/remote_thr.props | 49 + builds/msvc/vs2017/remote_thr/remote_thr.vcxproj | 82 + builds/nuget/libzmq.autopkg | 52 + builds/nuget/readme.nuget | 20 + builds/openwrt/Makefile | 70 + builds/valgrind/ci_build.sh | 30 + builds/valgrind/valgrind.supp | 22 + builds/valgrind/vg | 1 + builds/zos/README.md | 463 ++++ builds/zos/cxxall | 62 + builds/zos/makeclean | 36 + builds/zos/makelibzmq | 54 + builds/zos/maketests | 102 + builds/zos/platform.hpp | 300 +++ builds/zos/runtests | 188 ++ builds/zos/test_fork.cpp | 95 + builds/zos/zc++ | 42 + ci_build.sh | 66 + ci_deploy.sh | 34 + configure.ac | 828 +++++++ doc/Makefile.am | 64 + doc/asciidoc.conf | 56 + doc/zmq.txt | 276 +++ doc/zmq_atomic_counter_dec.txt | 62 + doc/zmq_atomic_counter_destroy.txt | 62 + doc/zmq_atomic_counter_inc.txt | 61 + doc/zmq_atomic_counter_new.txt | 62 + doc/zmq_atomic_counter_set.txt | 61 + doc/zmq_atomic_counter_value.txt | 62 + doc/zmq_bind.txt | 103 + doc/zmq_close.txt | 56 + doc/zmq_connect.txt | 101 + doc/zmq_ctx_destroy.txt | 67 + doc/zmq_ctx_get.txt | 105 + doc/zmq_ctx_new.txt | 50 + doc/zmq_ctx_set.txt | 184 ++ doc/zmq_ctx_shutdown.txt | 52 + doc/zmq_ctx_term.txt | 68 + doc/zmq_curve.txt | 92 + doc/zmq_curve_keypair.txt | 56 + doc/zmq_curve_public.txt | 62 + doc/zmq_disconnect.txt | 75 + doc/zmq_errno.txt | 50 + doc/zmq_getsockopt.txt | 944 ++++++++ doc/zmq_gssapi.txt | 78 + doc/zmq_has.txt | 44 + doc/zmq_init.txt | 52 + doc/zmq_inproc.txt | 88 + doc/zmq_ipc.txt | 106 + doc/zmq_msg_close.txt | 56 + doc/zmq_msg_copy.txt | 72 + doc/zmq_msg_data.txt | 48 + doc/zmq_msg_get.txt | 83 + doc/zmq_msg_gets.txt | 81 + doc/zmq_msg_init.txt | 64 + doc/zmq_msg_init_data.txt | 89 + doc/zmq_msg_init_size.txt | 58 + doc/zmq_msg_more.txt | 65 + doc/zmq_msg_move.txt | 52 + doc/zmq_msg_recv.txt | 124 ++ doc/zmq_msg_routing_id.txt | 61 + doc/zmq_msg_send.txt | 127 ++ doc/zmq_msg_set.txt | 46 + doc/zmq_msg_set_routing_id.txt | 46 + doc/zmq_msg_size.txt | 48 + doc/zmq_null.txt | 27 + doc/zmq_pgm.txt | 164 ++ doc/zmq_plain.txt | 37 + doc/zmq_poll.txt | 135 ++ doc/zmq_proxy.txt | 99 + doc/zmq_proxy_steerable.txt | 111 + doc/zmq_recv.txt | 91 + doc/zmq_recvmsg.txt | 121 + doc/zmq_send.txt | 104 + doc/zmq_send_const.txt | 103 + doc/zmq_sendmsg.txt | 121 + doc/zmq_setsockopt.txt | 1318 +++++++++++ doc/zmq_socket.txt | 609 +++++ doc/zmq_socket_monitor.txt | 294 +++ doc/zmq_strerror.txt | 56 + doc/zmq_tcp.txt | 118 + doc/zmq_term.txt | 66 + doc/zmq_tipc.txt | 83 + doc/zmq_udp.txt | 99 + doc/zmq_unbind.txt | 90 + doc/zmq_version.txt | 54 + doc/zmq_vmci.txt | 97 + doc/zmq_z85_decode.txt | 51 + doc/zmq_z85_encode.txt | 58 + include/zmq.h | 732 ++++++ include/zmq_utils.h | 50 + installer.ico | Bin 0 -> 2842 bytes m4/ax_check_compile_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 +++ m4/ax_cxx_compile_stdcxx.m4 | 562 +++++ m4/ax_cxx_compile_stdcxx_11.m4 | 40 + m4/ax_valgrind_check.m4 | 233 ++ packaging/README | 4 + packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 64 + packaging/debian/copyright | 93 + packaging/debian/libzmq3-dev.install | 4 + packaging/debian/libzmq3-dev.manpages | 2 + packaging/debian/libzmq5.docs | 2 + packaging/debian/libzmq5.install | 1 + packaging/debian/rules | 67 + packaging/debian/source/format | 1 + packaging/debian/zeromq.dsc.obs | 15 + packaging/nuget/package.bat | 14 + packaging/nuget/package.config | 6 + packaging/nuget/package.gsl | 264 +++ packaging/nuget/package.nuspec | 98 + packaging/nuget/package.targets | 129 ++ packaging/nuget/package.xml | 22 + packaging/obs/_service | 98 + packaging/redhat/zeromq.spec | 234 ++ perf/inproc_lat.cpp | 238 ++ perf/inproc_thr.cpp | 247 +++ perf/local_lat.cpp | 116 + perf/local_thr.cpp | 161 ++ perf/remote_lat.cpp | 129 ++ perf/remote_thr.cpp | 138 ++ src/address.cpp | 129 ++ src/address.hpp | 81 + src/array.hpp | 135 ++ src/atomic_counter.hpp | 235 ++ src/atomic_ptr.hpp | 301 +++ src/blob.hpp | 186 ++ src/client.cpp | 115 + src/client.hpp | 75 + src/clock.cpp | 258 +++ src/clock.hpp | 79 + src/command.hpp | 204 ++ src/condition_variable.hpp | 250 +++ src/config.hpp | 96 + src/ctx.cpp | 683 ++++++ src/ctx.hpp | 253 +++ src/curve_client.cpp | 290 +++ src/curve_client.hpp | 84 + src/curve_client_tools.hpp | 305 +++ src/curve_mechanism_base.cpp | 179 ++ src/curve_mechanism_base.hpp | 79 + src/curve_server.cpp | 492 +++++ src/curve_server.hpp | 91 + src/dbuffer.hpp | 141 ++ src/dealer.cpp | 145 ++ src/dealer.hpp | 83 + src/decoder.hpp | 193 ++ src/decoder_allocators.cpp | 151 ++ src/decoder_allocators.hpp | 131 ++ src/devpoll.cpp | 203 ++ src/devpoll.hpp | 115 + src/dgram.cpp | 175 ++ src/dgram.hpp | 76 + src/dish.cpp | 368 ++++ src/dish.hpp | 121 + src/dist.cpp | 228 ++ src/dist.hpp | 116 + src/encoder.hpp | 180 ++ src/epoll.cpp | 205 ++ src/epoll.hpp | 115 + src/err.cpp | 467 ++++ src/err.hpp | 173 ++ src/fd.hpp | 61 + src/fq.cpp | 156 ++ src/fq.hpp | 88 + src/gather.cpp | 93 + src/gather.hpp | 68 + src/gssapi_client.cpp | 236 ++ src/gssapi_client.hpp | 92 + src/gssapi_mechanism_base.cpp | 402 ++++ src/gssapi_mechanism_base.hpp | 132 ++ src/gssapi_server.cpp | 248 +++ src/gssapi_server.hpp | 92 + src/i_decoder.hpp | 60 + src/i_encoder.hpp | 57 + src/i_engine.hpp | 65 + src/i_mailbox.hpp | 57 + src/i_poll_events.hpp | 53 + src/io_object.cpp | 116 + src/io_object.hpp | 84 + src/io_thread.cpp | 119 + src/io_thread.hpp | 95 + src/ip.cpp | 231 ++ src/ip.hpp | 62 + src/ipc_address.cpp | 107 + src/ipc_address.hpp | 68 + src/ipc_connecter.cpp | 275 +++ src/ipc_connecter.hpp | 135 ++ src/ipc_listener.cpp | 434 ++++ src/ipc_listener.hpp | 118 + src/kqueue.cpp | 225 ++ src/kqueue.hpp | 123 ++ src/lb.cpp | 165 ++ src/lb.hpp | 84 + src/libzmq.pc.cmake.in | 11 + src/libzmq.pc.in | 11 + src/libzmq.vers | 4 + src/likely.hpp | 42 + src/macros.hpp | 13 + src/mailbox.cpp | 106 + src/mailbox.hpp | 88 + src/mailbox_safe.cpp | 117 + src/mailbox_safe.hpp | 90 + src/mechanism.cpp | 329 +++ src/mechanism.hpp | 144 ++ src/mechanism_base.cpp | 69 + src/mechanism_base.hpp | 54 + src/metadata.cpp | 58 + src/metadata.hpp | 69 + src/msg.cpp | 566 +++++ src/msg.hpp | 273 +++ src/mtrie.cpp | 422 ++++ src/mtrie.hpp | 103 + src/mutex.hpp | 177 ++ src/norm_engine.cpp | 714 ++++++ src/norm_engine.hpp | 185 ++ src/null_mechanism.cpp | 213 ++ src/null_mechanism.hpp | 71 + src/object.cpp | 478 ++++ src/object.hpp | 149 ++ src/options.cpp | 1100 ++++++++++ src/options.hpp | 257 +++ src/own.cpp | 214 ++ src/own.hpp | 149 ++ src/pair.cpp | 141 ++ src/pair.hpp | 73 + src/pgm_receiver.cpp | 304 +++ src/pgm_receiver.hpp | 143 ++ src/pgm_sender.cpp | 251 +++ src/pgm_sender.hpp | 122 + src/pgm_socket.cpp | 687 ++++++ src/pgm_socket.hpp | 128 ++ src/pipe.cpp | 550 +++++ src/pipe.hpp | 258 +++ src/plain_client.cpp | 217 ++ src/plain_client.hpp | 73 + src/plain_server.cpp | 258 +++ src/plain_server.hpp | 67 + src/poll.cpp | 193 ++ src/poll.hpp | 117 + src/poller.hpp | 64 + src/poller_base.cpp | 108 + src/poller_base.hpp | 90 + src/pollset.cpp | 254 +++ src/pollset.hpp | 117 + src/precompiled.cpp | 30 + src/precompiled.hpp | 124 ++ src/proxy.cpp | 656 ++++++ src/proxy.hpp | 42 + src/pub.cpp | 67 + src/pub.hpp | 59 + src/pull.cpp | 78 + src/pull.hpp | 68 + src/push.cpp | 77 + src/push.hpp | 67 + src/radio.cpp | 254 +++ src/radio.hpp | 111 + src/random.cpp | 119 + src/random.hpp | 51 + src/raw_decoder.cpp | 74 + src/raw_decoder.hpp | 70 + src/raw_encoder.cpp | 51 + src/raw_encoder.hpp | 60 + src/reaper.cpp | 149 ++ src/reaper.hpp | 90 + src/rep.cpp | 133 ++ src/rep.hpp | 68 + src/req.cpp | 326 +++ src/req.hpp | 117 + src/router.cpp | 548 +++++ src/router.hpp | 141 ++ src/scatter.cpp | 83 + src/scatter.hpp | 67 + src/select.cpp | 607 +++++ src/select.hpp | 187 ++ src/server.cpp | 182 ++ src/server.hpp | 90 + src/session_base.cpp | 710 ++++++ src/session_base.hpp | 172 ++ src/signaler.cpp | 696 ++++++ src/signaler.hpp | 93 + src/socket_base.cpp | 1778 +++++++++++++++ src/socket_base.hpp | 304 +++ src/socket_poller.cpp | 683 ++++++ src/socket_poller.hpp | 146 ++ src/socks.cpp | 290 +++ src/socks.hpp | 133 ++ src/socks_connecter.cpp | 466 ++++ src/socks_connecter.hpp | 171 ++ src/stdint.hpp | 77 + src/stream.cpp | 319 +++ src/stream.hpp | 104 + src/stream_engine.cpp | 1095 +++++++++ src/stream_engine.hpp | 238 ++ src/sub.cpp | 87 + src/sub.hpp | 59 + src/tcp.cpp | 358 +++ src/tcp.hpp | 73 + src/tcp_address.cpp | 904 ++++++++ src/tcp_address.hpp | 121 + src/tcp_connecter.cpp | 425 ++++ src/tcp_connecter.hpp | 139 ++ src/tcp_listener.cpp | 366 +++ src/tcp_listener.hpp | 95 + src/thread.cpp | 245 +++ src/thread.hpp | 100 + src/timers.cpp | 199 ++ src/timers.hpp | 109 + src/tipc_address.cpp | 123 ++ src/tipc_address.hpp | 70 + src/tipc_connecter.cpp | 266 +++ src/tipc_connecter.hpp | 137 ++ src/tipc_listener.cpp | 192 ++ src/tipc_listener.hpp | 103 + src/trie.cpp | 321 +++ src/trie.hpp | 85 + src/tweetnacl.c | 988 +++++++++ src/tweetnacl.h | 78 + src/udp_address.cpp | 170 ++ src/udp_address.hpp | 77 + src/udp_engine.cpp | 391 ++++ src/udp_engine.hpp | 73 + src/v1_decoder.cpp | 152 ++ src/v1_decoder.hpp | 64 + src/v1_encoder.cpp | 75 + src/v1_encoder.hpp | 56 + src/v2_decoder.cpp | 162 ++ src/v2_decoder.hpp | 72 + src/v2_encoder.cpp | 77 + src/v2_encoder.hpp | 56 + src/v2_protocol.hpp | 49 + src/version.rc.in | 93 + src/vmci.cpp | 100 + src/vmci.hpp | 66 + src/vmci_address.cpp | 167 ++ src/vmci_address.hpp | 71 + src/vmci_connecter.cpp | 298 +++ src/vmci_connecter.hpp | 137 ++ src/vmci_listener.cpp | 266 +++ src/vmci_listener.hpp | 98 + src/windows.hpp | 97 + src/wire.hpp | 96 + src/xpub.cpp | 320 +++ src/xpub.hpp | 121 + src/xsub.cpp | 248 +++ src/xsub.hpp | 96 + src/ypipe.hpp | 211 ++ src/ypipe_base.hpp | 54 + src/ypipe_conflate.hpp | 119 + src/yqueue.hpp | 215 ++ src/zap_client.cpp | 305 +++ src/zap_client.hpp | 101 + src/zmq.cpp | 1546 +++++++++++++ src/zmq_draft.h | 189 ++ src/zmq_utils.cpp | 321 +++ tests/CMakeLists.txt | 218 ++ tests/README.md | 28 + tests/test_abstract_ipc.cpp | 67 + tests/test_ancillaries.cpp | 50 + tests/test_atomics.cpp | 48 + tests/test_base85.cpp | 164 ++ tests/test_bind_after_connect_tcp.cpp | 97 + tests/test_bind_src_address.cpp | 57 + tests/test_capabilities.cpp | 82 + tests/test_client_server.cpp | 106 + tests/test_conflate.cpp | 86 + tests/test_connect_delay_tipc.cpp | 238 ++ tests/test_connect_resolve.cpp | 70 + tests/test_connect_rid.cpp | 201 ++ tests/test_ctx_destroy.cpp | 110 + tests/test_ctx_options.cpp | 211 ++ tests/test_dgram.cpp | 99 + tests/test_diffserv.cpp | 84 + tests/test_disconnect_inproc.cpp | 151 ++ tests/test_filter_ipc.cpp | 164 ++ tests/test_fork.cpp | 98 + tests/test_getsockopt_memset.cpp | 64 + tests/test_heartbeats.cpp | 346 +++ tests/test_hwm.cpp | 321 +++ tests/test_hwm_pubsub.cpp | 248 +++ tests/test_immediate.cpp | 250 +++ tests/test_inproc_connect.cpp | 529 +++++ tests/test_invalid_rep.cpp | 97 + tests/test_iov.cpp | 156 ++ tests/test_ipc_wildcard.cpp | 65 + tests/test_issue_566.cpp | 99 + tests/test_last_endpoint.cpp | 65 + tests/test_many_sockets.cpp | 100 + tests/test_metadata.cpp | 130 ++ tests/test_monitor.cpp | 116 + tests/test_msg_ffn.cpp | 146 ++ tests/test_msg_flags.cpp | 126 ++ tests/test_pair_inproc.cpp | 81 + tests/test_pair_ipc.cpp | 60 + tests/test_pair_tcp.cpp | 92 + tests/test_pair_tipc.cpp | 62 + tests/test_pair_vmci.cpp | 68 + tests/test_poller.cpp | 413 ++++ tests/test_probe_router.cpp | 86 + tests/test_proxy.cpp | 503 +++++ tests/test_proxy_single_socket.cpp | 119 + tests/test_proxy_terminate.cpp | 131 ++ tests/test_pub_invert_matching.cpp | 136 ++ tests/test_radio_dish.cpp | 192 ++ tests/test_rebind_ipc.cpp | 84 + tests/test_reconnect_ivl.cpp | 149 ++ tests/test_req_correlate.cpp | 140 ++ tests/test_req_relaxed.cpp | 220 ++ tests/test_reqrep_device.cpp | 153 ++ tests/test_reqrep_device_tipc.cpp | 146 ++ tests/test_reqrep_inproc.cpp | 60 + tests/test_reqrep_ipc.cpp | 112 + tests/test_reqrep_tcp.cpp | 336 +++ tests/test_reqrep_tipc.cpp | 61 + tests/test_reqrep_vmci.cpp | 68 + tests/test_router_handover.cpp | 117 + tests/test_router_mandatory.cpp | 292 +++ tests/test_router_mandatory_hwm.cpp | 136 ++ tests/test_router_mandatory_tipc.cpp | 71 + tests/test_scatter_gather.cpp | 84 + tests/test_security_curve.cpp | 791 +++++++ tests/test_security_gssapi.cpp | 370 ++++ tests/test_security_null.cpp | 207 ++ tests/test_security_plain.cpp | 213 ++ tests/test_security_zap.cpp | 417 ++++ tests/test_setsockopt.cpp | 153 ++ tests/test_shutdown_stress.cpp | 100 + tests/test_shutdown_stress_tipc.cpp | 93 + tests/test_socket_null.cpp | 82 + tests/test_sockopt_hwm.cpp | 193 ++ tests/test_sodium.cpp | 99 + tests/test_spec_dealer.cpp | 267 +++ tests/test_spec_pushpull.cpp | 303 +++ tests/test_spec_rep.cpp | 169 ++ tests/test_spec_req.cpp | 268 +++ tests/test_spec_router.cpp | 219 ++ tests/test_srcfd.cpp | 126 ++ tests/test_stream.cpp | 336 +++ tests/test_stream_disconnect.cpp | 299 +++ tests/test_stream_empty.cpp | 75 + tests/test_stream_exceeds_buffer.cpp | 124 ++ tests/test_stream_timeout.cpp | 234 ++ tests/test_sub_forward.cpp | 109 + tests/test_sub_forward_tipc.cpp | 102 + tests/test_system.cpp | 101 + tests/test_term_endpoint.cpp | 226 ++ tests/test_term_endpoint_tipc.cpp | 120 + tests/test_thread_safe.cpp | 90 + tests/test_timeo.cpp | 93 + tests/test_timers.cpp | 245 +++ tests/test_udp.cpp | 134 ++ tests/test_unbind_inproc.cpp | 43 + tests/test_unbind_wildcard.cpp | 216 ++ tests/test_use_fd_ipc.cpp | 222 ++ tests/test_use_fd_tcp.cpp | 237 ++ tests/test_xpub_manual.cpp | 597 +++++ tests/test_xpub_nodrop.cpp | 117 + tests/test_xpub_welcome_msg.cpp | 81 + tests/test_zmq_poll_fd.cpp | 99 + tests/testutil.hpp | 401 ++++ tests/testutil_security.hpp | 684 ++++++ tools/curve_keygen.cpp | 64 + version.sh | 21 + 787 files changed, 110905 insertions(+) commit a57f7e3824408b5a76b541c6eaddcda3f588a2a9 Author: Pontus Sköldström Date: Tue Feb 6 18:36:24 2018 +0100 Add support for ZMQ_XPUB_NODROP on ZMQ_RADIO sockets Solves issue #2927 .clang-format | 53 + .github/PULL_REQUEST_TEMPLATE.md | 28 + .github/issue_template.md | 22 + .gitignore | 180 ++ .hgeol | 2 + .mailmap | 81 + .travis.yml | 125 ++ AUTHORS | 151 ++ CMakeLists.txt | 1142 ++++++++++ COPYING | 674 ++++++ COPYING.LESSER | 181 ++ Dockerfile | 11 + Doxygen.cfg | 2320 ++++++++++++++++++++ INSTALL | 311 +++ Jenkinsfile | 485 ++++ Makefile.am | 907 ++++++++ NEWS | 1585 +++++++++++++ README.cygwin.md | 15 + README.doxygen.md | 48 + README.md | 102 + RELICENSE/AndreLouisCaron.md | 15 + RELICENSE/Asmod4n.md | 13 + RELICENSE/BerndPrager.md | 13 + RELICENSE/Bklyn.md | 15 + RELICENSE/BrianBuchanan.md | 15 + RELICENSE/ChuckRemes.md | 15 + RELICENSE/FrancoFichtner.md | 15 + RELICENSE/GavinMcNiff.md | 15 + RELICENSE/GhislainPutois.md | 15 + RELICENSE/GiuseppeCorbelli.md | 15 + RELICENSE/HaraldAchitz.md | 17 + RELICENSE/Hugne.md | 17 + RELICENSE/JimHague.md | 16 + RELICENSE/JohanMabille.md | 16 + RELICENSE/LeonardMichelet | 14 + RELICENSE/LeonardoConsoni.md | 15 + RELICENSE/LionelOrry.md | 15 + RELICENSE/OsirisPedroso.md | 15 + RELICENSE/README.md | 23 + RELICENSE/RobGagnon.md | 13 + RELICENSE/SebastienRombauts.md | 15 + RELICENSE/StoianIvanov.md | 15 + RELICENSE/SylvainCorlay.md | 16 + RELICENSE/TimotheeBesset.md | 15 + RELICENSE/VincentTellier.md | 15 + RELICENSE/VolodymyrKorniichuk.md | 15 + RELICENSE/abbradar.md | 16 + RELICENSE/agronholm.md | 15 + RELICENSE/amuraru.md | 15 + RELICENSE/arsenm.md | 15 + RELICENSE/aseering.md | 15 + RELICENSE/bjorntopel.md | 16 + RELICENSE/bjovke.md | 16 + RELICENSE/brocade_communications_systems.md | 15 + RELICENSE/brunobodin.md | 13 + RELICENSE/c-rack.md | 15 + RELICENSE/camachat.md | 15 + RELICENSE/cdolan.md | 15 + RELICENSE/chrisstaite.md | 14 + RELICENSE/chugga_fan.md | 15 + RELICENSE/cjuniet.md | 15 + RELICENSE/ckamm.md | 15 + RELICENSE/clkao.md | 15 + RELICENSE/danielhtshih.md | 15 + RELICENSE/danriegsecker.md | 16 + RELICENSE/dfons.md | 16 + RELICENSE/djelenc.md | 15 + RELICENSE/drodri.md | 15 + RELICENSE/eburkitt.md | 15 + RELICENSE/egomotion.md | 16 + RELICENSE/evoskuil.md | 15 + RELICENSE/febeling.md | 16 + RELICENSE/fidlej.md | 15 + RELICENSE/flub.md | 14 + RELICENSE/gena-moscow.md | 15 + RELICENSE/gonzus.md | 15 + RELICENSE/goodfella_ltd.md | 13 + RELICENSE/google.md | 13 + RELICENSE/ianbarber.md | 15 + RELICENSE/imatix.md | 23 + RELICENSE/jakecobb.md | 13 + RELICENSE/jemc.md | 15 + RELICENSE/jimklimov.md | 17 + RELICENSE/jkryl.md | 15 + RELICENSE/johntconklin.md | 15 + RELICENSE/jruffin.md | 14 + RELICENSE/kentzo.md | 15 + RELICENSE/kevinsapper.md | 13 + RELICENSE/kobolog.md | 12 + RELICENSE/kurdybacha.md | 15 + RELICENSE/linville.md | 15 + RELICENSE/loachfish.md | 15 + RELICENSE/lodagro.md | 15 + RELICENSE/madebr.md | 15 + RELICENSE/mattconnolly.md | 15 + RELICENSE/mauri-melato.md | 13 + RELICENSE/mditzel.md | 15 + RELICENSE/meox.md | 15 + RELICENSE/michael-fox.md | 16 + RELICENSE/michicc.md | 15 + RELICENSE/minrk.md | 15 + RELICENSE/mipaaa.md | 15 + RELICENSE/mkluwe.md | 15 + RELICENSE/montoyaedu.md | 15 + RELICENSE/naos_ltd.md | 19 + RELICENSE/natano.md | 15 + RELICENSE/olafmandel.md | 13 + RELICENSE/pijyoi.md | 13 + RELICENSE/ptroja.md | 14 + RELICENSE/reunanen.md | 15 + RELICENSE/reza-ebrahimi.md | 15 + RELICENSE/rikvdh.md | 15 + RELICENSE/rlenferink.md | 15 + RELICENSE/roalz.md | 13 + RELICENSE/rodgert.md | 17 + RELICENSE/rotty.md | 16 + RELICENSE/sabae.md | 15 + RELICENSE/scemama.md | 15 + RELICENSE/sheremetyev.md | 13 + RELICENSE/shripchenko.md | 15 + RELICENSE/sigiesec.md | 17 + RELICENSE/soulik.md | 15 + RELICENSE/swansontec.md | 15 + RELICENSE/t-b.md | 15 + RELICENSE/tSed.md | 15 + RELICENSE/tabe.md | 15 + RELICENSE/tailhook.md | 16 + RELICENSE/taotetek.md | 13 + .../templates/relicense-template-mplv2-any-osi.txt | 15 + .../relicense-template-mplv2-share-alike-osi.txt | 15 + RELICENSE/templates/relicense-template-mplv2.txt | 13 + RELICENSE/thompsa.md | 15 + RELICENSE/torehalvorsen.md | 15 + RELICENSE/twhittock.md | 15 + RELICENSE/ulikoehler.md | 16 + RELICENSE/vyskocilm.md | 7 + RELICENSE/willstrang.md | 15 + RELICENSE/xaqq.md | 13 + RELICENSE/yuvallanger.md | 15 + acinclude.m4 | 1122 ++++++++++ appveyor.yml | 106 + autogen.sh | 49 + branding.bmp | Bin 0 -> 25818 bytes builds/Makefile.am | 29 + builds/README | 4 + builds/android/Dockerfile | 22 + builds/android/README.md | 78 + builds/android/android_build_helper.sh | 316 +++ builds/android/build.sh | 70 + builds/android/ci_build.sh | 30 + builds/cmake/Modules/ClangFormat.cmake | 41 + builds/cmake/Modules/FindAsciiDoc.cmake | 26 + builds/cmake/Modules/FindSodium.cmake | 40 + builds/cmake/Modules/TestZMQVersion.cmake | 8 + builds/cmake/Modules/ZMQSourceRunChecks.cmake | 301 +++ builds/cmake/NSIS.template32.in | 952 ++++++++ builds/cmake/NSIS.template64.in | 960 ++++++++ builds/cmake/ZeroMQConfig.cmake.in | 25 + builds/cmake/ci_build.sh | 48 + builds/cmake/clang-format-check.sh.in | 14 + builds/cmake/platform.hpp.in | 104 + builds/coverage/ci_build.sh | 32 + builds/cygwin/Makefile.cygwin | 48 + builds/gyp/.gitignore | 5 + builds/gyp/build.bat | 4 + builds/gyp/platform.hpp | 80 + builds/gyp/project-tests.gsl | 19 + builds/gyp/project-tests.gypi | 895 ++++++++ builds/gyp/project-tests.xml | 83 + builds/gyp/project.gyp | 295 +++ builds/mingw32/Makefile.mingw32 | 49 + builds/mingw32/platform.hpp | 43 + builds/msvc/.gitignore | 256 +++ builds/msvc/Makefile.am | 94 + builds/msvc/build/build.bat | 33 + builds/msvc/build/buildall.bat | 16 + builds/msvc/build/buildbase.bat | 73 + builds/msvc/errno.cpp | 32 + builds/msvc/errno.hpp | 56 + builds/msvc/platform.hpp | 14 + builds/msvc/properties/Common.props | 21 + builds/msvc/properties/DLL.props | 16 + builds/msvc/properties/Debug.props | 29 + builds/msvc/properties/DebugDEXE.props | 21 + builds/msvc/properties/DebugDLL.props | 20 + builds/msvc/properties/DebugLEXE.props | 20 + builds/msvc/properties/DebugLIB.props | 21 + builds/msvc/properties/DebugLTCG.props | 20 + builds/msvc/properties/DebugSEXE.props | 21 + builds/msvc/properties/EXE.props | 17 + builds/msvc/properties/LIB.props | 16 + builds/msvc/properties/LTCG.props | 13 + builds/msvc/properties/Link.props | 21 + builds/msvc/properties/Messages.props | 15 + builds/msvc/properties/Output.props | 30 + builds/msvc/properties/Release.props | 41 + builds/msvc/properties/ReleaseDEXE.props | 20 + builds/msvc/properties/ReleaseDLL.props | 19 + builds/msvc/properties/ReleaseLEXE.props | 20 + builds/msvc/properties/ReleaseLIB.props | 19 + builds/msvc/properties/ReleaseLTCG.props | 19 + builds/msvc/properties/ReleaseSEXE.props | 20 + builds/msvc/properties/Win32.props | 20 + builds/msvc/properties/x64.props | 23 + builds/msvc/readme.txt | 27 + builds/msvc/resource.h | 14 + builds/msvc/resource.rc | Bin 0 -> 4650 bytes builds/msvc/vs2008/inproc_lat/inproc_lat.vcproj | 52 + builds/msvc/vs2008/inproc_thr/inproc_thr.vcproj | 52 + builds/msvc/vs2008/libzmq.sln | 95 + builds/msvc/vs2008/libzmq/libzmq.vcproj | 338 +++ builds/msvc/vs2008/local_lat/local_lat.vcproj | 52 + builds/msvc/vs2008/local_thr/local_thr.vcproj | 52 + builds/msvc/vs2008/remote_lat/remote_lat.vcproj | 52 + builds/msvc/vs2008/remote_thr/remote_thr.vcproj | 52 + builds/msvc/vs2010/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2010/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2010/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2010/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2010/libsodium.import.props | 52 + builds/msvc/vs2010/libsodium.import.xml | 17 + builds/msvc/vs2010/libzmq.import.props | 64 + builds/msvc/vs2010/libzmq.import.xml | 49 + builds/msvc/vs2010/libzmq.sln | 206 ++ builds/msvc/vs2010/libzmq/libzmq.props | 76 + builds/msvc/vs2010/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2010/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2010/libzmq/libzmq.xml | 40 + builds/msvc/vs2010/local_lat/local_lat.props | 49 + builds/msvc/vs2010/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2010/local_thr/local_thr.props | 49 + builds/msvc/vs2010/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2010/remote_lat/remote_lat.props | 49 + builds/msvc/vs2010/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2010/remote_thr/remote_thr.props | 49 + builds/msvc/vs2010/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2012/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2012/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2012/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2012/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2012/libsodium.import.props | 52 + builds/msvc/vs2012/libsodium.import.xml | 17 + builds/msvc/vs2012/libzmq.import.props | 64 + builds/msvc/vs2012/libzmq.import.xml | 49 + builds/msvc/vs2012/libzmq.sln | 206 ++ builds/msvc/vs2012/libzmq/libzmq.props | 76 + builds/msvc/vs2012/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2012/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2012/libzmq/libzmq.xml | 40 + builds/msvc/vs2012/local_lat/local_lat.props | 49 + builds/msvc/vs2012/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2012/local_thr/local_thr.props | 49 + builds/msvc/vs2012/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2012/remote_lat/remote_lat.props | 49 + builds/msvc/vs2012/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2012/remote_thr/remote_thr.props | 49 + builds/msvc/vs2012/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2013/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2013/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2013/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2013/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2013/libsodium.import.props | 52 + builds/msvc/vs2013/libsodium.import.xml | 17 + builds/msvc/vs2013/libzmq.import.props | 64 + builds/msvc/vs2013/libzmq.import.xml | 49 + builds/msvc/vs2013/libzmq.sln | 208 ++ builds/msvc/vs2013/libzmq/libzmq.props | 76 + builds/msvc/vs2013/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2013/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2013/libzmq/libzmq.xml | 40 + builds/msvc/vs2013/local_lat/local_lat.props | 49 + builds/msvc/vs2013/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2013/local_thr/local_thr.props | 49 + builds/msvc/vs2013/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2013/remote_lat/remote_lat.props | 49 + builds/msvc/vs2013/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2013/remote_thr/remote_thr.props | 49 + builds/msvc/vs2013/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2015/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2015/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2015/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2015/libsodium.import.props | 52 + builds/msvc/vs2015/libsodium.import.xml | 17 + builds/msvc/vs2015/libzmq.import.props | 64 + builds/msvc/vs2015/libzmq.import.xml | 49 + builds/msvc/vs2015/libzmq.sln | 208 ++ builds/msvc/vs2015/libzmq/libzmq.props | 76 + builds/msvc/vs2015/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2015/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2015/libzmq/libzmq.xml | 40 + builds/msvc/vs2015/local_lat/local_lat.props | 49 + builds/msvc/vs2015/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2015/local_thr/local_thr.props | 49 + builds/msvc/vs2015/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2015/remote_lat/remote_lat.props | 49 + builds/msvc/vs2015/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2015/remote_thr/remote_thr.props | 49 + builds/msvc/vs2015/remote_thr/remote_thr.vcxproj | 82 + builds/msvc/vs2015_xp/libzmq.vcxproj | 258 +++ builds/msvc/vs2015_xp/platform.hpp | 15 + .../msvc/vs2015_xp/test_zmq/test_multithread.cpp | 229 ++ builds/msvc/vs2015_xp/test_zmq/test_zmq.vcxproj | 155 ++ builds/msvc/vs2017/inproc_lat/inproc_lat.props | 49 + builds/msvc/vs2017/inproc_lat/inproc_lat.vcxproj | 82 + builds/msvc/vs2017/inproc_thr/inproc_thr.props | 49 + builds/msvc/vs2017/inproc_thr/inproc_thr.vcxproj | 82 + builds/msvc/vs2017/libsodium.import.props | 52 + builds/msvc/vs2017/libsodium.import.xml | 17 + builds/msvc/vs2017/libzmq.import.props | 64 + builds/msvc/vs2017/libzmq.import.xml | 49 + builds/msvc/vs2017/libzmq.sln | 208 ++ builds/msvc/vs2017/libzmq/libzmq.props | 76 + builds/msvc/vs2017/libzmq/libzmq.vcxproj | 289 +++ builds/msvc/vs2017/libzmq/libzmq.vcxproj.filters | 627 ++++++ builds/msvc/vs2017/libzmq/libzmq.xml | 40 + builds/msvc/vs2017/local_lat/local_lat.props | 49 + builds/msvc/vs2017/local_lat/local_lat.vcxproj | 82 + builds/msvc/vs2017/local_thr/local_thr.props | 49 + builds/msvc/vs2017/local_thr/local_thr.vcxproj | 82 + builds/msvc/vs2017/remote_lat/remote_lat.props | 49 + builds/msvc/vs2017/remote_lat/remote_lat.vcxproj | 82 + builds/msvc/vs2017/remote_thr/remote_thr.props | 49 + builds/msvc/vs2017/remote_thr/remote_thr.vcxproj | 82 + builds/nuget/libzmq.autopkg | 52 + builds/nuget/readme.nuget | 20 + builds/openwrt/Makefile | 70 + builds/valgrind/ci_build.sh | 30 + builds/valgrind/valgrind.supp | 22 + builds/valgrind/vg | 1 + builds/zos/README.md | 463 ++++ builds/zos/cxxall | 62 + builds/zos/makeclean | 36 + builds/zos/makelibzmq | 54 + builds/zos/maketests | 102 + builds/zos/platform.hpp | 300 +++ builds/zos/runtests | 188 ++ builds/zos/test_fork.cpp | 95 + builds/zos/zc++ | 42 + ci_build.sh | 66 + ci_deploy.sh | 34 + configure.ac | 828 +++++++ doc/Makefile.am | 64 + doc/asciidoc.conf | 56 + doc/zmq.txt | 276 +++ doc/zmq_atomic_counter_dec.txt | 62 + doc/zmq_atomic_counter_destroy.txt | 62 + doc/zmq_atomic_counter_inc.txt | 61 + doc/zmq_atomic_counter_new.txt | 62 + doc/zmq_atomic_counter_set.txt | 61 + doc/zmq_atomic_counter_value.txt | 62 + doc/zmq_bind.txt | 103 + doc/zmq_close.txt | 56 + doc/zmq_connect.txt | 101 + doc/zmq_ctx_destroy.txt | 67 + doc/zmq_ctx_get.txt | 105 + doc/zmq_ctx_new.txt | 50 + doc/zmq_ctx_set.txt | 184 ++ doc/zmq_ctx_shutdown.txt | 52 + doc/zmq_ctx_term.txt | 68 + doc/zmq_curve.txt | 92 + doc/zmq_curve_keypair.txt | 56 + doc/zmq_curve_public.txt | 62 + doc/zmq_disconnect.txt | 75 + doc/zmq_errno.txt | 50 + doc/zmq_getsockopt.txt | 944 ++++++++ doc/zmq_gssapi.txt | 78 + doc/zmq_has.txt | 44 + doc/zmq_init.txt | 52 + doc/zmq_inproc.txt | 88 + doc/zmq_ipc.txt | 106 + doc/zmq_msg_close.txt | 56 + doc/zmq_msg_copy.txt | 72 + doc/zmq_msg_data.txt | 48 + doc/zmq_msg_get.txt | 83 + doc/zmq_msg_gets.txt | 81 + doc/zmq_msg_init.txt | 64 + doc/zmq_msg_init_data.txt | 89 + doc/zmq_msg_init_size.txt | 58 + doc/zmq_msg_more.txt | 65 + doc/zmq_msg_move.txt | 52 + doc/zmq_msg_recv.txt | 124 ++ doc/zmq_msg_routing_id.txt | 61 + doc/zmq_msg_send.txt | 127 ++ doc/zmq_msg_set.txt | 46 + doc/zmq_msg_set_routing_id.txt | 46 + doc/zmq_msg_size.txt | 48 + doc/zmq_null.txt | 27 + doc/zmq_pgm.txt | 164 ++ doc/zmq_plain.txt | 37 + doc/zmq_poll.txt | 135 ++ doc/zmq_proxy.txt | 99 + doc/zmq_proxy_steerable.txt | 111 + doc/zmq_recv.txt | 91 + doc/zmq_recvmsg.txt | 121 + doc/zmq_send.txt | 104 + doc/zmq_send_const.txt | 103 + doc/zmq_sendmsg.txt | 121 + doc/zmq_setsockopt.txt | 1318 +++++++++++ doc/zmq_socket.txt | 609 +++++ doc/zmq_socket_monitor.txt | 294 +++ doc/zmq_strerror.txt | 56 + doc/zmq_tcp.txt | 118 + doc/zmq_term.txt | 66 + doc/zmq_tipc.txt | 83 + doc/zmq_udp.txt | 99 + doc/zmq_unbind.txt | 90 + doc/zmq_version.txt | 54 + doc/zmq_vmci.txt | 97 + doc/zmq_z85_decode.txt | 51 + doc/zmq_z85_encode.txt | 58 + include/zmq.h | 731 ++++++ include/zmq_utils.h | 50 + installer.ico | Bin 0 -> 2842 bytes m4/ax_check_compile_flag.m4 | 74 + m4/ax_code_coverage.m4 | 264 +++ m4/ax_cxx_compile_stdcxx.m4 | 562 +++++ m4/ax_cxx_compile_stdcxx_11.m4 | 40 + m4/ax_valgrind_check.m4 | 233 ++ packaging/README | 4 + packaging/debian/changelog | 5 + packaging/debian/compat | 1 + packaging/debian/control | 64 + packaging/debian/copyright | 93 + packaging/debian/libzmq3-dev.install | 4 + packaging/debian/libzmq3-dev.manpages | 2 + packaging/debian/libzmq5.docs | 2 + packaging/debian/libzmq5.install | 1 + packaging/debian/rules | 67 + packaging/debian/source/format | 1 + packaging/debian/zeromq.dsc.obs | 15 + packaging/nuget/package.bat | 14 + packaging/nuget/package.config | 6 + packaging/nuget/package.gsl | 264 +++ packaging/nuget/package.nuspec | 98 + packaging/nuget/package.targets | 129 ++ packaging/nuget/package.xml | 22 + packaging/obs/_service | 98 + packaging/redhat/zeromq.spec | 234 ++ perf/inproc_lat.cpp | 238 ++ perf/inproc_thr.cpp | 247 +++ perf/local_lat.cpp | 116 + perf/local_thr.cpp | 161 ++ perf/remote_lat.cpp | 129 ++ perf/remote_thr.cpp | 138 ++ src/address.cpp | 129 ++ src/address.hpp | 81 + src/array.hpp | 135 ++ src/atomic_counter.hpp | 235 ++ src/atomic_ptr.hpp | 301 +++ src/blob.hpp | 186 ++ src/client.cpp | 115 + src/client.hpp | 75 + src/clock.cpp | 258 +++ src/clock.hpp | 79 + src/command.hpp | 204 ++ src/condition_variable.hpp | 250 +++ src/config.hpp | 96 + src/ctx.cpp | 683 ++++++ src/ctx.hpp | 253 +++ src/curve_client.cpp | 290 +++ src/curve_client.hpp | 84 + src/curve_client_tools.hpp | 305 +++ src/curve_mechanism_base.cpp | 179 ++ src/curve_mechanism_base.hpp | 79 + src/curve_server.cpp | 492 +++++ src/curve_server.hpp | 91 + src/dbuffer.hpp | 141 ++ src/dealer.cpp | 145 ++ src/dealer.hpp | 83 + src/decoder.hpp | 193 ++ src/decoder_allocators.cpp | 151 ++ src/decoder_allocators.hpp | 131 ++ src/devpoll.cpp | 203 ++ src/devpoll.hpp | 115 + src/dgram.cpp | 175 ++ src/dgram.hpp | 76 + src/dish.cpp | 368 ++++ src/dish.hpp | 121 + src/dist.cpp | 228 ++ src/dist.hpp | 116 + src/encoder.hpp | 180 ++ src/epoll.cpp | 205 ++ src/epoll.hpp | 115 + src/err.cpp | 467 ++++ src/err.hpp | 173 ++ src/fd.hpp | 61 + src/fq.cpp | 156 ++ src/fq.hpp | 88 + src/gather.cpp | 93 + src/gather.hpp | 68 + src/gssapi_client.cpp | 236 ++ src/gssapi_client.hpp | 92 + src/gssapi_mechanism_base.cpp | 402 ++++ src/gssapi_mechanism_base.hpp | 132 ++ src/gssapi_server.cpp | 248 +++ src/gssapi_server.hpp | 92 + src/i_decoder.hpp | 60 + src/i_encoder.hpp | 57 + src/i_engine.hpp | 65 + src/i_mailbox.hpp | 57 + src/i_poll_events.hpp | 53 + src/io_object.cpp | 116 + src/io_object.hpp | 84 + src/io_thread.cpp | 119 + src/io_thread.hpp | 95 + src/ip.cpp | 231 ++ src/ip.hpp | 62 + src/ipc_address.cpp | 107 + src/ipc_address.hpp | 68 + src/ipc_connecter.cpp | 275 +++ src/ipc_connecter.hpp | 135 ++ src/ipc_listener.cpp | 434 ++++ src/ipc_listener.hpp | 118 + src/kqueue.cpp | 225 ++ src/kqueue.hpp | 123 ++ src/lb.cpp | 165 ++ src/lb.hpp | 84 + src/libzmq.pc.cmake.in | 11 + src/libzmq.pc.in | 11 + src/libzmq.vers | 4 + src/likely.hpp | 42 + src/macros.hpp | 13 + src/mailbox.cpp | 106 + src/mailbox.hpp | 88 + src/mailbox_safe.cpp | 117 + src/mailbox_safe.hpp | 90 + src/mechanism.cpp | 329 +++ src/mechanism.hpp | 144 ++ src/mechanism_base.cpp | 69 + src/mechanism_base.hpp | 54 + src/metadata.cpp | 58 + src/metadata.hpp | 69 + src/msg.cpp | 566 +++++ src/msg.hpp | 273 +++ src/mtrie.cpp | 422 ++++ src/mtrie.hpp | 103 + src/mutex.hpp | 177 ++ src/norm_engine.cpp | 714 ++++++ src/norm_engine.hpp | 185 ++ src/null_mechanism.cpp | 213 ++ src/null_mechanism.hpp | 71 + src/object.cpp | 478 ++++ src/object.hpp | 149 ++ src/options.cpp | 1085 +++++++++ src/options.hpp | 254 +++ src/own.cpp | 214 ++ src/own.hpp | 149 ++ src/pair.cpp | 141 ++ src/pair.hpp | 73 + src/pgm_receiver.cpp | 304 +++ src/pgm_receiver.hpp | 143 ++ src/pgm_sender.cpp | 251 +++ src/pgm_sender.hpp | 122 + src/pgm_socket.cpp | 687 ++++++ src/pgm_socket.hpp | 128 ++ src/pipe.cpp | 550 +++++ src/pipe.hpp | 258 +++ src/plain_client.cpp | 217 ++ src/plain_client.hpp | 73 + src/plain_server.cpp | 258 +++ src/plain_server.hpp | 67 + src/poll.cpp | 193 ++ src/poll.hpp | 117 + src/poller.hpp | 64 + src/poller_base.cpp | 108 + src/poller_base.hpp | 90 + src/pollset.cpp | 254 +++ src/pollset.hpp | 117 + src/precompiled.cpp | 30 + src/precompiled.hpp | 124 ++ src/proxy.cpp | 656 ++++++ src/proxy.hpp | 42 + src/pub.cpp | 67 + src/pub.hpp | 59 + src/pull.cpp | 78 + src/pull.hpp | 68 + src/push.cpp | 77 + src/push.hpp | 67 + src/radio.cpp | 277 +++ src/radio.hpp | 115 + src/random.cpp | 119 + src/random.hpp | 51 + src/raw_decoder.cpp | 74 + src/raw_decoder.hpp | 70 + src/raw_encoder.cpp | 51 + src/raw_encoder.hpp | 60 + src/reaper.cpp | 149 ++ src/reaper.hpp | 90 + src/rep.cpp | 133 ++ src/rep.hpp | 68 + src/req.cpp | 326 +++ src/req.hpp | 117 + src/router.cpp | 548 +++++ src/router.hpp | 141 ++ src/scatter.cpp | 83 + src/scatter.hpp | 67 + src/select.cpp | 607 +++++ src/select.hpp | 187 ++ src/server.cpp | 182 ++ src/server.hpp | 90 + src/session_base.cpp | 710 ++++++ src/session_base.hpp | 172 ++ src/signaler.cpp | 687 ++++++ src/signaler.hpp | 93 + src/socket_base.cpp | 1778 +++++++++++++++ src/socket_base.hpp | 304 +++ src/socket_poller.cpp | 683 ++++++ src/socket_poller.hpp | 146 ++ src/socks.cpp | 290 +++ src/socks.hpp | 133 ++ src/socks_connecter.cpp | 466 ++++ src/socks_connecter.hpp | 171 ++ src/stdint.hpp | 77 + src/stream.cpp | 319 +++ src/stream.hpp | 104 + src/stream_engine.cpp | 1095 +++++++++ src/stream_engine.hpp | 238 ++ src/sub.cpp | 87 + src/sub.hpp | 59 + src/tcp.cpp | 334 +++ src/tcp.hpp | 71 + src/tcp_address.cpp | 904 ++++++++ src/tcp_address.hpp | 121 + src/tcp_connecter.cpp | 421 ++++ src/tcp_connecter.hpp | 139 ++ src/tcp_listener.cpp | 362 +++ src/tcp_listener.hpp | 95 + src/thread.cpp | 245 +++ src/thread.hpp | 100 + src/timers.cpp | 199 ++ src/timers.hpp | 109 + src/tipc_address.cpp | 123 ++ src/tipc_address.hpp | 70 + src/tipc_connecter.cpp | 266 +++ src/tipc_connecter.hpp | 137 ++ src/tipc_listener.cpp | 192 ++ src/tipc_listener.hpp | 103 + src/trie.cpp | 321 +++ src/trie.hpp | 85 + src/tweetnacl.c | 988 +++++++++ src/tweetnacl.h | 78 + src/udp_address.cpp | 170 ++ src/udp_address.hpp | 77 + src/udp_engine.cpp | 391 ++++ src/udp_engine.hpp | 73 + src/v1_decoder.cpp | 152 ++ src/v1_decoder.hpp | 64 + src/v1_encoder.cpp | 75 + src/v1_encoder.hpp | 56 + src/v2_decoder.cpp | 162 ++ src/v2_decoder.hpp | 72 + src/v2_encoder.cpp | 77 + src/v2_encoder.hpp | 56 + src/v2_protocol.hpp | 49 + src/version.rc.in | 93 + src/vmci.cpp | 100 + src/vmci.hpp | 66 + src/vmci_address.cpp | 167 ++ src/vmci_address.hpp | 71 + src/vmci_connecter.cpp | 298 +++ src/vmci_connecter.hpp | 137 ++ src/vmci_listener.cpp | 266 +++ src/vmci_listener.hpp | 98 + src/windows.hpp | 97 + src/wire.hpp | 96 + src/xpub.cpp | 320 +++ src/xpub.hpp | 121 + src/xsub.cpp | 248 +++ src/xsub.hpp | 96 + src/ypipe.hpp | 211 ++ src/ypipe_base.hpp | 54 + src/ypipe_conflate.hpp | 119 + src/yqueue.hpp | 215 ++ src/zap_client.cpp | 305 +++ src/zap_client.hpp | 101 + src/zmq.cpp | 1546 +++++++++++++ src/zmq_draft.h | 188 ++ src/zmq_utils.cpp | 321 +++ tests/CMakeLists.txt | 218 ++ tests/README.md | 28 + tests/test_abstract_ipc.cpp | 67 + tests/test_ancillaries.cpp | 50 + tests/test_atomics.cpp | 48 + tests/test_base85.cpp | 164 ++ tests/test_bind_after_connect_tcp.cpp | 97 + tests/test_bind_src_address.cpp | 57 + tests/test_capabilities.cpp | 82 + tests/test_client_server.cpp | 106 + tests/test_conflate.cpp | 86 + tests/test_connect_delay_tipc.cpp | 238 ++ tests/test_connect_resolve.cpp | 70 + tests/test_connect_rid.cpp | 201 ++ tests/test_ctx_destroy.cpp | 110 + tests/test_ctx_options.cpp | 211 ++ tests/test_dgram.cpp | 99 + tests/test_diffserv.cpp | 84 + tests/test_disconnect_inproc.cpp | 151 ++ tests/test_filter_ipc.cpp | 164 ++ tests/test_fork.cpp | 98 + tests/test_getsockopt_memset.cpp | 64 + tests/test_heartbeats.cpp | 346 +++ tests/test_hwm.cpp | 321 +++ tests/test_hwm_pubsub.cpp | 248 +++ tests/test_immediate.cpp | 250 +++ tests/test_inproc_connect.cpp | 529 +++++ tests/test_invalid_rep.cpp | 97 + tests/test_iov.cpp | 156 ++ tests/test_ipc_wildcard.cpp | 65 + tests/test_issue_566.cpp | 99 + tests/test_last_endpoint.cpp | 65 + tests/test_many_sockets.cpp | 100 + tests/test_metadata.cpp | 130 ++ tests/test_monitor.cpp | 116 + tests/test_msg_ffn.cpp | 146 ++ tests/test_msg_flags.cpp | 126 ++ tests/test_pair_inproc.cpp | 81 + tests/test_pair_ipc.cpp | 60 + tests/test_pair_tcp.cpp | 64 + tests/test_pair_tipc.cpp | 62 + tests/test_pair_vmci.cpp | 68 + tests/test_poller.cpp | 413 ++++ tests/test_probe_router.cpp | 86 + tests/test_proxy.cpp | 503 +++++ tests/test_proxy_single_socket.cpp | 119 + tests/test_proxy_terminate.cpp | 131 ++ tests/test_pub_invert_matching.cpp | 136 ++ tests/test_radio_dish.cpp | 192 ++ tests/test_rebind_ipc.cpp | 84 + tests/test_reconnect_ivl.cpp | 149 ++ tests/test_req_correlate.cpp | 140 ++ tests/test_req_relaxed.cpp | 220 ++ tests/test_reqrep_device.cpp | 153 ++ tests/test_reqrep_device_tipc.cpp | 146 ++ tests/test_reqrep_inproc.cpp | 60 + tests/test_reqrep_ipc.cpp | 112 + tests/test_reqrep_tcp.cpp | 336 +++ tests/test_reqrep_tipc.cpp | 61 + tests/test_reqrep_vmci.cpp | 68 + tests/test_router_handover.cpp | 117 + tests/test_router_mandatory.cpp | 292 +++ tests/test_router_mandatory_hwm.cpp | 136 ++ tests/test_router_mandatory_tipc.cpp | 71 + tests/test_scatter_gather.cpp | 84 + tests/test_security_curve.cpp | 791 +++++++ tests/test_security_gssapi.cpp | 370 ++++ tests/test_security_null.cpp | 207 ++ tests/test_security_plain.cpp | 213 ++ tests/test_security_zap.cpp | 417 ++++ tests/test_setsockopt.cpp | 153 ++ tests/test_shutdown_stress.cpp | 100 + tests/test_shutdown_stress_tipc.cpp | 93 + tests/test_socket_null.cpp | 82 + tests/test_sockopt_hwm.cpp | 193 ++ tests/test_sodium.cpp | 99 + tests/test_spec_dealer.cpp | 267 +++ tests/test_spec_pushpull.cpp | 303 +++ tests/test_spec_rep.cpp | 169 ++ tests/test_spec_req.cpp | 268 +++ tests/test_spec_router.cpp | 219 ++ tests/test_srcfd.cpp | 126 ++ tests/test_stream.cpp | 336 +++ tests/test_stream_disconnect.cpp | 299 +++ tests/test_stream_empty.cpp | 75 + tests/test_stream_exceeds_buffer.cpp | 124 ++ tests/test_stream_timeout.cpp | 234 ++ tests/test_sub_forward.cpp | 109 + tests/test_sub_forward_tipc.cpp | 102 + tests/test_system.cpp | 101 + tests/test_term_endpoint.cpp | 226 ++ tests/test_term_endpoint_tipc.cpp | 120 + tests/test_thread_safe.cpp | 90 + tests/test_timeo.cpp | 93 + tests/test_timers.cpp | 245 +++ tests/test_udp.cpp | 134 ++ tests/test_unbind_inproc.cpp | 43 + tests/test_unbind_wildcard.cpp | 216 ++ tests/test_use_fd_ipc.cpp | 222 ++ tests/test_use_fd_tcp.cpp | 237 ++ tests/test_xpub_manual.cpp | 597 +++++ tests/test_xpub_nodrop.cpp | 117 + tests/test_xpub_welcome_msg.cpp | 81 + tests/test_zmq_poll_fd.cpp | 99 + tests/testutil.hpp | 401 ++++ tests/testutil_security.hpp | 684 ++++++ tools/curve_keygen.cpp | 64 + version.sh | 21 + 787 files changed, 110841 insertions(+) zeromq-4.2.5/Makefile.in0000664000372000037200000157504413255253274016036 0ustar00travistravis00000000000000# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @USE_TWEETNACL_TRUE@am__append_1 = \ @USE_TWEETNACL_TRUE@ src/tweetnacl.c \ @USE_TWEETNACL_TRUE@ src/tweetnacl.h @USE_LIBSODIUM_TRUE@am__append_2 = ${sodium_CFLAGS} @USE_LIBSODIUM_TRUE@am__append_3 = ${sodium_LIBS} @HAVE_PGM_TRUE@am__append_4 = ${pgm_CFLAGS} @HAVE_PGM_TRUE@am__append_5 = ${pgm_LIBS} @HAVE_NORM_TRUE@am__append_6 = ${norm_CFLAGS} @HAVE_NORM_TRUE@am__append_7 = ${norm_LIBS} @BUILD_GSSAPI_TRUE@am__append_8 = ${gssapi_krb5_CFLAGS} @BUILD_GSSAPI_TRUE@am__append_9 = ${gssapi_krb5_LIBS} @ENABLE_PERF_TRUE@noinst_PROGRAMS = perf/local_lat$(EXEEXT) \ @ENABLE_PERF_TRUE@ perf/remote_lat$(EXEEXT) \ @ENABLE_PERF_TRUE@ perf/local_thr$(EXEEXT) \ @ENABLE_PERF_TRUE@ perf/remote_thr$(EXEEXT) \ @ENABLE_PERF_TRUE@ perf/inproc_lat$(EXEEXT) \ @ENABLE_PERF_TRUE@ perf/inproc_thr$(EXEEXT) @ENABLE_CURVE_KEYGEN_TRUE@bin_PROGRAMS = tools/curve_keygen$(EXEEXT) @HAVE_CURVE_TRUE@am__append_10 = \ @HAVE_CURVE_TRUE@ tests/test_security_curve @HAVE_CURVE_TRUE@@USE_TWEETNACL_TRUE@am__append_11 = \ @HAVE_CURVE_TRUE@@USE_TWEETNACL_TRUE@ src/tweetnacl.c @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@am__append_12 = \ @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@ ${sodium_CFLAGS} @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@am__append_13 = \ @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@ ${sodium_LIBS} @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am__append_14 = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_shutdown_stress \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_ipc_wildcard \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_pair_ipc \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_rebind_ipc \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_reqrep_ipc \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_ipc \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_tcp \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_zmq_poll_fd \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_timeo \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_filter_ipc @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@am__append_15 = tests/test_fork @BUILD_TIPC_TRUE@am__append_16 = \ @BUILD_TIPC_TRUE@ tests/test_connect_delay_tipc \ @BUILD_TIPC_TRUE@ tests/test_pair_tipc \ @BUILD_TIPC_TRUE@ tests/test_reqrep_device_tipc \ @BUILD_TIPC_TRUE@ tests/test_reqrep_tipc \ @BUILD_TIPC_TRUE@ tests/test_router_mandatory_tipc \ @BUILD_TIPC_TRUE@ tests/test_shutdown_stress_tipc \ @BUILD_TIPC_TRUE@ tests/test_sub_forward_tipc \ @BUILD_TIPC_TRUE@ tests/test_term_endpoint_tipc \ @BUILD_TIPC_TRUE@ tests/test_address_tipc @BUILD_GSSAPI_TRUE@am__append_17 = tests/test_security_gssapi @ON_LINUX_TRUE@am__append_18 = tests/test_abstract_ipc \ @ON_LINUX_TRUE@ tests/test_many_sockets @HAVE_VMCI_TRUE@am__append_19 = test_pair_vmci test_reqrep_vmci @ENABLE_DRAFTS_TRUE@am__append_20 = tests/test_poller \ @ENABLE_DRAFTS_TRUE@ tests/test_client_server \ @ENABLE_DRAFTS_TRUE@ tests/test_thread_safe \ @ENABLE_DRAFTS_TRUE@ tests/test_timers \ @ENABLE_DRAFTS_TRUE@ tests/test_radio_dish \ @ENABLE_DRAFTS_TRUE@ tests/test_scatter_gather \ @ENABLE_DRAFTS_TRUE@ tests/test_dgram \ @ENABLE_DRAFTS_TRUE@ tests/test_app_meta # unit tests - these include individual source files and test the internal functions @ENABLE_STATIC_TRUE@am__append_21 = \ @ENABLE_STATIC_TRUE@ unittests/unittest_poller \ @ENABLE_STATIC_TRUE@ unittests/unittest_ypipe \ @ENABLE_STATIC_TRUE@ unittests/unittest_mtrie check_PROGRAMS = $(am__EXEEXT_10) TESTS = $(am__EXEEXT_10) XFAIL_TESTS = $(am__EXEEXT_11) $(am__append_23) @ON_LINUX_FALSE@am__append_22 = tests/test_abstract_ipc @ON_GNU_TRUE@am__append_23 = test_ipc_wildcard \ @ON_GNU_TRUE@ test_term_endpoint subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(top_srcdir)/src/platform.hpp.in \ $(top_srcdir)/src/libzmq.pc.in $(top_srcdir)/config/depcomp \ $(include_HEADERS) $(top_srcdir)/config/test-driver AUTHORS \ COPYING COPYING.LESSER INSTALL NEWS config/compile \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/missing config/ltmain.sh \ $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_11.m4 \ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/platform.hpp CONFIG_CLEAN_FILES = src/libzmq.pc CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = external_unity_libunity_a_AR = $(AR) $(ARFLAGS) external_unity_libunity_a_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_external_unity_libunity_a_OBJECTS = external/unity/unity.$(OBJEXT) external_unity_libunity_a_OBJECTS = \ $(am_external_unity_libunity_a_OBJECTS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = @USE_LIBSODIUM_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @HAVE_PGM_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) @HAVE_NORM_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) @BUILD_GSSAPI_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) src_libzmq_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) \ $(am__DEPENDENCIES_5) am__src_libzmq_la_SOURCES_DIST = src/address.cpp src/address.hpp \ src/array.hpp src/atomic_counter.hpp src/atomic_ptr.hpp \ src/blob.hpp src/client.cpp src/client.hpp src/clock.cpp \ src/clock.hpp src/command.hpp src/condition_variable.hpp \ src/config.hpp src/ctx.cpp src/ctx.hpp src/curve_client.cpp \ src/curve_client.hpp src/curve_client_tools.hpp \ src/curve_mechanism_base.cpp src/curve_mechanism_base.hpp \ src/curve_server.cpp src/curve_server.hpp src/dbuffer.hpp \ src/dealer.cpp src/dealer.hpp src/decoder.hpp src/devpoll.cpp \ src/devpoll.hpp src/dgram.cpp src/dgram.hpp src/dish.cpp \ src/dish.hpp src/dist.cpp src/dist.hpp src/encoder.hpp \ src/epoll.cpp src/epoll.hpp src/err.cpp src/err.hpp src/fd.hpp \ src/fq.cpp src/fq.hpp src/gather.cpp src/gather.hpp \ src/generic_mtrie.hpp src/generic_mtrie_impl.hpp \ src/gssapi_mechanism_base.cpp src/gssapi_mechanism_base.hpp \ src/gssapi_client.cpp src/gssapi_client.hpp \ src/gssapi_server.cpp src/gssapi_server.hpp src/i_encoder.hpp \ src/i_engine.hpp src/i_decoder.hpp src/i_mailbox.hpp \ src/i_poll_events.hpp src/io_object.cpp src/io_object.hpp \ src/io_thread.cpp src/io_thread.hpp src/ip.cpp src/ip.hpp \ src/ipc_address.cpp src/ipc_address.hpp src/ipc_connecter.cpp \ src/ipc_connecter.hpp src/ipc_listener.cpp \ src/ipc_listener.hpp src/kqueue.cpp src/kqueue.hpp src/lb.cpp \ src/lb.hpp src/likely.hpp src/macros.hpp src/mailbox.cpp \ src/mailbox.hpp src/mailbox_safe.cpp src/mailbox_safe.hpp \ src/mechanism.cpp src/mechanism.hpp src/mechanism_base.cpp \ src/mechanism_base.hpp src/metadata.cpp src/metadata.hpp \ src/msg.cpp src/msg.hpp src/mtrie.cpp src/mtrie.hpp \ src/mutex.hpp src/norm_engine.cpp src/norm_engine.hpp \ src/null_mechanism.cpp src/null_mechanism.hpp src/object.cpp \ src/object.hpp src/options.cpp src/options.hpp src/own.cpp \ src/own.hpp src/pair.cpp src/pair.hpp src/pgm_receiver.cpp \ src/pgm_receiver.hpp src/pgm_sender.cpp src/pgm_sender.hpp \ src/pgm_socket.cpp src/pgm_socket.hpp src/pipe.cpp \ src/pipe.hpp src/plain_client.cpp src/plain_client.hpp \ src/plain_server.cpp src/plain_server.hpp src/platform.hpp \ src/poll.cpp src/poll.hpp src/poller.hpp src/poller_base.cpp \ src/poller_base.hpp src/pollset.cpp src/pollset.hpp \ src/precompiled.cpp src/precompiled.hpp src/proxy.cpp \ src/proxy.hpp src/pub.cpp src/pub.hpp src/pull.cpp \ src/pull.hpp src/push.cpp src/push.hpp src/radio.cpp \ src/radio.hpp src/random.cpp src/random.hpp \ src/raw_decoder.cpp src/raw_decoder.hpp src/raw_encoder.cpp \ src/raw_encoder.hpp src/reaper.cpp src/reaper.hpp src/rep.cpp \ src/rep.hpp src/req.cpp src/req.hpp src/router.cpp \ src/router.hpp src/scatter.cpp src/scatter.hpp src/select.cpp \ src/select.hpp src/server.cpp src/server.hpp \ src/session_base.cpp src/session_base.hpp src/signaler.cpp \ src/signaler.hpp src/socket_base.cpp src/socket_base.hpp \ src/socks.cpp src/socks.hpp src/socks_connecter.cpp \ src/socks_connecter.hpp src/stdint.hpp src/stream.cpp \ src/stream.hpp src/stream_engine.cpp src/stream_engine.hpp \ src/sub.cpp src/sub.hpp src/tcp.cpp src/tcp.hpp \ src/tcp_address.cpp src/tcp_address.hpp src/tcp_connecter.cpp \ src/tcp_connecter.hpp src/tcp_listener.cpp \ src/tcp_listener.hpp src/thread.cpp src/thread.hpp \ src/timers.cpp src/timers.hpp src/tipc_address.cpp \ src/tipc_address.hpp src/tipc_connecter.cpp \ src/tipc_connecter.hpp src/tipc_listener.cpp \ src/tipc_listener.hpp src/trie.cpp src/trie.hpp \ src/udp_address.cpp src/udp_address.hpp src/udp_engine.cpp \ src/udp_engine.hpp src/v1_decoder.cpp src/v1_decoder.hpp \ src/v2_decoder.cpp src/v2_decoder.hpp src/v1_encoder.cpp \ src/v1_encoder.hpp src/v2_encoder.cpp src/v2_encoder.hpp \ src/v2_protocol.hpp src/vmci.cpp src/vmci.hpp \ src/vmci_address.cpp src/vmci_address.hpp \ src/vmci_connecter.cpp src/vmci_connecter.hpp \ src/vmci_listener.cpp src/vmci_listener.hpp src/windows.hpp \ src/wire.hpp src/xpub.cpp src/xpub.hpp src/xsub.cpp \ src/xsub.hpp src/ypipe.hpp src/ypipe_base.hpp \ src/ypipe_conflate.hpp src/yqueue.hpp src/zmq.cpp \ src/zmq_utils.cpp src/decoder_allocators.cpp \ src/decoder_allocators.hpp src/socket_poller.cpp \ src/socket_poller.hpp src/zap_client.cpp src/zap_client.hpp \ src/zmq_draft.h src/tweetnacl.c src/tweetnacl.h @USE_TWEETNACL_TRUE@am__objects_1 = src/src_libzmq_la-tweetnacl.lo am_src_libzmq_la_OBJECTS = src/src_libzmq_la-address.lo \ src/src_libzmq_la-client.lo src/src_libzmq_la-clock.lo \ src/src_libzmq_la-ctx.lo src/src_libzmq_la-curve_client.lo \ src/src_libzmq_la-curve_mechanism_base.lo \ src/src_libzmq_la-curve_server.lo src/src_libzmq_la-dealer.lo \ src/src_libzmq_la-devpoll.lo src/src_libzmq_la-dgram.lo \ src/src_libzmq_la-dish.lo src/src_libzmq_la-dist.lo \ src/src_libzmq_la-epoll.lo src/src_libzmq_la-err.lo \ src/src_libzmq_la-fq.lo src/src_libzmq_la-gather.lo \ src/src_libzmq_la-gssapi_mechanism_base.lo \ src/src_libzmq_la-gssapi_client.lo \ src/src_libzmq_la-gssapi_server.lo \ src/src_libzmq_la-io_object.lo src/src_libzmq_la-io_thread.lo \ src/src_libzmq_la-ip.lo src/src_libzmq_la-ipc_address.lo \ src/src_libzmq_la-ipc_connecter.lo \ src/src_libzmq_la-ipc_listener.lo src/src_libzmq_la-kqueue.lo \ src/src_libzmq_la-lb.lo src/src_libzmq_la-mailbox.lo \ src/src_libzmq_la-mailbox_safe.lo \ src/src_libzmq_la-mechanism.lo \ src/src_libzmq_la-mechanism_base.lo \ src/src_libzmq_la-metadata.lo src/src_libzmq_la-msg.lo \ src/src_libzmq_la-mtrie.lo src/src_libzmq_la-norm_engine.lo \ src/src_libzmq_la-null_mechanism.lo \ src/src_libzmq_la-object.lo src/src_libzmq_la-options.lo \ src/src_libzmq_la-own.lo src/src_libzmq_la-pair.lo \ src/src_libzmq_la-pgm_receiver.lo \ src/src_libzmq_la-pgm_sender.lo \ src/src_libzmq_la-pgm_socket.lo src/src_libzmq_la-pipe.lo \ src/src_libzmq_la-plain_client.lo \ src/src_libzmq_la-plain_server.lo src/src_libzmq_la-poll.lo \ src/src_libzmq_la-poller_base.lo src/src_libzmq_la-pollset.lo \ src/src_libzmq_la-precompiled.lo src/src_libzmq_la-proxy.lo \ src/src_libzmq_la-pub.lo src/src_libzmq_la-pull.lo \ src/src_libzmq_la-push.lo src/src_libzmq_la-radio.lo \ src/src_libzmq_la-random.lo src/src_libzmq_la-raw_decoder.lo \ src/src_libzmq_la-raw_encoder.lo src/src_libzmq_la-reaper.lo \ src/src_libzmq_la-rep.lo src/src_libzmq_la-req.lo \ src/src_libzmq_la-router.lo src/src_libzmq_la-scatter.lo \ src/src_libzmq_la-select.lo src/src_libzmq_la-server.lo \ src/src_libzmq_la-session_base.lo \ src/src_libzmq_la-signaler.lo src/src_libzmq_la-socket_base.lo \ src/src_libzmq_la-socks.lo \ src/src_libzmq_la-socks_connecter.lo \ src/src_libzmq_la-stream.lo src/src_libzmq_la-stream_engine.lo \ src/src_libzmq_la-sub.lo src/src_libzmq_la-tcp.lo \ src/src_libzmq_la-tcp_address.lo \ src/src_libzmq_la-tcp_connecter.lo \ src/src_libzmq_la-tcp_listener.lo src/src_libzmq_la-thread.lo \ src/src_libzmq_la-timers.lo src/src_libzmq_la-tipc_address.lo \ src/src_libzmq_la-tipc_connecter.lo \ src/src_libzmq_la-tipc_listener.lo src/src_libzmq_la-trie.lo \ src/src_libzmq_la-udp_address.lo \ src/src_libzmq_la-udp_engine.lo \ src/src_libzmq_la-v1_decoder.lo \ src/src_libzmq_la-v2_decoder.lo \ src/src_libzmq_la-v1_encoder.lo \ src/src_libzmq_la-v2_encoder.lo src/src_libzmq_la-vmci.lo \ src/src_libzmq_la-vmci_address.lo \ src/src_libzmq_la-vmci_connecter.lo \ src/src_libzmq_la-vmci_listener.lo src/src_libzmq_la-xpub.lo \ src/src_libzmq_la-xsub.lo src/src_libzmq_la-zmq.lo \ src/src_libzmq_la-zmq_utils.lo \ src/src_libzmq_la-decoder_allocators.lo \ src/src_libzmq_la-socket_poller.lo \ src/src_libzmq_la-zap_client.lo $(am__objects_1) src_libzmq_la_OBJECTS = $(am_src_libzmq_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = src_libzmq_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) $(src_libzmq_la_LDFLAGS) \ $(LDFLAGS) -o $@ @HAVE_CURVE_TRUE@am__EXEEXT_1 = tests/test_security_curve$(EXEEXT) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am__EXEEXT_2 = tests/test_shutdown_stress$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_ipc_wildcard$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_pair_ipc$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_rebind_ipc$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_reqrep_ipc$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_ipc$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_tcp$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_zmq_poll_fd$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_timeo$(EXEEXT) \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_filter_ipc$(EXEEXT) @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@am__EXEEXT_3 = tests/test_fork$(EXEEXT) @BUILD_TIPC_TRUE@am__EXEEXT_4 = \ @BUILD_TIPC_TRUE@ tests/test_connect_delay_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_pair_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_reqrep_device_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_reqrep_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_router_mandatory_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_shutdown_stress_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_sub_forward_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_term_endpoint_tipc$(EXEEXT) \ @BUILD_TIPC_TRUE@ tests/test_address_tipc$(EXEEXT) @BUILD_GSSAPI_TRUE@am__EXEEXT_5 = tests/test_security_gssapi$(EXEEXT) @ON_LINUX_TRUE@am__EXEEXT_6 = tests/test_abstract_ipc$(EXEEXT) \ @ON_LINUX_TRUE@ tests/test_many_sockets$(EXEEXT) @HAVE_VMCI_TRUE@am__EXEEXT_7 = test_pair_vmci$(EXEEXT) \ @HAVE_VMCI_TRUE@ test_reqrep_vmci$(EXEEXT) @ENABLE_DRAFTS_TRUE@am__EXEEXT_8 = tests/test_poller$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_client_server$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_thread_safe$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_timers$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_radio_dish$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_scatter_gather$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_dgram$(EXEEXT) \ @ENABLE_DRAFTS_TRUE@ tests/test_app_meta$(EXEEXT) @ENABLE_STATIC_TRUE@am__EXEEXT_9 = unittests/unittest_poller$(EXEEXT) \ @ENABLE_STATIC_TRUE@ unittests/unittest_ypipe$(EXEEXT) \ @ENABLE_STATIC_TRUE@ unittests/unittest_mtrie$(EXEEXT) am__EXEEXT_10 = tests/test_ancillaries$(EXEEXT) \ tests/test_system$(EXEEXT) tests/test_pair_inproc$(EXEEXT) \ tests/test_pair_tcp$(EXEEXT) tests/test_reqrep_inproc$(EXEEXT) \ tests/test_reqrep_tcp$(EXEEXT) tests/test_hwm$(EXEEXT) \ tests/test_hwm_pubsub$(EXEEXT) \ tests/test_reqrep_device$(EXEEXT) \ tests/test_sub_forward$(EXEEXT) \ tests/test_invalid_rep$(EXEEXT) tests/test_msg_flags$(EXEEXT) \ tests/test_msg_ffn$(EXEEXT) \ tests/test_connect_resolve$(EXEEXT) \ tests/test_immediate$(EXEEXT) \ tests/test_last_endpoint$(EXEEXT) \ tests/test_term_endpoint$(EXEEXT) tests/test_srcfd$(EXEEXT) \ tests/test_monitor$(EXEEXT) \ tests/test_router_mandatory$(EXEEXT) \ tests/test_router_mandatory_hwm$(EXEEXT) \ tests/test_router_handover$(EXEEXT) \ tests/test_probe_router$(EXEEXT) tests/test_stream$(EXEEXT) \ tests/test_stream_empty$(EXEEXT) \ tests/test_stream_disconnect$(EXEEXT) \ tests/test_stream_timeout$(EXEEXT) \ tests/test_disconnect_inproc$(EXEEXT) \ tests/test_unbind_inproc$(EXEEXT) \ tests/test_unbind_wildcard$(EXEEXT) \ tests/test_ctx_options$(EXEEXT) \ tests/test_ctx_destroy$(EXEEXT) \ tests/test_security_null$(EXEEXT) \ tests/test_security_plain$(EXEEXT) \ tests/test_security_zap$(EXEEXT) tests/test_iov$(EXEEXT) \ tests/test_spec_req$(EXEEXT) tests/test_spec_rep$(EXEEXT) \ tests/test_spec_dealer$(EXEEXT) \ tests/test_spec_router$(EXEEXT) \ tests/test_spec_pushpull$(EXEEXT) \ tests/test_req_correlate$(EXEEXT) \ tests/test_req_relaxed$(EXEEXT) tests/test_conflate$(EXEEXT) \ tests/test_inproc_connect$(EXEEXT) \ tests/test_issue_566$(EXEEXT) tests/test_proxy$(EXEEXT) \ tests/test_proxy_single_socket$(EXEEXT) \ tests/test_proxy_terminate$(EXEEXT) \ tests/test_getsockopt_memset$(EXEEXT) \ tests/test_setsockopt$(EXEEXT) tests/test_diffserv$(EXEEXT) \ tests/test_connect_rid$(EXEEXT) \ tests/test_bind_src_address$(EXEEXT) \ tests/test_metadata$(EXEEXT) tests/test_capabilities$(EXEEXT) \ tests/test_xpub_nodrop$(EXEEXT) \ tests/test_xpub_manual$(EXEEXT) \ tests/test_xpub_welcome_msg$(EXEEXT) \ tests/test_xpub_verbose$(EXEEXT) tests/test_atomics$(EXEEXT) \ tests/test_sockopt_hwm$(EXEEXT) tests/test_heartbeats$(EXEEXT) \ tests/test_stream_exceeds_buffer$(EXEEXT) \ tests/test_pub_invert_matching$(EXEEXT) \ tests/test_base85$(EXEEXT) \ tests/test_bind_after_connect_tcp$(EXEEXT) \ tests/test_sodium$(EXEEXT) tests/test_reconnect_ivl$(EXEEXT) \ tests/test_socket_null$(EXEEXT) $(am__EXEEXT_1) \ $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4) \ $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \ $(am__EXEEXT_8) $(am__EXEEXT_9) PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am__perf_inproc_lat_SOURCES_DIST = perf/inproc_lat.cpp @ENABLE_PERF_TRUE@am_perf_inproc_lat_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/inproc_lat.$(OBJEXT) perf_inproc_lat_OBJECTS = $(am_perf_inproc_lat_OBJECTS) @ENABLE_PERF_TRUE@perf_inproc_lat_DEPENDENCIES = src/libzmq.la am__perf_inproc_thr_SOURCES_DIST = perf/inproc_thr.cpp @ENABLE_PERF_TRUE@am_perf_inproc_thr_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/inproc_thr.$(OBJEXT) perf_inproc_thr_OBJECTS = $(am_perf_inproc_thr_OBJECTS) @ENABLE_PERF_TRUE@perf_inproc_thr_DEPENDENCIES = src/libzmq.la am__perf_local_lat_SOURCES_DIST = perf/local_lat.cpp @ENABLE_PERF_TRUE@am_perf_local_lat_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/local_lat.$(OBJEXT) perf_local_lat_OBJECTS = $(am_perf_local_lat_OBJECTS) @ENABLE_PERF_TRUE@perf_local_lat_DEPENDENCIES = src/libzmq.la am__perf_local_thr_SOURCES_DIST = perf/local_thr.cpp @ENABLE_PERF_TRUE@am_perf_local_thr_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/local_thr.$(OBJEXT) perf_local_thr_OBJECTS = $(am_perf_local_thr_OBJECTS) @ENABLE_PERF_TRUE@perf_local_thr_DEPENDENCIES = src/libzmq.la am__perf_remote_lat_SOURCES_DIST = perf/remote_lat.cpp @ENABLE_PERF_TRUE@am_perf_remote_lat_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/remote_lat.$(OBJEXT) perf_remote_lat_OBJECTS = $(am_perf_remote_lat_OBJECTS) @ENABLE_PERF_TRUE@perf_remote_lat_DEPENDENCIES = src/libzmq.la am__perf_remote_thr_SOURCES_DIST = perf/remote_thr.cpp @ENABLE_PERF_TRUE@am_perf_remote_thr_OBJECTS = \ @ENABLE_PERF_TRUE@ perf/remote_thr.$(OBJEXT) perf_remote_thr_OBJECTS = $(am_perf_remote_thr_OBJECTS) @ENABLE_PERF_TRUE@perf_remote_thr_DEPENDENCIES = src/libzmq.la am__test_pair_vmci_SOURCES_DIST = tests/test_pair_vmci.cpp @HAVE_VMCI_TRUE@am_test_pair_vmci_OBJECTS = \ @HAVE_VMCI_TRUE@ tests/test_pair_vmci-test_pair_vmci.$(OBJEXT) test_pair_vmci_OBJECTS = $(am_test_pair_vmci_OBJECTS) @HAVE_VMCI_TRUE@test_pair_vmci_DEPENDENCIES = libzmq.la test_pair_vmci_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(test_pair_vmci_CXXFLAGS) $(CXXFLAGS) \ $(test_pair_vmci_LDFLAGS) $(LDFLAGS) -o $@ am__test_reqrep_vmci_SOURCES_DIST = tests/test_reqrep_vmci.cpp @HAVE_VMCI_TRUE@am_test_reqrep_vmci_OBJECTS = tests/test_reqrep_vmci-test_reqrep_vmci.$(OBJEXT) test_reqrep_vmci_OBJECTS = $(am_test_reqrep_vmci_OBJECTS) @HAVE_VMCI_TRUE@test_reqrep_vmci_DEPENDENCIES = libzmq.la test_reqrep_vmci_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(test_reqrep_vmci_CXXFLAGS) $(CXXFLAGS) \ $(test_reqrep_vmci_LDFLAGS) $(LDFLAGS) -o $@ am__tests_test_abstract_ipc_SOURCES_DIST = \ tests/test_abstract_ipc.cpp @ON_LINUX_TRUE@am_tests_test_abstract_ipc_OBJECTS = \ @ON_LINUX_TRUE@ tests/test_abstract_ipc.$(OBJEXT) tests_test_abstract_ipc_OBJECTS = \ $(am_tests_test_abstract_ipc_OBJECTS) @ON_LINUX_TRUE@tests_test_abstract_ipc_DEPENDENCIES = src/libzmq.la am__tests_test_address_tipc_SOURCES_DIST = \ tests/test_address_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_address_tipc_OBJECTS = tests/tests_test_address_tipc-test_address_tipc.$(OBJEXT) tests_test_address_tipc_OBJECTS = \ $(am_tests_test_address_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_address_tipc_DEPENDENCIES = src/libzmq.la \ @BUILD_TIPC_TRUE@ $(UNITY_LIBS) am_tests_test_ancillaries_OBJECTS = tests/test_ancillaries.$(OBJEXT) tests_test_ancillaries_OBJECTS = $(am_tests_test_ancillaries_OBJECTS) tests_test_ancillaries_DEPENDENCIES = src/libzmq.la am__tests_test_app_meta_SOURCES_DIST = tests/test_app_meta.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_app_meta_OBJECTS = tests/tests_test_app_meta-test_app_meta.$(OBJEXT) tests_test_app_meta_OBJECTS = $(am_tests_test_app_meta_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_app_meta_DEPENDENCIES = src/libzmq.la \ @ENABLE_DRAFTS_TRUE@ $(UNITY_LIBS) am_tests_test_atomics_OBJECTS = tests/test_atomics.$(OBJEXT) tests_test_atomics_OBJECTS = $(am_tests_test_atomics_OBJECTS) tests_test_atomics_DEPENDENCIES = src/libzmq.la am_tests_test_base85_OBJECTS = tests/test_base85.$(OBJEXT) tests_test_base85_OBJECTS = $(am_tests_test_base85_OBJECTS) tests_test_base85_DEPENDENCIES = src/libzmq.la am_tests_test_bind_after_connect_tcp_OBJECTS = tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.$(OBJEXT) tests_test_bind_after_connect_tcp_OBJECTS = \ $(am_tests_test_bind_after_connect_tcp_OBJECTS) tests_test_bind_after_connect_tcp_DEPENDENCIES = src/libzmq.la \ $(UNITY_LIBS) am_tests_test_bind_src_address_OBJECTS = tests/tests_test_bind_src_address-test_bind_src_address.$(OBJEXT) tests_test_bind_src_address_OBJECTS = \ $(am_tests_test_bind_src_address_OBJECTS) tests_test_bind_src_address_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_capabilities_OBJECTS = \ tests/test_capabilities.$(OBJEXT) tests_test_capabilities_OBJECTS = \ $(am_tests_test_capabilities_OBJECTS) tests_test_capabilities_DEPENDENCIES = src/libzmq.la am__tests_test_client_server_SOURCES_DIST = \ tests/test_client_server.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_client_server_OBJECTS = tests/tests_test_client_server-test_client_server.$(OBJEXT) tests_test_client_server_OBJECTS = \ $(am_tests_test_client_server_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_client_server_DEPENDENCIES = \ @ENABLE_DRAFTS_TRUE@ src/libzmq.la $(UNITY_LIBS) am_tests_test_conflate_OBJECTS = \ tests/tests_test_conflate-test_conflate.$(OBJEXT) tests_test_conflate_OBJECTS = $(am_tests_test_conflate_OBJECTS) tests_test_conflate_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am__tests_test_connect_delay_tipc_SOURCES_DIST = \ tests/test_connect_delay_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_connect_delay_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_connect_delay_tipc.$(OBJEXT) tests_test_connect_delay_tipc_OBJECTS = \ $(am_tests_test_connect_delay_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_connect_delay_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am_tests_test_connect_resolve_OBJECTS = tests/tests_test_connect_resolve-test_connect_resolve.$(OBJEXT) tests_test_connect_resolve_OBJECTS = \ $(am_tests_test_connect_resolve_OBJECTS) tests_test_connect_resolve_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_connect_rid_OBJECTS = tests/test_connect_rid.$(OBJEXT) tests_test_connect_rid_OBJECTS = $(am_tests_test_connect_rid_OBJECTS) tests_test_connect_rid_DEPENDENCIES = src/libzmq.la am_tests_test_ctx_destroy_OBJECTS = \ tests/tests_test_ctx_destroy-test_ctx_destroy.$(OBJEXT) tests_test_ctx_destroy_OBJECTS = $(am_tests_test_ctx_destroy_OBJECTS) tests_test_ctx_destroy_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_ctx_options_OBJECTS = tests/test_ctx_options.$(OBJEXT) tests_test_ctx_options_OBJECTS = $(am_tests_test_ctx_options_OBJECTS) tests_test_ctx_options_DEPENDENCIES = src/libzmq.la am__tests_test_dgram_SOURCES_DIST = tests/test_dgram.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_dgram_OBJECTS = \ @ENABLE_DRAFTS_TRUE@ tests/test_dgram.$(OBJEXT) tests_test_dgram_OBJECTS = $(am_tests_test_dgram_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_dgram_DEPENDENCIES = src/libzmq.la am_tests_test_diffserv_OBJECTS = tests/test_diffserv.$(OBJEXT) tests_test_diffserv_OBJECTS = $(am_tests_test_diffserv_OBJECTS) tests_test_diffserv_DEPENDENCIES = src/libzmq.la am_tests_test_disconnect_inproc_OBJECTS = \ tests/test_disconnect_inproc.$(OBJEXT) tests_test_disconnect_inproc_OBJECTS = \ $(am_tests_test_disconnect_inproc_OBJECTS) tests_test_disconnect_inproc_DEPENDENCIES = src/libzmq.la am__tests_test_filter_ipc_SOURCES_DIST = tests/test_filter_ipc.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_filter_ipc_OBJECTS = tests/test_filter_ipc.$(OBJEXT) tests_test_filter_ipc_OBJECTS = $(am_tests_test_filter_ipc_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_filter_ipc_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am__tests_test_fork_SOURCES_DIST = tests/test_fork.cpp @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@am_tests_test_fork_OBJECTS = tests/test_fork.$(OBJEXT) tests_test_fork_OBJECTS = $(am_tests_test_fork_OBJECTS) @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@tests_test_fork_DEPENDENCIES = src/libzmq.la am_tests_test_getsockopt_memset_OBJECTS = \ tests/test_getsockopt_memset.$(OBJEXT) tests_test_getsockopt_memset_OBJECTS = \ $(am_tests_test_getsockopt_memset_OBJECTS) tests_test_getsockopt_memset_DEPENDENCIES = src/libzmq.la am_tests_test_heartbeats_OBJECTS = tests/test_heartbeats.$(OBJEXT) tests_test_heartbeats_OBJECTS = $(am_tests_test_heartbeats_OBJECTS) tests_test_heartbeats_DEPENDENCIES = src/libzmq.la am_tests_test_hwm_OBJECTS = tests/tests_test_hwm-test_hwm.$(OBJEXT) tests_test_hwm_OBJECTS = $(am_tests_test_hwm_OBJECTS) tests_test_hwm_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_hwm_pubsub_OBJECTS = tests/test_hwm_pubsub.$(OBJEXT) tests_test_hwm_pubsub_OBJECTS = $(am_tests_test_hwm_pubsub_OBJECTS) tests_test_hwm_pubsub_DEPENDENCIES = src/libzmq.la am_tests_test_immediate_OBJECTS = \ tests/tests_test_immediate-test_immediate.$(OBJEXT) tests_test_immediate_OBJECTS = $(am_tests_test_immediate_OBJECTS) tests_test_immediate_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_inproc_connect_OBJECTS = \ tests/test_inproc_connect.$(OBJEXT) tests_test_inproc_connect_OBJECTS = \ $(am_tests_test_inproc_connect_OBJECTS) tests_test_inproc_connect_DEPENDENCIES = src/libzmq.la am_tests_test_invalid_rep_OBJECTS = tests/test_invalid_rep.$(OBJEXT) tests_test_invalid_rep_OBJECTS = $(am_tests_test_invalid_rep_OBJECTS) tests_test_invalid_rep_DEPENDENCIES = src/libzmq.la am_tests_test_iov_OBJECTS = tests/test_iov.$(OBJEXT) tests_test_iov_OBJECTS = $(am_tests_test_iov_OBJECTS) tests_test_iov_DEPENDENCIES = src/libzmq.la am__tests_test_ipc_wildcard_SOURCES_DIST = \ tests/test_ipc_wildcard.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_ipc_wildcard_OBJECTS = tests/test_ipc_wildcard.$(OBJEXT) tests_test_ipc_wildcard_OBJECTS = \ $(am_tests_test_ipc_wildcard_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_ipc_wildcard_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am_tests_test_issue_566_OBJECTS = tests/test_issue_566.$(OBJEXT) tests_test_issue_566_OBJECTS = $(am_tests_test_issue_566_OBJECTS) tests_test_issue_566_DEPENDENCIES = src/libzmq.la am_tests_test_last_endpoint_OBJECTS = \ tests/tests_test_last_endpoint-test_last_endpoint.$(OBJEXT) tests_test_last_endpoint_OBJECTS = \ $(am_tests_test_last_endpoint_OBJECTS) tests_test_last_endpoint_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_many_sockets_OBJECTS = \ tests/test_many_sockets.$(OBJEXT) tests_test_many_sockets_OBJECTS = \ $(am_tests_test_many_sockets_OBJECTS) tests_test_many_sockets_DEPENDENCIES = src/libzmq.la am_tests_test_metadata_OBJECTS = tests/test_metadata.$(OBJEXT) tests_test_metadata_OBJECTS = $(am_tests_test_metadata_OBJECTS) tests_test_metadata_DEPENDENCIES = src/libzmq.la am_tests_test_monitor_OBJECTS = tests/test_monitor.$(OBJEXT) tests_test_monitor_OBJECTS = $(am_tests_test_monitor_OBJECTS) tests_test_monitor_DEPENDENCIES = src/libzmq.la am_tests_test_msg_ffn_OBJECTS = tests/test_msg_ffn.$(OBJEXT) tests_test_msg_ffn_OBJECTS = $(am_tests_test_msg_ffn_OBJECTS) tests_test_msg_ffn_DEPENDENCIES = src/libzmq.la am_tests_test_msg_flags_OBJECTS = tests/test_msg_flags.$(OBJEXT) tests_test_msg_flags_OBJECTS = $(am_tests_test_msg_flags_OBJECTS) tests_test_msg_flags_DEPENDENCIES = src/libzmq.la am_tests_test_pair_inproc_OBJECTS = tests/test_pair_inproc.$(OBJEXT) tests_test_pair_inproc_OBJECTS = $(am_tests_test_pair_inproc_OBJECTS) tests_test_pair_inproc_DEPENDENCIES = src/libzmq.la am__tests_test_pair_ipc_SOURCES_DIST = tests/test_pair_ipc.cpp \ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_pair_ipc_OBJECTS = tests/test_pair_ipc.$(OBJEXT) tests_test_pair_ipc_OBJECTS = $(am_tests_test_pair_ipc_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_pair_ipc_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am_tests_test_pair_tcp_OBJECTS = tests/test_pair_tcp.$(OBJEXT) tests_test_pair_tcp_OBJECTS = $(am_tests_test_pair_tcp_OBJECTS) tests_test_pair_tcp_DEPENDENCIES = src/libzmq.la am__tests_test_pair_tipc_SOURCES_DIST = tests/test_pair_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_pair_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_pair_tipc.$(OBJEXT) tests_test_pair_tipc_OBJECTS = $(am_tests_test_pair_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_pair_tipc_DEPENDENCIES = src/libzmq.la am__tests_test_poller_SOURCES_DIST = tests/test_poller.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_poller_OBJECTS = tests/tests_test_poller-test_poller.$(OBJEXT) tests_test_poller_OBJECTS = $(am_tests_test_poller_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_poller_DEPENDENCIES = src/libzmq.la \ @ENABLE_DRAFTS_TRUE@ $(UNITY_LIBS) am_tests_test_probe_router_OBJECTS = \ tests/test_probe_router.$(OBJEXT) tests_test_probe_router_OBJECTS = \ $(am_tests_test_probe_router_OBJECTS) tests_test_probe_router_DEPENDENCIES = src/libzmq.la am_tests_test_proxy_OBJECTS = tests/test_proxy.$(OBJEXT) tests_test_proxy_OBJECTS = $(am_tests_test_proxy_OBJECTS) tests_test_proxy_DEPENDENCIES = src/libzmq.la am_tests_test_proxy_single_socket_OBJECTS = \ tests/test_proxy_single_socket.$(OBJEXT) tests_test_proxy_single_socket_OBJECTS = \ $(am_tests_test_proxy_single_socket_OBJECTS) tests_test_proxy_single_socket_DEPENDENCIES = src/libzmq.la am_tests_test_proxy_terminate_OBJECTS = \ tests/test_proxy_terminate.$(OBJEXT) tests_test_proxy_terminate_OBJECTS = \ $(am_tests_test_proxy_terminate_OBJECTS) tests_test_proxy_terminate_DEPENDENCIES = src/libzmq.la am_tests_test_pub_invert_matching_OBJECTS = \ tests/test_pub_invert_matching.$(OBJEXT) tests_test_pub_invert_matching_OBJECTS = \ $(am_tests_test_pub_invert_matching_OBJECTS) tests_test_pub_invert_matching_DEPENDENCIES = src/libzmq.la am__tests_test_radio_dish_SOURCES_DIST = tests/test_radio_dish.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_radio_dish_OBJECTS = tests/tests_test_radio_dish-test_radio_dish.$(OBJEXT) tests_test_radio_dish_OBJECTS = $(am_tests_test_radio_dish_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_radio_dish_DEPENDENCIES = \ @ENABLE_DRAFTS_TRUE@ src/libzmq.la $(UNITY_LIBS) am__tests_test_rebind_ipc_SOURCES_DIST = tests/test_rebind_ipc.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_rebind_ipc_OBJECTS = tests/test_rebind_ipc.$(OBJEXT) tests_test_rebind_ipc_OBJECTS = $(am_tests_test_rebind_ipc_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_rebind_ipc_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am_tests_test_reconnect_ivl_OBJECTS = \ tests/tests_test_reconnect_ivl-test_reconnect_ivl.$(OBJEXT) tests_test_reconnect_ivl_OBJECTS = \ $(am_tests_test_reconnect_ivl_OBJECTS) tests_test_reconnect_ivl_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_req_correlate_OBJECTS = \ tests/test_req_correlate.$(OBJEXT) tests_test_req_correlate_OBJECTS = \ $(am_tests_test_req_correlate_OBJECTS) tests_test_req_correlate_DEPENDENCIES = src/libzmq.la am_tests_test_req_relaxed_OBJECTS = tests/test_req_relaxed.$(OBJEXT) tests_test_req_relaxed_OBJECTS = $(am_tests_test_req_relaxed_OBJECTS) tests_test_req_relaxed_DEPENDENCIES = src/libzmq.la am_tests_test_reqrep_device_OBJECTS = \ tests/test_reqrep_device.$(OBJEXT) tests_test_reqrep_device_OBJECTS = \ $(am_tests_test_reqrep_device_OBJECTS) tests_test_reqrep_device_DEPENDENCIES = src/libzmq.la am__tests_test_reqrep_device_tipc_SOURCES_DIST = \ tests/test_reqrep_device_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_reqrep_device_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_reqrep_device_tipc.$(OBJEXT) tests_test_reqrep_device_tipc_OBJECTS = \ $(am_tests_test_reqrep_device_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_reqrep_device_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am_tests_test_reqrep_inproc_OBJECTS = \ tests/test_reqrep_inproc.$(OBJEXT) tests_test_reqrep_inproc_OBJECTS = \ $(am_tests_test_reqrep_inproc_OBJECTS) tests_test_reqrep_inproc_DEPENDENCIES = src/libzmq.la am__tests_test_reqrep_ipc_SOURCES_DIST = tests/test_reqrep_ipc.cpp \ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_reqrep_ipc_OBJECTS = tests/test_reqrep_ipc.$(OBJEXT) tests_test_reqrep_ipc_OBJECTS = $(am_tests_test_reqrep_ipc_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_reqrep_ipc_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am_tests_test_reqrep_tcp_OBJECTS = \ tests/tests_test_reqrep_tcp-test_reqrep_tcp.$(OBJEXT) tests_test_reqrep_tcp_OBJECTS = $(am_tests_test_reqrep_tcp_OBJECTS) tests_test_reqrep_tcp_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am__tests_test_reqrep_tipc_SOURCES_DIST = tests/test_reqrep_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_reqrep_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_reqrep_tipc.$(OBJEXT) tests_test_reqrep_tipc_OBJECTS = $(am_tests_test_reqrep_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_reqrep_tipc_DEPENDENCIES = src/libzmq.la am_tests_test_router_handover_OBJECTS = tests/tests_test_router_handover-test_router_handover.$(OBJEXT) tests_test_router_handover_OBJECTS = \ $(am_tests_test_router_handover_OBJECTS) tests_test_router_handover_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_router_mandatory_OBJECTS = tests/tests_test_router_mandatory-test_router_mandatory.$(OBJEXT) tests_test_router_mandatory_OBJECTS = \ $(am_tests_test_router_mandatory_OBJECTS) tests_test_router_mandatory_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_router_mandatory_hwm_OBJECTS = \ tests/test_router_mandatory_hwm.$(OBJEXT) tests_test_router_mandatory_hwm_OBJECTS = \ $(am_tests_test_router_mandatory_hwm_OBJECTS) tests_test_router_mandatory_hwm_DEPENDENCIES = src/libzmq.la am__tests_test_router_mandatory_tipc_SOURCES_DIST = \ tests/test_router_mandatory_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_router_mandatory_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_router_mandatory_tipc.$(OBJEXT) tests_test_router_mandatory_tipc_OBJECTS = \ $(am_tests_test_router_mandatory_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_router_mandatory_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am__tests_test_scatter_gather_SOURCES_DIST = \ tests/test_scatter_gather.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_scatter_gather_OBJECTS = \ @ENABLE_DRAFTS_TRUE@ tests/test_scatter_gather.$(OBJEXT) tests_test_scatter_gather_OBJECTS = \ $(am_tests_test_scatter_gather_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_scatter_gather_DEPENDENCIES = \ @ENABLE_DRAFTS_TRUE@ src/libzmq.la am__tests_test_security_curve_SOURCES_DIST = \ tests/test_security_curve.cpp tests/testutil_security.hpp \ tests/testutil.hpp src/curve_client_tools.hpp src/clock.hpp \ src/clock.cpp src/random.hpp src/random.cpp src/err.hpp \ src/err.cpp src/tweetnacl.c @HAVE_CURVE_TRUE@@USE_TWEETNACL_TRUE@am__objects_2 = src/tests_test_security_curve-tweetnacl.$(OBJEXT) @HAVE_CURVE_TRUE@am_tests_test_security_curve_OBJECTS = tests/tests_test_security_curve-test_security_curve.$(OBJEXT) \ @HAVE_CURVE_TRUE@ src/tests_test_security_curve-clock.$(OBJEXT) \ @HAVE_CURVE_TRUE@ src/tests_test_security_curve-random.$(OBJEXT) \ @HAVE_CURVE_TRUE@ src/tests_test_security_curve-err.$(OBJEXT) \ @HAVE_CURVE_TRUE@ $(am__objects_2) tests_test_security_curve_OBJECTS = \ $(am_tests_test_security_curve_OBJECTS) @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@am__DEPENDENCIES_6 = \ @HAVE_CURVE_TRUE@@USE_LIBSODIUM_TRUE@ $(am__DEPENDENCIES_1) @HAVE_CURVE_TRUE@tests_test_security_curve_DEPENDENCIES = \ @HAVE_CURVE_TRUE@ src/libzmq.la $(UNITY_LIBS) \ @HAVE_CURVE_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_6) am__tests_test_security_gssapi_SOURCES_DIST = \ tests/test_security_gssapi.cpp @BUILD_GSSAPI_TRUE@am_tests_test_security_gssapi_OBJECTS = \ @BUILD_GSSAPI_TRUE@ tests/test_security_gssapi.$(OBJEXT) tests_test_security_gssapi_OBJECTS = \ $(am_tests_test_security_gssapi_OBJECTS) @BUILD_GSSAPI_TRUE@tests_test_security_gssapi_DEPENDENCIES = \ @BUILD_GSSAPI_TRUE@ src/libzmq.la am_tests_test_security_null_OBJECTS = \ tests/test_security_null.$(OBJEXT) tests_test_security_null_OBJECTS = \ $(am_tests_test_security_null_OBJECTS) tests_test_security_null_DEPENDENCIES = src/libzmq.la am_tests_test_security_plain_OBJECTS = \ tests/test_security_plain.$(OBJEXT) tests_test_security_plain_OBJECTS = \ $(am_tests_test_security_plain_OBJECTS) tests_test_security_plain_DEPENDENCIES = src/libzmq.la am_tests_test_security_zap_OBJECTS = \ tests/test_security_zap.$(OBJEXT) tests_test_security_zap_OBJECTS = \ $(am_tests_test_security_zap_OBJECTS) tests_test_security_zap_DEPENDENCIES = src/libzmq.la am_tests_test_setsockopt_OBJECTS = tests/test_setsockopt.$(OBJEXT) tests_test_setsockopt_OBJECTS = $(am_tests_test_setsockopt_OBJECTS) tests_test_setsockopt_DEPENDENCIES = src/libzmq.la am__tests_test_shutdown_stress_SOURCES_DIST = \ tests/test_shutdown_stress.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_shutdown_stress_OBJECTS = tests/test_shutdown_stress.$(OBJEXT) tests_test_shutdown_stress_OBJECTS = \ $(am_tests_test_shutdown_stress_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_shutdown_stress_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am__tests_test_shutdown_stress_tipc_SOURCES_DIST = \ tests/test_shutdown_stress_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_shutdown_stress_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_shutdown_stress_tipc.$(OBJEXT) tests_test_shutdown_stress_tipc_OBJECTS = \ $(am_tests_test_shutdown_stress_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_shutdown_stress_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am_tests_test_socket_null_OBJECTS = \ tests/tests_test_socket_null-test_socket_null.$(OBJEXT) tests_test_socket_null_OBJECTS = $(am_tests_test_socket_null_OBJECTS) tests_test_socket_null_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_sockopt_hwm_OBJECTS = \ tests/tests_test_sockopt_hwm-test_sockopt_hwm.$(OBJEXT) tests_test_sockopt_hwm_OBJECTS = $(am_tests_test_sockopt_hwm_OBJECTS) tests_test_sockopt_hwm_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_sodium_OBJECTS = tests/test_sodium.$(OBJEXT) tests_test_sodium_OBJECTS = $(am_tests_test_sodium_OBJECTS) tests_test_sodium_DEPENDENCIES = src/libzmq.la am_tests_test_spec_dealer_OBJECTS = tests/test_spec_dealer.$(OBJEXT) tests_test_spec_dealer_OBJECTS = $(am_tests_test_spec_dealer_OBJECTS) tests_test_spec_dealer_DEPENDENCIES = src/libzmq.la am_tests_test_spec_pushpull_OBJECTS = \ tests/test_spec_pushpull.$(OBJEXT) tests_test_spec_pushpull_OBJECTS = \ $(am_tests_test_spec_pushpull_OBJECTS) tests_test_spec_pushpull_DEPENDENCIES = src/libzmq.la am_tests_test_spec_rep_OBJECTS = tests/test_spec_rep.$(OBJEXT) tests_test_spec_rep_OBJECTS = $(am_tests_test_spec_rep_OBJECTS) tests_test_spec_rep_DEPENDENCIES = src/libzmq.la am_tests_test_spec_req_OBJECTS = tests/test_spec_req.$(OBJEXT) tests_test_spec_req_OBJECTS = $(am_tests_test_spec_req_OBJECTS) tests_test_spec_req_DEPENDENCIES = src/libzmq.la am_tests_test_spec_router_OBJECTS = tests/test_spec_router.$(OBJEXT) tests_test_spec_router_OBJECTS = $(am_tests_test_spec_router_OBJECTS) tests_test_spec_router_DEPENDENCIES = src/libzmq.la am_tests_test_srcfd_OBJECTS = tests/test_srcfd.$(OBJEXT) tests_test_srcfd_OBJECTS = $(am_tests_test_srcfd_OBJECTS) tests_test_srcfd_DEPENDENCIES = src/libzmq.la am_tests_test_stream_OBJECTS = tests/test_stream.$(OBJEXT) tests_test_stream_OBJECTS = $(am_tests_test_stream_OBJECTS) tests_test_stream_DEPENDENCIES = src/libzmq.la am_tests_test_stream_disconnect_OBJECTS = \ tests/test_stream_disconnect.$(OBJEXT) tests_test_stream_disconnect_OBJECTS = \ $(am_tests_test_stream_disconnect_OBJECTS) tests_test_stream_disconnect_DEPENDENCIES = src/libzmq.la am_tests_test_stream_empty_OBJECTS = \ tests/test_stream_empty.$(OBJEXT) tests_test_stream_empty_OBJECTS = \ $(am_tests_test_stream_empty_OBJECTS) tests_test_stream_empty_DEPENDENCIES = src/libzmq.la am_tests_test_stream_exceeds_buffer_OBJECTS = \ tests/test_stream_exceeds_buffer.$(OBJEXT) tests_test_stream_exceeds_buffer_OBJECTS = \ $(am_tests_test_stream_exceeds_buffer_OBJECTS) tests_test_stream_exceeds_buffer_DEPENDENCIES = src/libzmq.la am_tests_test_stream_timeout_OBJECTS = \ tests/test_stream_timeout.$(OBJEXT) tests_test_stream_timeout_OBJECTS = \ $(am_tests_test_stream_timeout_OBJECTS) tests_test_stream_timeout_DEPENDENCIES = src/libzmq.la am_tests_test_sub_forward_OBJECTS = tests/test_sub_forward.$(OBJEXT) tests_test_sub_forward_OBJECTS = $(am_tests_test_sub_forward_OBJECTS) tests_test_sub_forward_DEPENDENCIES = src/libzmq.la am__tests_test_sub_forward_tipc_SOURCES_DIST = \ tests/test_sub_forward_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_sub_forward_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_sub_forward_tipc.$(OBJEXT) tests_test_sub_forward_tipc_OBJECTS = \ $(am_tests_test_sub_forward_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_sub_forward_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am_tests_test_system_OBJECTS = tests/test_system.$(OBJEXT) tests_test_system_OBJECTS = $(am_tests_test_system_OBJECTS) tests_test_system_DEPENDENCIES = src/libzmq.la am_tests_test_term_endpoint_OBJECTS = \ tests/test_term_endpoint.$(OBJEXT) tests_test_term_endpoint_OBJECTS = \ $(am_tests_test_term_endpoint_OBJECTS) tests_test_term_endpoint_DEPENDENCIES = src/libzmq.la am__tests_test_term_endpoint_tipc_SOURCES_DIST = \ tests/test_term_endpoint_tipc.cpp @BUILD_TIPC_TRUE@am_tests_test_term_endpoint_tipc_OBJECTS = \ @BUILD_TIPC_TRUE@ tests/test_term_endpoint_tipc.$(OBJEXT) tests_test_term_endpoint_tipc_OBJECTS = \ $(am_tests_test_term_endpoint_tipc_OBJECTS) @BUILD_TIPC_TRUE@tests_test_term_endpoint_tipc_DEPENDENCIES = \ @BUILD_TIPC_TRUE@ src/libzmq.la am__tests_test_thread_safe_SOURCES_DIST = tests/test_thread_safe.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_thread_safe_OBJECTS = tests/tests_test_thread_safe-test_thread_safe.$(OBJEXT) tests_test_thread_safe_OBJECTS = $(am_tests_test_thread_safe_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_thread_safe_DEPENDENCIES = \ @ENABLE_DRAFTS_TRUE@ src/libzmq.la $(UNITY_LIBS) am__tests_test_timeo_SOURCES_DIST = tests/test_timeo.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_timeo_OBJECTS = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_timeo.$(OBJEXT) tests_test_timeo_OBJECTS = $(am_tests_test_timeo_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_timeo_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am__tests_test_timers_SOURCES_DIST = tests/test_timers.cpp @ENABLE_DRAFTS_TRUE@am_tests_test_timers_OBJECTS = \ @ENABLE_DRAFTS_TRUE@ tests/test_timers.$(OBJEXT) tests_test_timers_OBJECTS = $(am_tests_test_timers_OBJECTS) @ENABLE_DRAFTS_TRUE@tests_test_timers_DEPENDENCIES = src/libzmq.la am_tests_test_unbind_inproc_OBJECTS = \ tests/test_unbind_inproc.$(OBJEXT) tests_test_unbind_inproc_OBJECTS = \ $(am_tests_test_unbind_inproc_OBJECTS) tests_test_unbind_inproc_DEPENDENCIES = src/libzmq.la am_tests_test_unbind_wildcard_OBJECTS = \ tests/test_unbind_wildcard.$(OBJEXT) tests_test_unbind_wildcard_OBJECTS = \ $(am_tests_test_unbind_wildcard_OBJECTS) tests_test_unbind_wildcard_DEPENDENCIES = src/libzmq.la am__tests_test_use_fd_ipc_SOURCES_DIST = tests/test_use_fd_ipc.cpp \ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_use_fd_ipc_OBJECTS = tests/test_use_fd_ipc.$(OBJEXT) tests_test_use_fd_ipc_OBJECTS = $(am_tests_test_use_fd_ipc_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_ipc_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am__tests_test_use_fd_tcp_SOURCES_DIST = tests/test_use_fd_tcp.cpp \ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_use_fd_tcp_OBJECTS = tests/test_use_fd_tcp.$(OBJEXT) tests_test_use_fd_tcp_OBJECTS = $(am_tests_test_use_fd_tcp_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_tcp_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am_tests_test_xpub_manual_OBJECTS = tests/test_xpub_manual.$(OBJEXT) tests_test_xpub_manual_OBJECTS = $(am_tests_test_xpub_manual_OBJECTS) tests_test_xpub_manual_DEPENDENCIES = src/libzmq.la am_tests_test_xpub_nodrop_OBJECTS = tests/test_xpub_nodrop.$(OBJEXT) tests_test_xpub_nodrop_OBJECTS = $(am_tests_test_xpub_nodrop_OBJECTS) tests_test_xpub_nodrop_DEPENDENCIES = src/libzmq.la am_tests_test_xpub_verbose_OBJECTS = \ tests/tests_test_xpub_verbose-test_xpub_verbose.$(OBJEXT) tests_test_xpub_verbose_OBJECTS = \ $(am_tests_test_xpub_verbose_OBJECTS) tests_test_xpub_verbose_DEPENDENCIES = src/libzmq.la $(UNITY_LIBS) am_tests_test_xpub_welcome_msg_OBJECTS = \ tests/test_xpub_welcome_msg.$(OBJEXT) tests_test_xpub_welcome_msg_OBJECTS = \ $(am_tests_test_xpub_welcome_msg_OBJECTS) tests_test_xpub_welcome_msg_DEPENDENCIES = src/libzmq.la am__tests_test_zmq_poll_fd_SOURCES_DIST = tests/test_zmq_poll_fd.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@am_tests_test_zmq_poll_fd_OBJECTS = tests/test_zmq_poll_fd.$(OBJEXT) tests_test_zmq_poll_fd_OBJECTS = $(am_tests_test_zmq_poll_fd_OBJECTS) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_zmq_poll_fd_DEPENDENCIES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ src/libzmq.la am__tools_curve_keygen_SOURCES_DIST = tools/curve_keygen.cpp @ENABLE_CURVE_KEYGEN_TRUE@am_tools_curve_keygen_OBJECTS = \ @ENABLE_CURVE_KEYGEN_TRUE@ tools/curve_keygen.$(OBJEXT) tools_curve_keygen_OBJECTS = $(am_tools_curve_keygen_OBJECTS) @ENABLE_CURVE_KEYGEN_TRUE@tools_curve_keygen_DEPENDENCIES = \ @ENABLE_CURVE_KEYGEN_TRUE@ src/libzmq.la am__unittests_unittest_mtrie_SOURCES_DIST = \ unittests/unittest_mtrie.cpp @ENABLE_STATIC_TRUE@am_unittests_unittest_mtrie_OBJECTS = unittests/unittests_unittest_mtrie-unittest_mtrie.$(OBJEXT) unittests_unittest_mtrie_OBJECTS = \ $(am_unittests_unittest_mtrie_OBJECTS) am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) @ENABLE_STATIC_TRUE@unittests_unittest_mtrie_DEPENDENCIES = \ @ENABLE_STATIC_TRUE@ $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_7) $(UNITY_LIBS) \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_1) unittests_unittest_mtrie_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(unittests_unittest_mtrie_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am__unittests_unittest_poller_SOURCES_DIST = \ unittests/unittest_poller.cpp @ENABLE_STATIC_TRUE@am_unittests_unittest_poller_OBJECTS = unittests/unittests_unittest_poller-unittest_poller.$(OBJEXT) unittests_unittest_poller_OBJECTS = \ $(am_unittests_unittest_poller_OBJECTS) @ENABLE_STATIC_TRUE@unittests_unittest_poller_DEPENDENCIES = \ @ENABLE_STATIC_TRUE@ $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_7) $(UNITY_LIBS) \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_1) unittests_unittest_poller_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(unittests_unittest_poller_CXXFLAGS) $(CXXFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__unittests_unittest_ypipe_SOURCES_DIST = \ unittests/unittest_ypipe.cpp @ENABLE_STATIC_TRUE@am_unittests_unittest_ypipe_OBJECTS = unittests/unittests_unittest_ypipe-unittest_ypipe.$(OBJEXT) unittests_unittest_ypipe_OBJECTS = \ $(am_unittests_unittest_ypipe_OBJECTS) @ENABLE_STATIC_TRUE@unittests_unittest_ypipe_DEPENDENCIES = \ @ENABLE_STATIC_TRUE@ $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_7) $(UNITY_LIBS) \ @ENABLE_STATIC_TRUE@ $(am__DEPENDENCIES_1) unittests_unittest_ypipe_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(unittests_unittest_ypipe_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(external_unity_libunity_a_SOURCES) \ $(src_libzmq_la_SOURCES) $(perf_inproc_lat_SOURCES) \ $(perf_inproc_thr_SOURCES) $(perf_local_lat_SOURCES) \ $(perf_local_thr_SOURCES) $(perf_remote_lat_SOURCES) \ $(perf_remote_thr_SOURCES) $(test_pair_vmci_SOURCES) \ $(test_reqrep_vmci_SOURCES) $(tests_test_abstract_ipc_SOURCES) \ $(tests_test_address_tipc_SOURCES) \ $(tests_test_ancillaries_SOURCES) \ $(tests_test_app_meta_SOURCES) $(tests_test_atomics_SOURCES) \ $(tests_test_base85_SOURCES) \ $(tests_test_bind_after_connect_tcp_SOURCES) \ $(tests_test_bind_src_address_SOURCES) \ $(tests_test_capabilities_SOURCES) \ $(tests_test_client_server_SOURCES) \ $(tests_test_conflate_SOURCES) \ $(tests_test_connect_delay_tipc_SOURCES) \ $(tests_test_connect_resolve_SOURCES) \ $(tests_test_connect_rid_SOURCES) \ $(tests_test_ctx_destroy_SOURCES) \ $(tests_test_ctx_options_SOURCES) $(tests_test_dgram_SOURCES) \ $(tests_test_diffserv_SOURCES) \ $(tests_test_disconnect_inproc_SOURCES) \ $(tests_test_filter_ipc_SOURCES) $(tests_test_fork_SOURCES) \ $(tests_test_getsockopt_memset_SOURCES) \ $(tests_test_heartbeats_SOURCES) $(tests_test_hwm_SOURCES) \ $(tests_test_hwm_pubsub_SOURCES) \ $(tests_test_immediate_SOURCES) \ $(tests_test_inproc_connect_SOURCES) \ $(tests_test_invalid_rep_SOURCES) $(tests_test_iov_SOURCES) \ $(tests_test_ipc_wildcard_SOURCES) \ $(tests_test_issue_566_SOURCES) \ $(tests_test_last_endpoint_SOURCES) \ $(tests_test_many_sockets_SOURCES) \ $(tests_test_metadata_SOURCES) $(tests_test_monitor_SOURCES) \ $(tests_test_msg_ffn_SOURCES) $(tests_test_msg_flags_SOURCES) \ $(tests_test_pair_inproc_SOURCES) \ $(tests_test_pair_ipc_SOURCES) $(tests_test_pair_tcp_SOURCES) \ $(tests_test_pair_tipc_SOURCES) $(tests_test_poller_SOURCES) \ $(tests_test_probe_router_SOURCES) $(tests_test_proxy_SOURCES) \ $(tests_test_proxy_single_socket_SOURCES) \ $(tests_test_proxy_terminate_SOURCES) \ $(tests_test_pub_invert_matching_SOURCES) \ $(tests_test_radio_dish_SOURCES) \ $(tests_test_rebind_ipc_SOURCES) \ $(tests_test_reconnect_ivl_SOURCES) \ $(tests_test_req_correlate_SOURCES) \ $(tests_test_req_relaxed_SOURCES) \ $(tests_test_reqrep_device_SOURCES) \ $(tests_test_reqrep_device_tipc_SOURCES) \ $(tests_test_reqrep_inproc_SOURCES) \ $(tests_test_reqrep_ipc_SOURCES) \ $(tests_test_reqrep_tcp_SOURCES) \ $(tests_test_reqrep_tipc_SOURCES) \ $(tests_test_router_handover_SOURCES) \ $(tests_test_router_mandatory_SOURCES) \ $(tests_test_router_mandatory_hwm_SOURCES) \ $(tests_test_router_mandatory_tipc_SOURCES) \ $(tests_test_scatter_gather_SOURCES) \ $(tests_test_security_curve_SOURCES) \ $(tests_test_security_gssapi_SOURCES) \ $(tests_test_security_null_SOURCES) \ $(tests_test_security_plain_SOURCES) \ $(tests_test_security_zap_SOURCES) \ $(tests_test_setsockopt_SOURCES) \ $(tests_test_shutdown_stress_SOURCES) \ $(tests_test_shutdown_stress_tipc_SOURCES) \ $(tests_test_socket_null_SOURCES) \ $(tests_test_sockopt_hwm_SOURCES) $(tests_test_sodium_SOURCES) \ $(tests_test_spec_dealer_SOURCES) \ $(tests_test_spec_pushpull_SOURCES) \ $(tests_test_spec_rep_SOURCES) $(tests_test_spec_req_SOURCES) \ $(tests_test_spec_router_SOURCES) $(tests_test_srcfd_SOURCES) \ $(tests_test_stream_SOURCES) \ $(tests_test_stream_disconnect_SOURCES) \ $(tests_test_stream_empty_SOURCES) \ $(tests_test_stream_exceeds_buffer_SOURCES) \ $(tests_test_stream_timeout_SOURCES) \ $(tests_test_sub_forward_SOURCES) \ $(tests_test_sub_forward_tipc_SOURCES) \ $(tests_test_system_SOURCES) \ $(tests_test_term_endpoint_SOURCES) \ $(tests_test_term_endpoint_tipc_SOURCES) \ $(tests_test_thread_safe_SOURCES) $(tests_test_timeo_SOURCES) \ $(tests_test_timers_SOURCES) \ $(tests_test_unbind_inproc_SOURCES) \ $(tests_test_unbind_wildcard_SOURCES) \ $(tests_test_use_fd_ipc_SOURCES) \ $(tests_test_use_fd_tcp_SOURCES) \ $(tests_test_xpub_manual_SOURCES) \ $(tests_test_xpub_nodrop_SOURCES) \ $(tests_test_xpub_verbose_SOURCES) \ $(tests_test_xpub_welcome_msg_SOURCES) \ $(tests_test_zmq_poll_fd_SOURCES) \ $(tools_curve_keygen_SOURCES) \ $(unittests_unittest_mtrie_SOURCES) \ $(unittests_unittest_poller_SOURCES) \ $(unittests_unittest_ypipe_SOURCES) DIST_SOURCES = $(external_unity_libunity_a_SOURCES) \ $(am__src_libzmq_la_SOURCES_DIST) \ $(am__perf_inproc_lat_SOURCES_DIST) \ $(am__perf_inproc_thr_SOURCES_DIST) \ $(am__perf_local_lat_SOURCES_DIST) \ $(am__perf_local_thr_SOURCES_DIST) \ $(am__perf_remote_lat_SOURCES_DIST) \ $(am__perf_remote_thr_SOURCES_DIST) \ $(am__test_pair_vmci_SOURCES_DIST) \ $(am__test_reqrep_vmci_SOURCES_DIST) \ $(am__tests_test_abstract_ipc_SOURCES_DIST) \ $(am__tests_test_address_tipc_SOURCES_DIST) \ $(tests_test_ancillaries_SOURCES) \ $(am__tests_test_app_meta_SOURCES_DIST) \ $(tests_test_atomics_SOURCES) $(tests_test_base85_SOURCES) \ $(tests_test_bind_after_connect_tcp_SOURCES) \ $(tests_test_bind_src_address_SOURCES) \ $(tests_test_capabilities_SOURCES) \ $(am__tests_test_client_server_SOURCES_DIST) \ $(tests_test_conflate_SOURCES) \ $(am__tests_test_connect_delay_tipc_SOURCES_DIST) \ $(tests_test_connect_resolve_SOURCES) \ $(tests_test_connect_rid_SOURCES) \ $(tests_test_ctx_destroy_SOURCES) \ $(tests_test_ctx_options_SOURCES) \ $(am__tests_test_dgram_SOURCES_DIST) \ $(tests_test_diffserv_SOURCES) \ $(tests_test_disconnect_inproc_SOURCES) \ $(am__tests_test_filter_ipc_SOURCES_DIST) \ $(am__tests_test_fork_SOURCES_DIST) \ $(tests_test_getsockopt_memset_SOURCES) \ $(tests_test_heartbeats_SOURCES) $(tests_test_hwm_SOURCES) \ $(tests_test_hwm_pubsub_SOURCES) \ $(tests_test_immediate_SOURCES) \ $(tests_test_inproc_connect_SOURCES) \ $(tests_test_invalid_rep_SOURCES) $(tests_test_iov_SOURCES) \ $(am__tests_test_ipc_wildcard_SOURCES_DIST) \ $(tests_test_issue_566_SOURCES) \ $(tests_test_last_endpoint_SOURCES) \ $(tests_test_many_sockets_SOURCES) \ $(tests_test_metadata_SOURCES) $(tests_test_monitor_SOURCES) \ $(tests_test_msg_ffn_SOURCES) $(tests_test_msg_flags_SOURCES) \ $(tests_test_pair_inproc_SOURCES) \ $(am__tests_test_pair_ipc_SOURCES_DIST) \ $(tests_test_pair_tcp_SOURCES) \ $(am__tests_test_pair_tipc_SOURCES_DIST) \ $(am__tests_test_poller_SOURCES_DIST) \ $(tests_test_probe_router_SOURCES) $(tests_test_proxy_SOURCES) \ $(tests_test_proxy_single_socket_SOURCES) \ $(tests_test_proxy_terminate_SOURCES) \ $(tests_test_pub_invert_matching_SOURCES) \ $(am__tests_test_radio_dish_SOURCES_DIST) \ $(am__tests_test_rebind_ipc_SOURCES_DIST) \ $(tests_test_reconnect_ivl_SOURCES) \ $(tests_test_req_correlate_SOURCES) \ $(tests_test_req_relaxed_SOURCES) \ $(tests_test_reqrep_device_SOURCES) \ $(am__tests_test_reqrep_device_tipc_SOURCES_DIST) \ $(tests_test_reqrep_inproc_SOURCES) \ $(am__tests_test_reqrep_ipc_SOURCES_DIST) \ $(tests_test_reqrep_tcp_SOURCES) \ $(am__tests_test_reqrep_tipc_SOURCES_DIST) \ $(tests_test_router_handover_SOURCES) \ $(tests_test_router_mandatory_SOURCES) \ $(tests_test_router_mandatory_hwm_SOURCES) \ $(am__tests_test_router_mandatory_tipc_SOURCES_DIST) \ $(am__tests_test_scatter_gather_SOURCES_DIST) \ $(am__tests_test_security_curve_SOURCES_DIST) \ $(am__tests_test_security_gssapi_SOURCES_DIST) \ $(tests_test_security_null_SOURCES) \ $(tests_test_security_plain_SOURCES) \ $(tests_test_security_zap_SOURCES) \ $(tests_test_setsockopt_SOURCES) \ $(am__tests_test_shutdown_stress_SOURCES_DIST) \ $(am__tests_test_shutdown_stress_tipc_SOURCES_DIST) \ $(tests_test_socket_null_SOURCES) \ $(tests_test_sockopt_hwm_SOURCES) $(tests_test_sodium_SOURCES) \ $(tests_test_spec_dealer_SOURCES) \ $(tests_test_spec_pushpull_SOURCES) \ $(tests_test_spec_rep_SOURCES) $(tests_test_spec_req_SOURCES) \ $(tests_test_spec_router_SOURCES) $(tests_test_srcfd_SOURCES) \ $(tests_test_stream_SOURCES) \ $(tests_test_stream_disconnect_SOURCES) \ $(tests_test_stream_empty_SOURCES) \ $(tests_test_stream_exceeds_buffer_SOURCES) \ $(tests_test_stream_timeout_SOURCES) \ $(tests_test_sub_forward_SOURCES) \ $(am__tests_test_sub_forward_tipc_SOURCES_DIST) \ $(tests_test_system_SOURCES) \ $(tests_test_term_endpoint_SOURCES) \ $(am__tests_test_term_endpoint_tipc_SOURCES_DIST) \ $(am__tests_test_thread_safe_SOURCES_DIST) \ $(am__tests_test_timeo_SOURCES_DIST) \ $(am__tests_test_timers_SOURCES_DIST) \ $(tests_test_unbind_inproc_SOURCES) \ $(tests_test_unbind_wildcard_SOURCES) \ $(am__tests_test_use_fd_ipc_SOURCES_DIST) \ $(am__tests_test_use_fd_tcp_SOURCES_DIST) \ $(tests_test_xpub_manual_SOURCES) \ $(tests_test_xpub_nodrop_SOURCES) \ $(tests_test_xpub_verbose_SOURCES) \ $(tests_test_xpub_welcome_msg_SOURCES) \ $(am__tests_test_zmq_poll_fd_SOURCES_DIST) \ $(am__tools_curve_keygen_SOURCES_DIST) \ $(am__unittests_unittest_mtrie_SOURCES_DIST) \ $(am__unittests_unittest_poller_SOURCES_DIST) \ $(am__unittests_unittest_ypipe_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) HEADERS = $(include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope check recheck distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) @ON_LINUX_FALSE@am__EXEEXT_11 = tests/test_abstract_ipc$(EXEEXT) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).zip GZIP_ENV = --best DIST_TARGETS = dist-gzip dist-zip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ ASCIIDOC = @ASCIIDOC@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLANG_FORMAT = @CLANG_FORMAT@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCOV = @GCOV@ GENHTML = @GENHTML@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ LIBZMQ_EXTRA_CFLAGS = @LIBZMQ_EXTRA_CFLAGS@ LIBZMQ_EXTRA_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ LIBZMQ_EXTRA_LDFLAGS = @LIBZMQ_EXTRA_LDFLAGS@ LIBZMQ_VMCI_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ LIBZMQ_VMCI_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LTVER = @LTVER@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ VALGRIND_HAVE_TOOL_drd = @VALGRIND_HAVE_TOOL_drd@ VALGRIND_HAVE_TOOL_exp_sgcheck = @VALGRIND_HAVE_TOOL_exp_sgcheck@ VALGRIND_HAVE_TOOL_helgrind = @VALGRIND_HAVE_TOOL_helgrind@ VALGRIND_HAVE_TOOL_memcheck = @VALGRIND_HAVE_TOOL_memcheck@ VERSION = @VERSION@ WITH_CLANG_FORMAT = @WITH_CLANG_FORMAT@ XMLTO = @XMLTO@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ gssapi_krb5_CFLAGS = @gssapi_krb5_CFLAGS@ gssapi_krb5_LIBS = @gssapi_krb5_LIBS@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ libzmq_have_asciidoc = @libzmq_have_asciidoc@ libzmq_have_xmlto = @libzmq_have_xmlto@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ norm_CFLAGS = @norm_CFLAGS@ norm_LIBS = @norm_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pgm_CFLAGS = @pgm_CFLAGS@ pgm_LIBS = @pgm_LIBS@ pkg_config_defines = @pkg_config_defines@ pkg_config_libs_private = @pkg_config_libs_private@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sodium_CFLAGS = @sodium_CFLAGS@ sodium_LIBS = @sodium_LIBS@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I config SUBDIRS = doc DIST_SUBDIRS = doc builds builds/msvc pkgconfig_DATA = src/libzmq.pc AM_CPPFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include # # libraries/binaries # lib_LTLIBRARIES = src/libzmq.la include_HEADERS = \ include/zmq.h \ include/zmq_utils.h src_libzmq_la_SOURCES = src/address.cpp src/address.hpp src/array.hpp \ src/atomic_counter.hpp src/atomic_ptr.hpp src/blob.hpp \ src/client.cpp src/client.hpp src/clock.cpp src/clock.hpp \ src/command.hpp src/condition_variable.hpp src/config.hpp \ src/ctx.cpp src/ctx.hpp src/curve_client.cpp \ src/curve_client.hpp src/curve_client_tools.hpp \ src/curve_mechanism_base.cpp src/curve_mechanism_base.hpp \ src/curve_server.cpp src/curve_server.hpp src/dbuffer.hpp \ src/dealer.cpp src/dealer.hpp src/decoder.hpp src/devpoll.cpp \ src/devpoll.hpp src/dgram.cpp src/dgram.hpp src/dish.cpp \ src/dish.hpp src/dist.cpp src/dist.hpp src/encoder.hpp \ src/epoll.cpp src/epoll.hpp src/err.cpp src/err.hpp src/fd.hpp \ src/fq.cpp src/fq.hpp src/gather.cpp src/gather.hpp \ src/generic_mtrie.hpp src/generic_mtrie_impl.hpp \ src/gssapi_mechanism_base.cpp src/gssapi_mechanism_base.hpp \ src/gssapi_client.cpp src/gssapi_client.hpp \ src/gssapi_server.cpp src/gssapi_server.hpp src/i_encoder.hpp \ src/i_engine.hpp src/i_decoder.hpp src/i_mailbox.hpp \ src/i_poll_events.hpp src/io_object.cpp src/io_object.hpp \ src/io_thread.cpp src/io_thread.hpp src/ip.cpp src/ip.hpp \ src/ipc_address.cpp src/ipc_address.hpp src/ipc_connecter.cpp \ src/ipc_connecter.hpp src/ipc_listener.cpp \ src/ipc_listener.hpp src/kqueue.cpp src/kqueue.hpp src/lb.cpp \ src/lb.hpp src/likely.hpp src/macros.hpp src/mailbox.cpp \ src/mailbox.hpp src/mailbox_safe.cpp src/mailbox_safe.hpp \ src/mechanism.cpp src/mechanism.hpp src/mechanism_base.cpp \ src/mechanism_base.hpp src/metadata.cpp src/metadata.hpp \ src/msg.cpp src/msg.hpp src/mtrie.cpp src/mtrie.hpp \ src/mutex.hpp src/norm_engine.cpp src/norm_engine.hpp \ src/null_mechanism.cpp src/null_mechanism.hpp src/object.cpp \ src/object.hpp src/options.cpp src/options.hpp src/own.cpp \ src/own.hpp src/pair.cpp src/pair.hpp src/pgm_receiver.cpp \ src/pgm_receiver.hpp src/pgm_sender.cpp src/pgm_sender.hpp \ src/pgm_socket.cpp src/pgm_socket.hpp src/pipe.cpp \ src/pipe.hpp src/plain_client.cpp src/plain_client.hpp \ src/plain_server.cpp src/plain_server.hpp src/platform.hpp \ src/poll.cpp src/poll.hpp src/poller.hpp src/poller_base.cpp \ src/poller_base.hpp src/pollset.cpp src/pollset.hpp \ src/precompiled.cpp src/precompiled.hpp src/proxy.cpp \ src/proxy.hpp src/pub.cpp src/pub.hpp src/pull.cpp \ src/pull.hpp src/push.cpp src/push.hpp src/radio.cpp \ src/radio.hpp src/random.cpp src/random.hpp \ src/raw_decoder.cpp src/raw_decoder.hpp src/raw_encoder.cpp \ src/raw_encoder.hpp src/reaper.cpp src/reaper.hpp src/rep.cpp \ src/rep.hpp src/req.cpp src/req.hpp src/router.cpp \ src/router.hpp src/scatter.cpp src/scatter.hpp src/select.cpp \ src/select.hpp src/server.cpp src/server.hpp \ src/session_base.cpp src/session_base.hpp src/signaler.cpp \ src/signaler.hpp src/socket_base.cpp src/socket_base.hpp \ src/socks.cpp src/socks.hpp src/socks_connecter.cpp \ src/socks_connecter.hpp src/stdint.hpp src/stream.cpp \ src/stream.hpp src/stream_engine.cpp src/stream_engine.hpp \ src/sub.cpp src/sub.hpp src/tcp.cpp src/tcp.hpp \ src/tcp_address.cpp src/tcp_address.hpp src/tcp_connecter.cpp \ src/tcp_connecter.hpp src/tcp_listener.cpp \ src/tcp_listener.hpp src/thread.cpp src/thread.hpp \ src/timers.cpp src/timers.hpp src/tipc_address.cpp \ src/tipc_address.hpp src/tipc_connecter.cpp \ src/tipc_connecter.hpp src/tipc_listener.cpp \ src/tipc_listener.hpp src/trie.cpp src/trie.hpp \ src/udp_address.cpp src/udp_address.hpp src/udp_engine.cpp \ src/udp_engine.hpp src/v1_decoder.cpp src/v1_decoder.hpp \ src/v2_decoder.cpp src/v2_decoder.hpp src/v1_encoder.cpp \ src/v1_encoder.hpp src/v2_encoder.cpp src/v2_encoder.hpp \ src/v2_protocol.hpp src/vmci.cpp src/vmci.hpp \ src/vmci_address.cpp src/vmci_address.hpp \ src/vmci_connecter.cpp src/vmci_connecter.hpp \ src/vmci_listener.cpp src/vmci_listener.hpp src/windows.hpp \ src/wire.hpp src/xpub.cpp src/xpub.hpp src/xsub.cpp \ src/xsub.hpp src/ypipe.hpp src/ypipe_base.hpp \ src/ypipe_conflate.hpp src/yqueue.hpp src/zmq.cpp \ src/zmq_utils.cpp src/decoder_allocators.cpp \ src/decoder_allocators.hpp src/socket_poller.cpp \ src/socket_poller.hpp src/zap_client.cpp src/zap_client.hpp \ src/zmq_draft.h $(am__append_1) @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_FALSE@@ON_MINGW_FALSE@src_libzmq_la_LDFLAGS = \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_FALSE@@ON_MINGW_FALSE@ -version-info @LTVER@ \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_FALSE@@ON_MINGW_FALSE@ @LIBZMQ_EXTRA_LDFLAGS@ \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_FALSE@@ON_MINGW_FALSE@ -Wl @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_TRUE@@ON_MINGW_FALSE@src_libzmq_la_LDFLAGS = \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_TRUE@@ON_MINGW_FALSE@ -version-info @LTVER@ \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_TRUE@@ON_MINGW_FALSE@ @LIBZMQ_EXTRA_LDFLAGS@ \ @ON_ANDROID_FALSE@@ON_CYGWIN_FALSE@@ON_LINUX_TRUE@@ON_MINGW_FALSE@ -Wl,--version-script=$(srcdir)/src/libzmq.vers @ON_ANDROID_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@src_libzmq_la_LDFLAGS = \ @ON_ANDROID_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ -avoid-version \ @ON_ANDROID_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ -version-info @LTVER@ \ @ON_ANDROID_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ @LIBZMQ_EXTRA_LDFLAGS@ @ON_CYGWIN_TRUE@@ON_MINGW_FALSE@src_libzmq_la_LDFLAGS = \ @ON_CYGWIN_TRUE@@ON_MINGW_FALSE@ -no-undefined \ @ON_CYGWIN_TRUE@@ON_MINGW_FALSE@ -avoid-version \ @ON_CYGWIN_TRUE@@ON_MINGW_FALSE@ -version-info @LTVER@ \ @ON_CYGWIN_TRUE@@ON_MINGW_FALSE@ @LIBZMQ_EXTRA_LDFLAGS@ @ON_MINGW_TRUE@src_libzmq_la_LDFLAGS = \ @ON_MINGW_TRUE@ -no-undefined \ @ON_MINGW_TRUE@ -avoid-version \ @ON_MINGW_TRUE@ -version-info @LTVER@ \ @ON_MINGW_TRUE@ @LIBZMQ_EXTRA_LDFLAGS@ src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) \ $(am__append_2) $(am__append_4) $(am__append_6) \ $(am__append_8) src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \ $(LIBUNWIND_CFLAGS) src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS) \ $(am__append_3) $(am__append_5) $(am__append_7) \ $(am__append_9) @ENABLE_PERF_TRUE@perf_local_lat_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_local_lat_SOURCES = perf/local_lat.cpp @ENABLE_PERF_TRUE@perf_remote_lat_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_remote_lat_SOURCES = perf/remote_lat.cpp @ENABLE_PERF_TRUE@perf_local_thr_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_local_thr_SOURCES = perf/local_thr.cpp @ENABLE_PERF_TRUE@perf_remote_thr_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_remote_thr_SOURCES = perf/remote_thr.cpp @ENABLE_PERF_TRUE@perf_inproc_lat_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_inproc_lat_SOURCES = perf/inproc_lat.cpp @ENABLE_PERF_TRUE@perf_inproc_thr_LDADD = src/libzmq.la @ENABLE_PERF_TRUE@perf_inproc_thr_SOURCES = perf/inproc_thr.cpp @ENABLE_CURVE_KEYGEN_TRUE@tools_curve_keygen_LDADD = src/libzmq.la @ENABLE_CURVE_KEYGEN_TRUE@tools_curve_keygen_SOURCES = tools/curve_keygen.cpp # # tests # test_apps = tests/test_ancillaries tests/test_system \ tests/test_pair_inproc tests/test_pair_tcp \ tests/test_reqrep_inproc tests/test_reqrep_tcp tests/test_hwm \ tests/test_hwm_pubsub tests/test_reqrep_device \ tests/test_sub_forward tests/test_invalid_rep \ tests/test_msg_flags tests/test_msg_ffn \ tests/test_connect_resolve tests/test_immediate \ tests/test_last_endpoint tests/test_term_endpoint \ tests/test_srcfd tests/test_monitor \ tests/test_router_mandatory tests/test_router_mandatory_hwm \ tests/test_router_handover tests/test_probe_router \ tests/test_stream tests/test_stream_empty \ tests/test_stream_disconnect tests/test_stream_timeout \ tests/test_disconnect_inproc tests/test_unbind_inproc \ tests/test_unbind_wildcard tests/test_ctx_options \ tests/test_ctx_destroy tests/test_security_null \ tests/test_security_plain tests/test_security_zap \ tests/test_iov tests/test_spec_req tests/test_spec_rep \ tests/test_spec_dealer tests/test_spec_router \ tests/test_spec_pushpull tests/test_req_correlate \ tests/test_req_relaxed tests/test_conflate \ tests/test_inproc_connect tests/test_issue_566 \ tests/test_proxy tests/test_proxy_single_socket \ tests/test_proxy_terminate tests/test_getsockopt_memset \ tests/test_setsockopt tests/test_diffserv \ tests/test_connect_rid tests/test_bind_src_address \ tests/test_metadata tests/test_capabilities \ tests/test_xpub_nodrop tests/test_xpub_manual \ tests/test_xpub_welcome_msg tests/test_xpub_verbose \ tests/test_atomics tests/test_sockopt_hwm \ tests/test_heartbeats tests/test_stream_exceeds_buffer \ tests/test_pub_invert_matching tests/test_base85 \ tests/test_bind_after_connect_tcp tests/test_sodium \ tests/test_reconnect_ivl tests/test_socket_null \ $(am__append_10) $(am__append_14) $(am__append_15) \ $(am__append_16) $(am__append_17) $(am__append_18) \ $(am__append_19) $(am__append_20) $(am__append_21) UNITY_CPPFLAGS = -I$(top_srcdir)/external/unity -DUNITY_USE_COMMAND_LINE_ARGS -DUNITY_EXCLUDE_FLOAT UNITY_LIBS = $(top_builddir)/external/unity/libunity.a noinst_LIBRARIES = external/unity/libunity.a external_unity_libunity_a_SOURCES = external/unity/unity.c \ external/unity/unity.h \ external/unity/unity_internals.h tests_test_ancillaries_SOURCES = tests/test_ancillaries.cpp tests_test_ancillaries_LDADD = src/libzmq.la tests_test_system_SOURCES = tests/test_system.cpp tests_test_system_LDADD = src/libzmq.la tests_test_pair_inproc_SOURCES = \ tests/test_pair_inproc.cpp \ tests/testutil.hpp tests_test_pair_inproc_LDADD = src/libzmq.la tests_test_pair_tcp_SOURCES = \ tests/test_pair_tcp.cpp \ tests/testutil.hpp tests_test_pair_tcp_LDADD = src/libzmq.la tests_test_reqrep_inproc_SOURCES = \ tests/test_reqrep_inproc.cpp \ tests/testutil.hpp tests_test_reqrep_inproc_LDADD = src/libzmq.la tests_test_reqrep_tcp_SOURCES = \ tests/test_reqrep_tcp.cpp \ tests/testutil.hpp tests_test_reqrep_tcp_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_reqrep_tcp_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_hwm_SOURCES = tests/test_hwm.cpp tests/testutil_unity.hpp tests_test_hwm_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_hwm_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_hwm_pubsub_SOURCES = tests/test_hwm_pubsub.cpp tests_test_hwm_pubsub_LDADD = src/libzmq.la tests_test_reqrep_device_SOURCES = tests/test_reqrep_device.cpp tests_test_reqrep_device_LDADD = src/libzmq.la tests_test_sub_forward_SOURCES = tests/test_sub_forward.cpp tests_test_sub_forward_LDADD = src/libzmq.la tests_test_invalid_rep_SOURCES = tests/test_invalid_rep.cpp tests_test_invalid_rep_LDADD = src/libzmq.la tests_test_msg_flags_SOURCES = tests/test_msg_flags.cpp tests_test_msg_flags_LDADD = src/libzmq.la tests_test_msg_ffn_SOURCES = tests/test_msg_ffn.cpp tests_test_msg_ffn_LDADD = src/libzmq.la tests_test_connect_resolve_SOURCES = tests/test_connect_resolve.cpp tests_test_connect_resolve_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_connect_resolve_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_immediate_SOURCES = tests/test_immediate.cpp tests_test_immediate_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_immediate_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_last_endpoint_SOURCES = tests/test_last_endpoint.cpp tests_test_last_endpoint_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_last_endpoint_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_term_endpoint_SOURCES = tests/test_term_endpoint.cpp tests_test_term_endpoint_LDADD = src/libzmq.la tests_test_srcfd_SOURCES = tests/test_srcfd.cpp tests_test_srcfd_LDADD = src/libzmq.la tests_test_monitor_SOURCES = tests/test_monitor.cpp tests_test_monitor_LDADD = src/libzmq.la tests_test_router_mandatory_SOURCES = tests/test_router_mandatory.cpp tests/testutil_unity.hpp tests_test_router_mandatory_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_router_mandatory_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_router_mandatory_hwm_SOURCES = tests/test_router_mandatory_hwm.cpp tests_test_router_mandatory_hwm_LDADD = src/libzmq.la tests_test_router_handover_SOURCES = tests/test_router_handover.cpp tests_test_router_handover_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_router_handover_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_probe_router_SOURCES = tests/test_probe_router.cpp tests_test_probe_router_LDADD = src/libzmq.la tests_test_stream_SOURCES = tests/test_stream.cpp tests_test_stream_LDADD = src/libzmq.la tests_test_stream_empty_SOURCES = tests/test_stream_empty.cpp tests_test_stream_empty_LDADD = src/libzmq.la tests_test_stream_timeout_SOURCES = tests/test_stream_timeout.cpp tests_test_stream_timeout_LDADD = src/libzmq.la tests_test_stream_disconnect_SOURCES = tests/test_stream_disconnect.cpp tests_test_stream_disconnect_LDADD = src/libzmq.la tests_test_disconnect_inproc_SOURCES = tests/test_disconnect_inproc.cpp tests_test_disconnect_inproc_LDADD = src/libzmq.la tests_test_unbind_inproc_SOURCES = tests/test_unbind_inproc.cpp tests_test_unbind_inproc_LDADD = src/libzmq.la tests_test_unbind_wildcard_SOURCES = tests/test_unbind_wildcard.cpp tests_test_unbind_wildcard_LDADD = src/libzmq.la tests_test_ctx_options_SOURCES = tests/test_ctx_options.cpp tests_test_ctx_options_LDADD = src/libzmq.la tests_test_iov_SOURCES = tests/test_iov.cpp tests_test_iov_LDADD = src/libzmq.la tests_test_ctx_destroy_SOURCES = tests/test_ctx_destroy.cpp tests_test_ctx_destroy_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_ctx_destroy_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_security_null_SOURCES = tests/test_security_null.cpp tests_test_security_null_LDADD = src/libzmq.la tests_test_security_plain_SOURCES = tests/test_security_plain.cpp tests_test_security_plain_LDADD = src/libzmq.la tests_test_security_zap_SOURCES = \ tests/test_security_zap.cpp \ tests/testutil_security.hpp \ tests/testutil.hpp tests_test_security_zap_LDADD = src/libzmq.la tests_test_spec_req_SOURCES = tests/test_spec_req.cpp tests_test_spec_req_LDADD = src/libzmq.la tests_test_spec_rep_SOURCES = tests/test_spec_rep.cpp tests_test_spec_rep_LDADD = src/libzmq.la tests_test_spec_dealer_SOURCES = tests/test_spec_dealer.cpp tests_test_spec_dealer_LDADD = src/libzmq.la tests_test_spec_router_SOURCES = tests/test_spec_router.cpp tests_test_spec_router_LDADD = src/libzmq.la tests_test_spec_pushpull_SOURCES = tests/test_spec_pushpull.cpp tests_test_spec_pushpull_LDADD = src/libzmq.la tests_test_req_correlate_SOURCES = tests/test_req_correlate.cpp tests_test_req_correlate_LDADD = src/libzmq.la tests_test_req_relaxed_SOURCES = tests/test_req_relaxed.cpp tests_test_req_relaxed_LDADD = src/libzmq.la tests_test_conflate_SOURCES = tests/test_conflate.cpp tests_test_conflate_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_conflate_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_inproc_connect_SOURCES = tests/test_inproc_connect.cpp tests_test_inproc_connect_LDADD = src/libzmq.la tests_test_issue_566_SOURCES = tests/test_issue_566.cpp tests_test_issue_566_LDADD = src/libzmq.la tests_test_proxy_SOURCES = tests/test_proxy.cpp tests_test_proxy_LDADD = src/libzmq.la tests_test_proxy_single_socket_SOURCES = tests/test_proxy_single_socket.cpp tests_test_proxy_single_socket_LDADD = src/libzmq.la tests_test_proxy_terminate_SOURCES = tests/test_proxy_terminate.cpp tests_test_proxy_terminate_LDADD = src/libzmq.la tests_test_getsockopt_memset_SOURCES = tests/test_getsockopt_memset.cpp tests_test_getsockopt_memset_LDADD = src/libzmq.la tests_test_many_sockets_SOURCES = tests/test_many_sockets.cpp tests_test_many_sockets_LDADD = src/libzmq.la tests_test_diffserv_SOURCES = tests/test_diffserv.cpp tests_test_diffserv_LDADD = src/libzmq.la tests_test_connect_rid_SOURCES = tests/test_connect_rid.cpp tests_test_connect_rid_LDADD = src/libzmq.la tests_test_bind_src_address_SOURCES = tests/test_bind_src_address.cpp tests_test_bind_src_address_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_bind_src_address_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_metadata_SOURCES = tests/test_metadata.cpp tests_test_metadata_LDADD = src/libzmq.la tests_test_capabilities_SOURCES = tests/test_capabilities.cpp tests_test_capabilities_LDADD = src/libzmq.la tests_test_xpub_nodrop_SOURCES = tests/test_xpub_nodrop.cpp tests_test_xpub_nodrop_LDADD = src/libzmq.la tests_test_xpub_manual_SOURCES = tests/test_xpub_manual.cpp tests_test_xpub_manual_LDADD = src/libzmq.la tests_test_xpub_welcome_msg_SOURCES = tests/test_xpub_welcome_msg.cpp tests_test_xpub_welcome_msg_LDADD = src/libzmq.la tests_test_xpub_verbose_SOURCES = tests/test_xpub_verbose.cpp tests_test_xpub_verbose_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_xpub_verbose_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_atomics_SOURCES = tests/test_atomics.cpp tests_test_atomics_LDADD = src/libzmq.la tests_test_sockopt_hwm_SOURCES = tests/test_sockopt_hwm.cpp tests_test_sockopt_hwm_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_sockopt_hwm_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_setsockopt_SOURCES = tests/test_setsockopt.cpp tests_test_setsockopt_LDADD = src/libzmq.la tests_test_heartbeats_SOURCES = tests/test_heartbeats.cpp tests_test_heartbeats_LDADD = src/libzmq.la tests_test_stream_exceeds_buffer_SOURCES = tests/test_stream_exceeds_buffer.cpp tests_test_stream_exceeds_buffer_LDADD = src/libzmq.la tests_test_pub_invert_matching_SOURCES = tests/test_pub_invert_matching.cpp tests_test_pub_invert_matching_LDADD = src/libzmq.la tests_test_bind_after_connect_tcp_SOURCES = tests/test_bind_after_connect_tcp.cpp tests_test_bind_after_connect_tcp_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_bind_after_connect_tcp_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_base85_SOURCES = tests/test_base85.cpp tests_test_base85_LDADD = src/libzmq.la tests_test_sodium_SOURCES = tests/test_sodium.cpp tests_test_sodium_LDADD = src/libzmq.la tests_test_socket_null_SOURCES = tests/test_socket_null.cpp tests_test_socket_null_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_socket_null_CPPFLAGS = ${UNITY_CPPFLAGS} tests_test_reconnect_ivl_SOURCES = tests/test_reconnect_ivl.cpp tests_test_reconnect_ivl_LDADD = src/libzmq.la ${UNITY_LIBS} tests_test_reconnect_ivl_CPPFLAGS = ${UNITY_CPPFLAGS} @HAVE_CURVE_TRUE@tests_test_security_curve_SOURCES = \ @HAVE_CURVE_TRUE@ tests/test_security_curve.cpp \ @HAVE_CURVE_TRUE@ tests/testutil_security.hpp \ @HAVE_CURVE_TRUE@ tests/testutil.hpp src/curve_client_tools.hpp \ @HAVE_CURVE_TRUE@ src/clock.hpp src/clock.cpp src/random.hpp \ @HAVE_CURVE_TRUE@ src/random.cpp src/err.hpp src/err.cpp \ @HAVE_CURVE_TRUE@ $(am__append_11) @HAVE_CURVE_TRUE@tests_test_security_curve_LDADD = src/libzmq.la \ @HAVE_CURVE_TRUE@ ${UNITY_LIBS} $(LIBUNWIND_LIBS) \ @HAVE_CURVE_TRUE@ $(am__append_13) @HAVE_CURVE_TRUE@tests_test_security_curve_CPPFLAGS = \ @HAVE_CURVE_TRUE@ ${UNITY_CPPFLAGS} ${LIBUNWIND_CFLAGS} \ @HAVE_CURVE_TRUE@ $(am__append_12) @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_shutdown_stress_SOURCES = tests/test_shutdown_stress.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_shutdown_stress_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_ipc_wildcard_SOURCES = tests/test_ipc_wildcard.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_ipc_wildcard_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_pair_ipc_SOURCES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_pair_ipc.cpp \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_pair_ipc_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_rebind_ipc_SOURCES = tests/test_rebind_ipc.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_rebind_ipc_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_reqrep_ipc_SOURCES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_reqrep_ipc.cpp \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_reqrep_ipc_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_timeo_SOURCES = tests/test_timeo.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_timeo_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_filter_ipc_SOURCES = tests/test_filter_ipc.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_filter_ipc_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_ipc_SOURCES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_ipc.cpp \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_ipc_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_tcp_SOURCES = \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/test_use_fd_tcp.cpp \ @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@ tests/testutil.hpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_use_fd_tcp_LDADD = src/libzmq.la @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_zmq_poll_fd_SOURCES = tests/test_zmq_poll_fd.cpp @ON_CYGWIN_FALSE@@ON_MINGW_FALSE@tests_test_zmq_poll_fd_LDADD = src/libzmq.la @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@tests_test_fork_SOURCES = tests/test_fork.cpp @HAVE_FORK_TRUE@@ON_CYGWIN_FALSE@@ON_MINGW_FALSE@@VALGRIND_ENABLED_FALSE@tests_test_fork_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_connect_delay_tipc_SOURCES = tests/test_connect_delay_tipc.cpp @BUILD_TIPC_TRUE@tests_test_connect_delay_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_pair_tipc_SOURCES = tests/test_pair_tipc.cpp @BUILD_TIPC_TRUE@tests_test_pair_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_reqrep_device_tipc_SOURCES = tests/test_reqrep_device_tipc.cpp @BUILD_TIPC_TRUE@tests_test_reqrep_device_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_reqrep_tipc_SOURCES = tests/test_reqrep_tipc.cpp @BUILD_TIPC_TRUE@tests_test_reqrep_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_router_mandatory_tipc_SOURCES = tests/test_router_mandatory_tipc.cpp @BUILD_TIPC_TRUE@tests_test_router_mandatory_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_shutdown_stress_tipc_SOURCES = tests/test_shutdown_stress_tipc.cpp @BUILD_TIPC_TRUE@tests_test_shutdown_stress_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_sub_forward_tipc_SOURCES = tests/test_sub_forward_tipc.cpp @BUILD_TIPC_TRUE@tests_test_sub_forward_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_term_endpoint_tipc_SOURCES = tests/test_term_endpoint_tipc.cpp @BUILD_TIPC_TRUE@tests_test_term_endpoint_tipc_LDADD = src/libzmq.la @BUILD_TIPC_TRUE@tests_test_address_tipc_SOURCES = tests/test_address_tipc.cpp @BUILD_TIPC_TRUE@tests_test_address_tipc_LDADD = src/libzmq.la ${UNITY_LIBS} @BUILD_TIPC_TRUE@tests_test_address_tipc_CPPFLAGS = ${UNITY_CPPFLAGS} @BUILD_GSSAPI_TRUE@tests_test_security_gssapi_SOURCES = tests/test_security_gssapi.cpp @BUILD_GSSAPI_TRUE@tests_test_security_gssapi_LDADD = src/libzmq.la @ON_LINUX_TRUE@tests_test_abstract_ipc_SOURCES = tests/test_abstract_ipc.cpp @ON_LINUX_TRUE@tests_test_abstract_ipc_LDADD = src/libzmq.la @HAVE_VMCI_TRUE@test_pair_vmci_SOURCES = tests/test_pair_vmci.cpp @HAVE_VMCI_TRUE@test_pair_vmci_LDADD = libzmq.la @HAVE_VMCI_TRUE@test_pair_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ @HAVE_VMCI_TRUE@test_pair_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ @HAVE_VMCI_TRUE@test_reqrep_vmci_SOURCES = tests/test_reqrep_vmci.cpp @HAVE_VMCI_TRUE@test_reqrep_vmci_LDADD = libzmq.la @HAVE_VMCI_TRUE@test_reqrep_vmci_LDFLAGS = @LIBZMQ_VMCI_LDFLAGS@ @HAVE_VMCI_TRUE@test_reqrep_vmci_CXXFLAGS = @LIBZMQ_VMCI_CXXFLAGS@ @ENABLE_DRAFTS_TRUE@tests_test_poller_SOURCES = tests/test_poller.cpp @ENABLE_DRAFTS_TRUE@tests_test_poller_LDADD = src/libzmq.la ${UNITY_LIBS} @ENABLE_DRAFTS_TRUE@tests_test_poller_CPPFLAGS = ${UNITY_CPPFLAGS} @ENABLE_DRAFTS_TRUE@tests_test_client_server_SOURCES = tests/test_client_server.cpp @ENABLE_DRAFTS_TRUE@tests_test_client_server_LDADD = src/libzmq.la ${UNITY_LIBS} @ENABLE_DRAFTS_TRUE@tests_test_client_server_CPPFLAGS = ${UNITY_CPPFLAGS} @ENABLE_DRAFTS_TRUE@tests_test_thread_safe_SOURCES = tests/test_thread_safe.cpp @ENABLE_DRAFTS_TRUE@tests_test_thread_safe_LDADD = src/libzmq.la ${UNITY_LIBS} @ENABLE_DRAFTS_TRUE@tests_test_thread_safe_CPPFLAGS = ${UNITY_CPPFLAGS} @ENABLE_DRAFTS_TRUE@tests_test_timers_SOURCES = tests/test_timers.cpp @ENABLE_DRAFTS_TRUE@tests_test_timers_LDADD = src/libzmq.la @ENABLE_DRAFTS_TRUE@tests_test_radio_dish_SOURCES = tests/test_radio_dish.cpp @ENABLE_DRAFTS_TRUE@tests_test_radio_dish_LDADD = src/libzmq.la ${UNITY_LIBS} @ENABLE_DRAFTS_TRUE@tests_test_radio_dish_CPPFLAGS = ${UNITY_CPPFLAGS} @ENABLE_DRAFTS_TRUE@tests_test_scatter_gather_SOURCES = tests/test_scatter_gather.cpp @ENABLE_DRAFTS_TRUE@tests_test_scatter_gather_LDADD = src/libzmq.la @ENABLE_DRAFTS_TRUE@tests_test_dgram_SOURCES = tests/test_dgram.cpp @ENABLE_DRAFTS_TRUE@tests_test_dgram_LDADD = src/libzmq.la @ENABLE_DRAFTS_TRUE@tests_test_app_meta_SOURCES = tests/test_app_meta.cpp @ENABLE_DRAFTS_TRUE@tests_test_app_meta_LDADD = src/libzmq.la ${UNITY_LIBS} @ENABLE_DRAFTS_TRUE@tests_test_app_meta_CPPFLAGS = ${UNITY_CPPFLAGS} @ENABLE_STATIC_TRUE@unittests_unittest_poller_SOURCES = unittests/unittest_poller.cpp @ENABLE_STATIC_TRUE@unittests_unittest_poller_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_poller_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_poller_LDADD = $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ ${src_libzmq_la_LIBADD} \ @ENABLE_STATIC_TRUE@ ${UNITY_LIBS} \ @ENABLE_STATIC_TRUE@ $(CODE_COVERAGE_LDFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_ypipe_SOURCES = unittests/unittest_ypipe.cpp @ENABLE_STATIC_TRUE@unittests_unittest_ypipe_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_ypipe_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_ypipe_LDADD = $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ ${src_libzmq_la_LIBADD} \ @ENABLE_STATIC_TRUE@ ${UNITY_LIBS} \ @ENABLE_STATIC_TRUE@ $(CODE_COVERAGE_LDFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_mtrie_SOURCES = unittests/unittest_mtrie.cpp @ENABLE_STATIC_TRUE@unittests_unittest_mtrie_CPPFLAGS = -I$(top_srcdir)/src ${UNITY_CPPFLAGS} $(CODE_COVERAGE_CPPFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_mtrie_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS) @ENABLE_STATIC_TRUE@unittests_unittest_mtrie_LDADD = $(top_builddir)/src/.libs/libzmq.a \ @ENABLE_STATIC_TRUE@ ${src_libzmq_la_LIBADD} \ @ENABLE_STATIC_TRUE@ ${UNITY_LIBS} \ @ENABLE_STATIC_TRUE@ $(CODE_COVERAGE_LDFLAGS) EXTRA_DIST = \ external/unity/license.txt \ external/unity/version.txt \ CMakeLists.txt \ autogen.sh \ version.sh \ src/libzmq.pc.cmake.in \ src/libzmq.vers \ src/version.rc.in \ tests/CMakeLists.txt \ unittests/CMakeLists.txt \ tools/curve_keygen.cpp MAINTAINERCLEANFILES = \ $(srcdir)/aclocal.m4 \ $(srcdir)/autom4te.cache \ $(srcdir)/configure \ `find "$(srcdir)" -type f -name Makefile.in -print` @WITH_CLANG_FORMAT_TRUE@ALL_SOURCE_FILES = $(wildcard \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/src/*.c \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/src/*.cc \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/src/*.cpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/src/*.h \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/src/*.hpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tests/*.c \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tests/*.cc \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tests/*.cpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tests/*.h \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tests/*.hpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/perf/*.c \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/perf/*.cc \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/perf/*.cpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/perf/*.h \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/perf/*.hpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tools/*.c \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tools/*.cc \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tools/*.cpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tools/*.h \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/tools/*.hpp \ @WITH_CLANG_FORMAT_TRUE@ $(top_srcdir)/include/*.h \ @WITH_CLANG_FORMAT_TRUE@ ) VALGRIND_SUPPRESSIONS_FILES = builds/valgrind/valgrind.supp all: all-recursive .SUFFIXES: .SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/platform.hpp: src/stamp-h1 @test -f $@ || rm -f src/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1 src/stamp-h1: $(top_srcdir)/src/platform.hpp.in $(top_builddir)/config.status @rm -f src/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/platform.hpp $(top_srcdir)/src/platform.hpp.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/stamp-h1 touch $@ distclean-hdr: -rm -f src/platform.hpp src/stamp-h1 src/libzmq.pc: $(top_builddir)/config.status $(top_srcdir)/src/libzmq.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) external/unity/$(am__dirstamp): @$(MKDIR_P) external/unity @: > external/unity/$(am__dirstamp) external/unity/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) external/unity/$(DEPDIR) @: > external/unity/$(DEPDIR)/$(am__dirstamp) external/unity/unity.$(OBJEXT): external/unity/$(am__dirstamp) \ external/unity/$(DEPDIR)/$(am__dirstamp) external/unity/libunity.a: $(external_unity_libunity_a_OBJECTS) $(external_unity_libunity_a_DEPENDENCIES) $(EXTRA_external_unity_libunity_a_DEPENDENCIES) external/unity/$(am__dirstamp) $(AM_V_at)-rm -f external/unity/libunity.a $(AM_V_AR)$(external_unity_libunity_a_AR) external/unity/libunity.a $(external_unity_libunity_a_OBJECTS) $(external_unity_libunity_a_LIBADD) $(AM_V_at)$(RANLIB) external/unity/libunity.a install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } src/$(am__dirstamp): @$(MKDIR_P) src @: > src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/$(DEPDIR) @: > src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-client.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-clock.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-ctx.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-curve_client.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-curve_mechanism_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-curve_server.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-dealer.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-devpoll.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-dgram.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-dish.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-dist.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-epoll.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-err.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-fq.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-gather.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-gssapi_mechanism_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-gssapi_client.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-gssapi_server.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-io_object.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-io_thread.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-ip.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-ipc_address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-ipc_connecter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-ipc_listener.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-kqueue.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-lb.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-mailbox.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-mailbox_safe.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-mechanism.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-mechanism_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-metadata.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-msg.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-mtrie.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-norm_engine.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-null_mechanism.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-object.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-options.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-own.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pair.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pgm_receiver.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pgm_sender.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pgm_socket.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pipe.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-plain_client.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-plain_server.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-poll.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-poller_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pollset.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-precompiled.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-proxy.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pub.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-pull.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-push.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-radio.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-random.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-raw_decoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-raw_encoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-reaper.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-rep.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-req.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-router.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-scatter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-select.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-server.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-session_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-signaler.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-socket_base.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-socks.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-socks_connecter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-stream.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-stream_engine.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-sub.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tcp.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tcp_address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tcp_connecter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tcp_listener.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-thread.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-timers.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tipc_address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tipc_connecter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tipc_listener.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-trie.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-udp_address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-udp_engine.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-v1_decoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-v2_decoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-v1_encoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-v2_encoder.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-vmci.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-vmci_address.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-vmci_connecter.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-vmci_listener.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-xpub.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-xsub.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-zmq.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-zmq_utils.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-decoder_allocators.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-socket_poller.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-zap_client.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/src_libzmq_la-tweetnacl.lo: src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/libzmq.la: $(src_libzmq_la_OBJECTS) $(src_libzmq_la_DEPENDENCIES) $(EXTRA_src_libzmq_la_DEPENDENCIES) src/$(am__dirstamp) $(AM_V_CXXLD)$(src_libzmq_la_LINK) -rpath $(libdir) $(src_libzmq_la_OBJECTS) $(src_libzmq_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list perf/$(am__dirstamp): @$(MKDIR_P) perf @: > perf/$(am__dirstamp) perf/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) perf/$(DEPDIR) @: > perf/$(DEPDIR)/$(am__dirstamp) perf/inproc_lat.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/inproc_lat$(EXEEXT): $(perf_inproc_lat_OBJECTS) $(perf_inproc_lat_DEPENDENCIES) $(EXTRA_perf_inproc_lat_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/inproc_lat$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_inproc_lat_OBJECTS) $(perf_inproc_lat_LDADD) $(LIBS) perf/inproc_thr.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/inproc_thr$(EXEEXT): $(perf_inproc_thr_OBJECTS) $(perf_inproc_thr_DEPENDENCIES) $(EXTRA_perf_inproc_thr_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/inproc_thr$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_inproc_thr_OBJECTS) $(perf_inproc_thr_LDADD) $(LIBS) perf/local_lat.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/local_lat$(EXEEXT): $(perf_local_lat_OBJECTS) $(perf_local_lat_DEPENDENCIES) $(EXTRA_perf_local_lat_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/local_lat$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_local_lat_OBJECTS) $(perf_local_lat_LDADD) $(LIBS) perf/local_thr.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/local_thr$(EXEEXT): $(perf_local_thr_OBJECTS) $(perf_local_thr_DEPENDENCIES) $(EXTRA_perf_local_thr_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/local_thr$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_local_thr_OBJECTS) $(perf_local_thr_LDADD) $(LIBS) perf/remote_lat.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/remote_lat$(EXEEXT): $(perf_remote_lat_OBJECTS) $(perf_remote_lat_DEPENDENCIES) $(EXTRA_perf_remote_lat_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/remote_lat$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_remote_lat_OBJECTS) $(perf_remote_lat_LDADD) $(LIBS) perf/remote_thr.$(OBJEXT): perf/$(am__dirstamp) \ perf/$(DEPDIR)/$(am__dirstamp) perf/remote_thr$(EXEEXT): $(perf_remote_thr_OBJECTS) $(perf_remote_thr_DEPENDENCIES) $(EXTRA_perf_remote_thr_DEPENDENCIES) perf/$(am__dirstamp) @rm -f perf/remote_thr$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(perf_remote_thr_OBJECTS) $(perf_remote_thr_LDADD) $(LIBS) tests/$(am__dirstamp): @$(MKDIR_P) tests @: > tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tests/$(DEPDIR) @: > tests/$(DEPDIR)/$(am__dirstamp) tests/test_pair_vmci-test_pair_vmci.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) test_pair_vmci$(EXEEXT): $(test_pair_vmci_OBJECTS) $(test_pair_vmci_DEPENDENCIES) $(EXTRA_test_pair_vmci_DEPENDENCIES) @rm -f test_pair_vmci$(EXEEXT) $(AM_V_CXXLD)$(test_pair_vmci_LINK) $(test_pair_vmci_OBJECTS) $(test_pair_vmci_LDADD) $(LIBS) tests/test_reqrep_vmci-test_reqrep_vmci.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) test_reqrep_vmci$(EXEEXT): $(test_reqrep_vmci_OBJECTS) $(test_reqrep_vmci_DEPENDENCIES) $(EXTRA_test_reqrep_vmci_DEPENDENCIES) @rm -f test_reqrep_vmci$(EXEEXT) $(AM_V_CXXLD)$(test_reqrep_vmci_LINK) $(test_reqrep_vmci_OBJECTS) $(test_reqrep_vmci_LDADD) $(LIBS) tests/test_abstract_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_abstract_ipc$(EXEEXT): $(tests_test_abstract_ipc_OBJECTS) $(tests_test_abstract_ipc_DEPENDENCIES) $(EXTRA_tests_test_abstract_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_abstract_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_abstract_ipc_OBJECTS) $(tests_test_abstract_ipc_LDADD) $(LIBS) tests/tests_test_address_tipc-test_address_tipc.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_address_tipc$(EXEEXT): $(tests_test_address_tipc_OBJECTS) $(tests_test_address_tipc_DEPENDENCIES) $(EXTRA_tests_test_address_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_address_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_address_tipc_OBJECTS) $(tests_test_address_tipc_LDADD) $(LIBS) tests/test_ancillaries.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_ancillaries$(EXEEXT): $(tests_test_ancillaries_OBJECTS) $(tests_test_ancillaries_DEPENDENCIES) $(EXTRA_tests_test_ancillaries_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_ancillaries$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_ancillaries_OBJECTS) $(tests_test_ancillaries_LDADD) $(LIBS) tests/tests_test_app_meta-test_app_meta.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_app_meta$(EXEEXT): $(tests_test_app_meta_OBJECTS) $(tests_test_app_meta_DEPENDENCIES) $(EXTRA_tests_test_app_meta_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_app_meta$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_app_meta_OBJECTS) $(tests_test_app_meta_LDADD) $(LIBS) tests/test_atomics.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_atomics$(EXEEXT): $(tests_test_atomics_OBJECTS) $(tests_test_atomics_DEPENDENCIES) $(EXTRA_tests_test_atomics_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_atomics$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_atomics_OBJECTS) $(tests_test_atomics_LDADD) $(LIBS) tests/test_base85.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_base85$(EXEEXT): $(tests_test_base85_OBJECTS) $(tests_test_base85_DEPENDENCIES) $(EXTRA_tests_test_base85_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_base85$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_base85_OBJECTS) $(tests_test_base85_LDADD) $(LIBS) tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_bind_after_connect_tcp$(EXEEXT): $(tests_test_bind_after_connect_tcp_OBJECTS) $(tests_test_bind_after_connect_tcp_DEPENDENCIES) $(EXTRA_tests_test_bind_after_connect_tcp_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_bind_after_connect_tcp$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_bind_after_connect_tcp_OBJECTS) $(tests_test_bind_after_connect_tcp_LDADD) $(LIBS) tests/tests_test_bind_src_address-test_bind_src_address.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_bind_src_address$(EXEEXT): $(tests_test_bind_src_address_OBJECTS) $(tests_test_bind_src_address_DEPENDENCIES) $(EXTRA_tests_test_bind_src_address_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_bind_src_address$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_bind_src_address_OBJECTS) $(tests_test_bind_src_address_LDADD) $(LIBS) tests/test_capabilities.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_capabilities$(EXEEXT): $(tests_test_capabilities_OBJECTS) $(tests_test_capabilities_DEPENDENCIES) $(EXTRA_tests_test_capabilities_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_capabilities$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_capabilities_OBJECTS) $(tests_test_capabilities_LDADD) $(LIBS) tests/tests_test_client_server-test_client_server.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_client_server$(EXEEXT): $(tests_test_client_server_OBJECTS) $(tests_test_client_server_DEPENDENCIES) $(EXTRA_tests_test_client_server_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_client_server$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_client_server_OBJECTS) $(tests_test_client_server_LDADD) $(LIBS) tests/tests_test_conflate-test_conflate.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_conflate$(EXEEXT): $(tests_test_conflate_OBJECTS) $(tests_test_conflate_DEPENDENCIES) $(EXTRA_tests_test_conflate_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_conflate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_conflate_OBJECTS) $(tests_test_conflate_LDADD) $(LIBS) tests/test_connect_delay_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_connect_delay_tipc$(EXEEXT): $(tests_test_connect_delay_tipc_OBJECTS) $(tests_test_connect_delay_tipc_DEPENDENCIES) $(EXTRA_tests_test_connect_delay_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_connect_delay_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_connect_delay_tipc_OBJECTS) $(tests_test_connect_delay_tipc_LDADD) $(LIBS) tests/tests_test_connect_resolve-test_connect_resolve.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_connect_resolve$(EXEEXT): $(tests_test_connect_resolve_OBJECTS) $(tests_test_connect_resolve_DEPENDENCIES) $(EXTRA_tests_test_connect_resolve_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_connect_resolve$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_connect_resolve_OBJECTS) $(tests_test_connect_resolve_LDADD) $(LIBS) tests/test_connect_rid.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_connect_rid$(EXEEXT): $(tests_test_connect_rid_OBJECTS) $(tests_test_connect_rid_DEPENDENCIES) $(EXTRA_tests_test_connect_rid_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_connect_rid$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_connect_rid_OBJECTS) $(tests_test_connect_rid_LDADD) $(LIBS) tests/tests_test_ctx_destroy-test_ctx_destroy.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_ctx_destroy$(EXEEXT): $(tests_test_ctx_destroy_OBJECTS) $(tests_test_ctx_destroy_DEPENDENCIES) $(EXTRA_tests_test_ctx_destroy_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_ctx_destroy$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_ctx_destroy_OBJECTS) $(tests_test_ctx_destroy_LDADD) $(LIBS) tests/test_ctx_options.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_ctx_options$(EXEEXT): $(tests_test_ctx_options_OBJECTS) $(tests_test_ctx_options_DEPENDENCIES) $(EXTRA_tests_test_ctx_options_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_ctx_options$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_ctx_options_OBJECTS) $(tests_test_ctx_options_LDADD) $(LIBS) tests/test_dgram.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_dgram$(EXEEXT): $(tests_test_dgram_OBJECTS) $(tests_test_dgram_DEPENDENCIES) $(EXTRA_tests_test_dgram_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_dgram$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_dgram_OBJECTS) $(tests_test_dgram_LDADD) $(LIBS) tests/test_diffserv.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_diffserv$(EXEEXT): $(tests_test_diffserv_OBJECTS) $(tests_test_diffserv_DEPENDENCIES) $(EXTRA_tests_test_diffserv_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_diffserv$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_diffserv_OBJECTS) $(tests_test_diffserv_LDADD) $(LIBS) tests/test_disconnect_inproc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_disconnect_inproc$(EXEEXT): $(tests_test_disconnect_inproc_OBJECTS) $(tests_test_disconnect_inproc_DEPENDENCIES) $(EXTRA_tests_test_disconnect_inproc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_disconnect_inproc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_disconnect_inproc_OBJECTS) $(tests_test_disconnect_inproc_LDADD) $(LIBS) tests/test_filter_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_filter_ipc$(EXEEXT): $(tests_test_filter_ipc_OBJECTS) $(tests_test_filter_ipc_DEPENDENCIES) $(EXTRA_tests_test_filter_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_filter_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_filter_ipc_OBJECTS) $(tests_test_filter_ipc_LDADD) $(LIBS) tests/test_fork.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_fork$(EXEEXT): $(tests_test_fork_OBJECTS) $(tests_test_fork_DEPENDENCIES) $(EXTRA_tests_test_fork_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_fork$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_fork_OBJECTS) $(tests_test_fork_LDADD) $(LIBS) tests/test_getsockopt_memset.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_getsockopt_memset$(EXEEXT): $(tests_test_getsockopt_memset_OBJECTS) $(tests_test_getsockopt_memset_DEPENDENCIES) $(EXTRA_tests_test_getsockopt_memset_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_getsockopt_memset$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_getsockopt_memset_OBJECTS) $(tests_test_getsockopt_memset_LDADD) $(LIBS) tests/test_heartbeats.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_heartbeats$(EXEEXT): $(tests_test_heartbeats_OBJECTS) $(tests_test_heartbeats_DEPENDENCIES) $(EXTRA_tests_test_heartbeats_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_heartbeats$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_heartbeats_OBJECTS) $(tests_test_heartbeats_LDADD) $(LIBS) tests/tests_test_hwm-test_hwm.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_hwm$(EXEEXT): $(tests_test_hwm_OBJECTS) $(tests_test_hwm_DEPENDENCIES) $(EXTRA_tests_test_hwm_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_hwm$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_hwm_OBJECTS) $(tests_test_hwm_LDADD) $(LIBS) tests/test_hwm_pubsub.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_hwm_pubsub$(EXEEXT): $(tests_test_hwm_pubsub_OBJECTS) $(tests_test_hwm_pubsub_DEPENDENCIES) $(EXTRA_tests_test_hwm_pubsub_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_hwm_pubsub$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_hwm_pubsub_OBJECTS) $(tests_test_hwm_pubsub_LDADD) $(LIBS) tests/tests_test_immediate-test_immediate.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_immediate$(EXEEXT): $(tests_test_immediate_OBJECTS) $(tests_test_immediate_DEPENDENCIES) $(EXTRA_tests_test_immediate_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_immediate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_immediate_OBJECTS) $(tests_test_immediate_LDADD) $(LIBS) tests/test_inproc_connect.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_inproc_connect$(EXEEXT): $(tests_test_inproc_connect_OBJECTS) $(tests_test_inproc_connect_DEPENDENCIES) $(EXTRA_tests_test_inproc_connect_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_inproc_connect$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_inproc_connect_OBJECTS) $(tests_test_inproc_connect_LDADD) $(LIBS) tests/test_invalid_rep.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_invalid_rep$(EXEEXT): $(tests_test_invalid_rep_OBJECTS) $(tests_test_invalid_rep_DEPENDENCIES) $(EXTRA_tests_test_invalid_rep_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_invalid_rep$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_invalid_rep_OBJECTS) $(tests_test_invalid_rep_LDADD) $(LIBS) tests/test_iov.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_iov$(EXEEXT): $(tests_test_iov_OBJECTS) $(tests_test_iov_DEPENDENCIES) $(EXTRA_tests_test_iov_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_iov$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_iov_OBJECTS) $(tests_test_iov_LDADD) $(LIBS) tests/test_ipc_wildcard.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_ipc_wildcard$(EXEEXT): $(tests_test_ipc_wildcard_OBJECTS) $(tests_test_ipc_wildcard_DEPENDENCIES) $(EXTRA_tests_test_ipc_wildcard_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_ipc_wildcard$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_ipc_wildcard_OBJECTS) $(tests_test_ipc_wildcard_LDADD) $(LIBS) tests/test_issue_566.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_issue_566$(EXEEXT): $(tests_test_issue_566_OBJECTS) $(tests_test_issue_566_DEPENDENCIES) $(EXTRA_tests_test_issue_566_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_issue_566$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_issue_566_OBJECTS) $(tests_test_issue_566_LDADD) $(LIBS) tests/tests_test_last_endpoint-test_last_endpoint.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_last_endpoint$(EXEEXT): $(tests_test_last_endpoint_OBJECTS) $(tests_test_last_endpoint_DEPENDENCIES) $(EXTRA_tests_test_last_endpoint_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_last_endpoint$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_last_endpoint_OBJECTS) $(tests_test_last_endpoint_LDADD) $(LIBS) tests/test_many_sockets.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_many_sockets$(EXEEXT): $(tests_test_many_sockets_OBJECTS) $(tests_test_many_sockets_DEPENDENCIES) $(EXTRA_tests_test_many_sockets_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_many_sockets$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_many_sockets_OBJECTS) $(tests_test_many_sockets_LDADD) $(LIBS) tests/test_metadata.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_metadata$(EXEEXT): $(tests_test_metadata_OBJECTS) $(tests_test_metadata_DEPENDENCIES) $(EXTRA_tests_test_metadata_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_metadata$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_metadata_OBJECTS) $(tests_test_metadata_LDADD) $(LIBS) tests/test_monitor.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_monitor$(EXEEXT): $(tests_test_monitor_OBJECTS) $(tests_test_monitor_DEPENDENCIES) $(EXTRA_tests_test_monitor_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_monitor$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_monitor_OBJECTS) $(tests_test_monitor_LDADD) $(LIBS) tests/test_msg_ffn.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_msg_ffn$(EXEEXT): $(tests_test_msg_ffn_OBJECTS) $(tests_test_msg_ffn_DEPENDENCIES) $(EXTRA_tests_test_msg_ffn_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_msg_ffn$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_msg_ffn_OBJECTS) $(tests_test_msg_ffn_LDADD) $(LIBS) tests/test_msg_flags.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_msg_flags$(EXEEXT): $(tests_test_msg_flags_OBJECTS) $(tests_test_msg_flags_DEPENDENCIES) $(EXTRA_tests_test_msg_flags_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_msg_flags$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_msg_flags_OBJECTS) $(tests_test_msg_flags_LDADD) $(LIBS) tests/test_pair_inproc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_pair_inproc$(EXEEXT): $(tests_test_pair_inproc_OBJECTS) $(tests_test_pair_inproc_DEPENDENCIES) $(EXTRA_tests_test_pair_inproc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_pair_inproc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_pair_inproc_OBJECTS) $(tests_test_pair_inproc_LDADD) $(LIBS) tests/test_pair_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_pair_ipc$(EXEEXT): $(tests_test_pair_ipc_OBJECTS) $(tests_test_pair_ipc_DEPENDENCIES) $(EXTRA_tests_test_pair_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_pair_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_pair_ipc_OBJECTS) $(tests_test_pair_ipc_LDADD) $(LIBS) tests/test_pair_tcp.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_pair_tcp$(EXEEXT): $(tests_test_pair_tcp_OBJECTS) $(tests_test_pair_tcp_DEPENDENCIES) $(EXTRA_tests_test_pair_tcp_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_pair_tcp$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_pair_tcp_OBJECTS) $(tests_test_pair_tcp_LDADD) $(LIBS) tests/test_pair_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_pair_tipc$(EXEEXT): $(tests_test_pair_tipc_OBJECTS) $(tests_test_pair_tipc_DEPENDENCIES) $(EXTRA_tests_test_pair_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_pair_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_pair_tipc_OBJECTS) $(tests_test_pair_tipc_LDADD) $(LIBS) tests/tests_test_poller-test_poller.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_poller$(EXEEXT): $(tests_test_poller_OBJECTS) $(tests_test_poller_DEPENDENCIES) $(EXTRA_tests_test_poller_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_poller$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_poller_OBJECTS) $(tests_test_poller_LDADD) $(LIBS) tests/test_probe_router.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_probe_router$(EXEEXT): $(tests_test_probe_router_OBJECTS) $(tests_test_probe_router_DEPENDENCIES) $(EXTRA_tests_test_probe_router_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_probe_router$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_probe_router_OBJECTS) $(tests_test_probe_router_LDADD) $(LIBS) tests/test_proxy.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_proxy$(EXEEXT): $(tests_test_proxy_OBJECTS) $(tests_test_proxy_DEPENDENCIES) $(EXTRA_tests_test_proxy_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_proxy$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_proxy_OBJECTS) $(tests_test_proxy_LDADD) $(LIBS) tests/test_proxy_single_socket.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_proxy_single_socket$(EXEEXT): $(tests_test_proxy_single_socket_OBJECTS) $(tests_test_proxy_single_socket_DEPENDENCIES) $(EXTRA_tests_test_proxy_single_socket_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_proxy_single_socket$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_proxy_single_socket_OBJECTS) $(tests_test_proxy_single_socket_LDADD) $(LIBS) tests/test_proxy_terminate.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_proxy_terminate$(EXEEXT): $(tests_test_proxy_terminate_OBJECTS) $(tests_test_proxy_terminate_DEPENDENCIES) $(EXTRA_tests_test_proxy_terminate_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_proxy_terminate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_proxy_terminate_OBJECTS) $(tests_test_proxy_terminate_LDADD) $(LIBS) tests/test_pub_invert_matching.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_pub_invert_matching$(EXEEXT): $(tests_test_pub_invert_matching_OBJECTS) $(tests_test_pub_invert_matching_DEPENDENCIES) $(EXTRA_tests_test_pub_invert_matching_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_pub_invert_matching$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_pub_invert_matching_OBJECTS) $(tests_test_pub_invert_matching_LDADD) $(LIBS) tests/tests_test_radio_dish-test_radio_dish.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_radio_dish$(EXEEXT): $(tests_test_radio_dish_OBJECTS) $(tests_test_radio_dish_DEPENDENCIES) $(EXTRA_tests_test_radio_dish_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_radio_dish$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_radio_dish_OBJECTS) $(tests_test_radio_dish_LDADD) $(LIBS) tests/test_rebind_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_rebind_ipc$(EXEEXT): $(tests_test_rebind_ipc_OBJECTS) $(tests_test_rebind_ipc_DEPENDENCIES) $(EXTRA_tests_test_rebind_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_rebind_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_rebind_ipc_OBJECTS) $(tests_test_rebind_ipc_LDADD) $(LIBS) tests/tests_test_reconnect_ivl-test_reconnect_ivl.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_reconnect_ivl$(EXEEXT): $(tests_test_reconnect_ivl_OBJECTS) $(tests_test_reconnect_ivl_DEPENDENCIES) $(EXTRA_tests_test_reconnect_ivl_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reconnect_ivl$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reconnect_ivl_OBJECTS) $(tests_test_reconnect_ivl_LDADD) $(LIBS) tests/test_req_correlate.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_req_correlate$(EXEEXT): $(tests_test_req_correlate_OBJECTS) $(tests_test_req_correlate_DEPENDENCIES) $(EXTRA_tests_test_req_correlate_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_req_correlate$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_req_correlate_OBJECTS) $(tests_test_req_correlate_LDADD) $(LIBS) tests/test_req_relaxed.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_req_relaxed$(EXEEXT): $(tests_test_req_relaxed_OBJECTS) $(tests_test_req_relaxed_DEPENDENCIES) $(EXTRA_tests_test_req_relaxed_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_req_relaxed$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_req_relaxed_OBJECTS) $(tests_test_req_relaxed_LDADD) $(LIBS) tests/test_reqrep_device.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_device$(EXEEXT): $(tests_test_reqrep_device_OBJECTS) $(tests_test_reqrep_device_DEPENDENCIES) $(EXTRA_tests_test_reqrep_device_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_device$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_device_OBJECTS) $(tests_test_reqrep_device_LDADD) $(LIBS) tests/test_reqrep_device_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_device_tipc$(EXEEXT): $(tests_test_reqrep_device_tipc_OBJECTS) $(tests_test_reqrep_device_tipc_DEPENDENCIES) $(EXTRA_tests_test_reqrep_device_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_device_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_device_tipc_OBJECTS) $(tests_test_reqrep_device_tipc_LDADD) $(LIBS) tests/test_reqrep_inproc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_inproc$(EXEEXT): $(tests_test_reqrep_inproc_OBJECTS) $(tests_test_reqrep_inproc_DEPENDENCIES) $(EXTRA_tests_test_reqrep_inproc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_inproc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_inproc_OBJECTS) $(tests_test_reqrep_inproc_LDADD) $(LIBS) tests/test_reqrep_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_ipc$(EXEEXT): $(tests_test_reqrep_ipc_OBJECTS) $(tests_test_reqrep_ipc_DEPENDENCIES) $(EXTRA_tests_test_reqrep_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_ipc_OBJECTS) $(tests_test_reqrep_ipc_LDADD) $(LIBS) tests/tests_test_reqrep_tcp-test_reqrep_tcp.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_tcp$(EXEEXT): $(tests_test_reqrep_tcp_OBJECTS) $(tests_test_reqrep_tcp_DEPENDENCIES) $(EXTRA_tests_test_reqrep_tcp_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_tcp$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_tcp_OBJECTS) $(tests_test_reqrep_tcp_LDADD) $(LIBS) tests/test_reqrep_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_reqrep_tipc$(EXEEXT): $(tests_test_reqrep_tipc_OBJECTS) $(tests_test_reqrep_tipc_DEPENDENCIES) $(EXTRA_tests_test_reqrep_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_reqrep_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_reqrep_tipc_OBJECTS) $(tests_test_reqrep_tipc_LDADD) $(LIBS) tests/tests_test_router_handover-test_router_handover.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_router_handover$(EXEEXT): $(tests_test_router_handover_OBJECTS) $(tests_test_router_handover_DEPENDENCIES) $(EXTRA_tests_test_router_handover_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_router_handover$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_router_handover_OBJECTS) $(tests_test_router_handover_LDADD) $(LIBS) tests/tests_test_router_mandatory-test_router_mandatory.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_router_mandatory$(EXEEXT): $(tests_test_router_mandatory_OBJECTS) $(tests_test_router_mandatory_DEPENDENCIES) $(EXTRA_tests_test_router_mandatory_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_router_mandatory$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_router_mandatory_OBJECTS) $(tests_test_router_mandatory_LDADD) $(LIBS) tests/test_router_mandatory_hwm.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_router_mandatory_hwm$(EXEEXT): $(tests_test_router_mandatory_hwm_OBJECTS) $(tests_test_router_mandatory_hwm_DEPENDENCIES) $(EXTRA_tests_test_router_mandatory_hwm_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_router_mandatory_hwm$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_router_mandatory_hwm_OBJECTS) $(tests_test_router_mandatory_hwm_LDADD) $(LIBS) tests/test_router_mandatory_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_router_mandatory_tipc$(EXEEXT): $(tests_test_router_mandatory_tipc_OBJECTS) $(tests_test_router_mandatory_tipc_DEPENDENCIES) $(EXTRA_tests_test_router_mandatory_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_router_mandatory_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_router_mandatory_tipc_OBJECTS) $(tests_test_router_mandatory_tipc_LDADD) $(LIBS) tests/test_scatter_gather.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_scatter_gather$(EXEEXT): $(tests_test_scatter_gather_OBJECTS) $(tests_test_scatter_gather_DEPENDENCIES) $(EXTRA_tests_test_scatter_gather_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_scatter_gather$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_scatter_gather_OBJECTS) $(tests_test_scatter_gather_LDADD) $(LIBS) tests/tests_test_security_curve-test_security_curve.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) src/tests_test_security_curve-clock.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/tests_test_security_curve-random.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/tests_test_security_curve-err.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/tests_test_security_curve-tweetnacl.$(OBJEXT): \ src/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp) tests/test_security_curve$(EXEEXT): $(tests_test_security_curve_OBJECTS) $(tests_test_security_curve_DEPENDENCIES) $(EXTRA_tests_test_security_curve_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_security_curve$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_security_curve_OBJECTS) $(tests_test_security_curve_LDADD) $(LIBS) tests/test_security_gssapi.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_security_gssapi$(EXEEXT): $(tests_test_security_gssapi_OBJECTS) $(tests_test_security_gssapi_DEPENDENCIES) $(EXTRA_tests_test_security_gssapi_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_security_gssapi$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_security_gssapi_OBJECTS) $(tests_test_security_gssapi_LDADD) $(LIBS) tests/test_security_null.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_security_null$(EXEEXT): $(tests_test_security_null_OBJECTS) $(tests_test_security_null_DEPENDENCIES) $(EXTRA_tests_test_security_null_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_security_null$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_security_null_OBJECTS) $(tests_test_security_null_LDADD) $(LIBS) tests/test_security_plain.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_security_plain$(EXEEXT): $(tests_test_security_plain_OBJECTS) $(tests_test_security_plain_DEPENDENCIES) $(EXTRA_tests_test_security_plain_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_security_plain$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_security_plain_OBJECTS) $(tests_test_security_plain_LDADD) $(LIBS) tests/test_security_zap.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_security_zap$(EXEEXT): $(tests_test_security_zap_OBJECTS) $(tests_test_security_zap_DEPENDENCIES) $(EXTRA_tests_test_security_zap_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_security_zap$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_security_zap_OBJECTS) $(tests_test_security_zap_LDADD) $(LIBS) tests/test_setsockopt.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_setsockopt$(EXEEXT): $(tests_test_setsockopt_OBJECTS) $(tests_test_setsockopt_DEPENDENCIES) $(EXTRA_tests_test_setsockopt_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_setsockopt$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_setsockopt_OBJECTS) $(tests_test_setsockopt_LDADD) $(LIBS) tests/test_shutdown_stress.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_shutdown_stress$(EXEEXT): $(tests_test_shutdown_stress_OBJECTS) $(tests_test_shutdown_stress_DEPENDENCIES) $(EXTRA_tests_test_shutdown_stress_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_shutdown_stress$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_shutdown_stress_OBJECTS) $(tests_test_shutdown_stress_LDADD) $(LIBS) tests/test_shutdown_stress_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_shutdown_stress_tipc$(EXEEXT): $(tests_test_shutdown_stress_tipc_OBJECTS) $(tests_test_shutdown_stress_tipc_DEPENDENCIES) $(EXTRA_tests_test_shutdown_stress_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_shutdown_stress_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_shutdown_stress_tipc_OBJECTS) $(tests_test_shutdown_stress_tipc_LDADD) $(LIBS) tests/tests_test_socket_null-test_socket_null.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_socket_null$(EXEEXT): $(tests_test_socket_null_OBJECTS) $(tests_test_socket_null_DEPENDENCIES) $(EXTRA_tests_test_socket_null_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_socket_null$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_socket_null_OBJECTS) $(tests_test_socket_null_LDADD) $(LIBS) tests/tests_test_sockopt_hwm-test_sockopt_hwm.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_sockopt_hwm$(EXEEXT): $(tests_test_sockopt_hwm_OBJECTS) $(tests_test_sockopt_hwm_DEPENDENCIES) $(EXTRA_tests_test_sockopt_hwm_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_sockopt_hwm$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_sockopt_hwm_OBJECTS) $(tests_test_sockopt_hwm_LDADD) $(LIBS) tests/test_sodium.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_sodium$(EXEEXT): $(tests_test_sodium_OBJECTS) $(tests_test_sodium_DEPENDENCIES) $(EXTRA_tests_test_sodium_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_sodium$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_sodium_OBJECTS) $(tests_test_sodium_LDADD) $(LIBS) tests/test_spec_dealer.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_spec_dealer$(EXEEXT): $(tests_test_spec_dealer_OBJECTS) $(tests_test_spec_dealer_DEPENDENCIES) $(EXTRA_tests_test_spec_dealer_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_spec_dealer$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_spec_dealer_OBJECTS) $(tests_test_spec_dealer_LDADD) $(LIBS) tests/test_spec_pushpull.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_spec_pushpull$(EXEEXT): $(tests_test_spec_pushpull_OBJECTS) $(tests_test_spec_pushpull_DEPENDENCIES) $(EXTRA_tests_test_spec_pushpull_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_spec_pushpull$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_spec_pushpull_OBJECTS) $(tests_test_spec_pushpull_LDADD) $(LIBS) tests/test_spec_rep.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_spec_rep$(EXEEXT): $(tests_test_spec_rep_OBJECTS) $(tests_test_spec_rep_DEPENDENCIES) $(EXTRA_tests_test_spec_rep_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_spec_rep$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_spec_rep_OBJECTS) $(tests_test_spec_rep_LDADD) $(LIBS) tests/test_spec_req.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_spec_req$(EXEEXT): $(tests_test_spec_req_OBJECTS) $(tests_test_spec_req_DEPENDENCIES) $(EXTRA_tests_test_spec_req_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_spec_req$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_spec_req_OBJECTS) $(tests_test_spec_req_LDADD) $(LIBS) tests/test_spec_router.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_spec_router$(EXEEXT): $(tests_test_spec_router_OBJECTS) $(tests_test_spec_router_DEPENDENCIES) $(EXTRA_tests_test_spec_router_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_spec_router$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_spec_router_OBJECTS) $(tests_test_spec_router_LDADD) $(LIBS) tests/test_srcfd.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_srcfd$(EXEEXT): $(tests_test_srcfd_OBJECTS) $(tests_test_srcfd_DEPENDENCIES) $(EXTRA_tests_test_srcfd_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_srcfd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_srcfd_OBJECTS) $(tests_test_srcfd_LDADD) $(LIBS) tests/test_stream.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_stream$(EXEEXT): $(tests_test_stream_OBJECTS) $(tests_test_stream_DEPENDENCIES) $(EXTRA_tests_test_stream_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_stream$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_stream_OBJECTS) $(tests_test_stream_LDADD) $(LIBS) tests/test_stream_disconnect.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_stream_disconnect$(EXEEXT): $(tests_test_stream_disconnect_OBJECTS) $(tests_test_stream_disconnect_DEPENDENCIES) $(EXTRA_tests_test_stream_disconnect_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_stream_disconnect$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_stream_disconnect_OBJECTS) $(tests_test_stream_disconnect_LDADD) $(LIBS) tests/test_stream_empty.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_stream_empty$(EXEEXT): $(tests_test_stream_empty_OBJECTS) $(tests_test_stream_empty_DEPENDENCIES) $(EXTRA_tests_test_stream_empty_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_stream_empty$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_stream_empty_OBJECTS) $(tests_test_stream_empty_LDADD) $(LIBS) tests/test_stream_exceeds_buffer.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_stream_exceeds_buffer$(EXEEXT): $(tests_test_stream_exceeds_buffer_OBJECTS) $(tests_test_stream_exceeds_buffer_DEPENDENCIES) $(EXTRA_tests_test_stream_exceeds_buffer_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_stream_exceeds_buffer$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_stream_exceeds_buffer_OBJECTS) $(tests_test_stream_exceeds_buffer_LDADD) $(LIBS) tests/test_stream_timeout.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_stream_timeout$(EXEEXT): $(tests_test_stream_timeout_OBJECTS) $(tests_test_stream_timeout_DEPENDENCIES) $(EXTRA_tests_test_stream_timeout_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_stream_timeout$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_stream_timeout_OBJECTS) $(tests_test_stream_timeout_LDADD) $(LIBS) tests/test_sub_forward.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_sub_forward$(EXEEXT): $(tests_test_sub_forward_OBJECTS) $(tests_test_sub_forward_DEPENDENCIES) $(EXTRA_tests_test_sub_forward_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_sub_forward$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_sub_forward_OBJECTS) $(tests_test_sub_forward_LDADD) $(LIBS) tests/test_sub_forward_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_sub_forward_tipc$(EXEEXT): $(tests_test_sub_forward_tipc_OBJECTS) $(tests_test_sub_forward_tipc_DEPENDENCIES) $(EXTRA_tests_test_sub_forward_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_sub_forward_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_sub_forward_tipc_OBJECTS) $(tests_test_sub_forward_tipc_LDADD) $(LIBS) tests/test_system.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_system$(EXEEXT): $(tests_test_system_OBJECTS) $(tests_test_system_DEPENDENCIES) $(EXTRA_tests_test_system_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_system$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_system_OBJECTS) $(tests_test_system_LDADD) $(LIBS) tests/test_term_endpoint.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_term_endpoint$(EXEEXT): $(tests_test_term_endpoint_OBJECTS) $(tests_test_term_endpoint_DEPENDENCIES) $(EXTRA_tests_test_term_endpoint_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_term_endpoint$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_term_endpoint_OBJECTS) $(tests_test_term_endpoint_LDADD) $(LIBS) tests/test_term_endpoint_tipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_term_endpoint_tipc$(EXEEXT): $(tests_test_term_endpoint_tipc_OBJECTS) $(tests_test_term_endpoint_tipc_DEPENDENCIES) $(EXTRA_tests_test_term_endpoint_tipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_term_endpoint_tipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_term_endpoint_tipc_OBJECTS) $(tests_test_term_endpoint_tipc_LDADD) $(LIBS) tests/tests_test_thread_safe-test_thread_safe.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_thread_safe$(EXEEXT): $(tests_test_thread_safe_OBJECTS) $(tests_test_thread_safe_DEPENDENCIES) $(EXTRA_tests_test_thread_safe_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_thread_safe$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_thread_safe_OBJECTS) $(tests_test_thread_safe_LDADD) $(LIBS) tests/test_timeo.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_timeo$(EXEEXT): $(tests_test_timeo_OBJECTS) $(tests_test_timeo_DEPENDENCIES) $(EXTRA_tests_test_timeo_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_timeo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_timeo_OBJECTS) $(tests_test_timeo_LDADD) $(LIBS) tests/test_timers.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_timers$(EXEEXT): $(tests_test_timers_OBJECTS) $(tests_test_timers_DEPENDENCIES) $(EXTRA_tests_test_timers_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_timers$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_timers_OBJECTS) $(tests_test_timers_LDADD) $(LIBS) tests/test_unbind_inproc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_unbind_inproc$(EXEEXT): $(tests_test_unbind_inproc_OBJECTS) $(tests_test_unbind_inproc_DEPENDENCIES) $(EXTRA_tests_test_unbind_inproc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_unbind_inproc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_unbind_inproc_OBJECTS) $(tests_test_unbind_inproc_LDADD) $(LIBS) tests/test_unbind_wildcard.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_unbind_wildcard$(EXEEXT): $(tests_test_unbind_wildcard_OBJECTS) $(tests_test_unbind_wildcard_DEPENDENCIES) $(EXTRA_tests_test_unbind_wildcard_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_unbind_wildcard$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_unbind_wildcard_OBJECTS) $(tests_test_unbind_wildcard_LDADD) $(LIBS) tests/test_use_fd_ipc.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_use_fd_ipc$(EXEEXT): $(tests_test_use_fd_ipc_OBJECTS) $(tests_test_use_fd_ipc_DEPENDENCIES) $(EXTRA_tests_test_use_fd_ipc_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_use_fd_ipc$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_use_fd_ipc_OBJECTS) $(tests_test_use_fd_ipc_LDADD) $(LIBS) tests/test_use_fd_tcp.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_use_fd_tcp$(EXEEXT): $(tests_test_use_fd_tcp_OBJECTS) $(tests_test_use_fd_tcp_DEPENDENCIES) $(EXTRA_tests_test_use_fd_tcp_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_use_fd_tcp$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_use_fd_tcp_OBJECTS) $(tests_test_use_fd_tcp_LDADD) $(LIBS) tests/test_xpub_manual.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_xpub_manual$(EXEEXT): $(tests_test_xpub_manual_OBJECTS) $(tests_test_xpub_manual_DEPENDENCIES) $(EXTRA_tests_test_xpub_manual_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_xpub_manual$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_xpub_manual_OBJECTS) $(tests_test_xpub_manual_LDADD) $(LIBS) tests/test_xpub_nodrop.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_xpub_nodrop$(EXEEXT): $(tests_test_xpub_nodrop_OBJECTS) $(tests_test_xpub_nodrop_DEPENDENCIES) $(EXTRA_tests_test_xpub_nodrop_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_xpub_nodrop$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_xpub_nodrop_OBJECTS) $(tests_test_xpub_nodrop_LDADD) $(LIBS) tests/tests_test_xpub_verbose-test_xpub_verbose.$(OBJEXT): \ tests/$(am__dirstamp) tests/$(DEPDIR)/$(am__dirstamp) tests/test_xpub_verbose$(EXEEXT): $(tests_test_xpub_verbose_OBJECTS) $(tests_test_xpub_verbose_DEPENDENCIES) $(EXTRA_tests_test_xpub_verbose_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_xpub_verbose$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_xpub_verbose_OBJECTS) $(tests_test_xpub_verbose_LDADD) $(LIBS) tests/test_xpub_welcome_msg.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_xpub_welcome_msg$(EXEEXT): $(tests_test_xpub_welcome_msg_OBJECTS) $(tests_test_xpub_welcome_msg_DEPENDENCIES) $(EXTRA_tests_test_xpub_welcome_msg_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_xpub_welcome_msg$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_xpub_welcome_msg_OBJECTS) $(tests_test_xpub_welcome_msg_LDADD) $(LIBS) tests/test_zmq_poll_fd.$(OBJEXT): tests/$(am__dirstamp) \ tests/$(DEPDIR)/$(am__dirstamp) tests/test_zmq_poll_fd$(EXEEXT): $(tests_test_zmq_poll_fd_OBJECTS) $(tests_test_zmq_poll_fd_DEPENDENCIES) $(EXTRA_tests_test_zmq_poll_fd_DEPENDENCIES) tests/$(am__dirstamp) @rm -f tests/test_zmq_poll_fd$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tests_test_zmq_poll_fd_OBJECTS) $(tests_test_zmq_poll_fd_LDADD) $(LIBS) tools/$(am__dirstamp): @$(MKDIR_P) tools @: > tools/$(am__dirstamp) tools/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) tools/$(DEPDIR) @: > tools/$(DEPDIR)/$(am__dirstamp) tools/curve_keygen.$(OBJEXT): tools/$(am__dirstamp) \ tools/$(DEPDIR)/$(am__dirstamp) tools/curve_keygen$(EXEEXT): $(tools_curve_keygen_OBJECTS) $(tools_curve_keygen_DEPENDENCIES) $(EXTRA_tools_curve_keygen_DEPENDENCIES) tools/$(am__dirstamp) @rm -f tools/curve_keygen$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(tools_curve_keygen_OBJECTS) $(tools_curve_keygen_LDADD) $(LIBS) unittests/$(am__dirstamp): @$(MKDIR_P) unittests @: > unittests/$(am__dirstamp) unittests/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) unittests/$(DEPDIR) @: > unittests/$(DEPDIR)/$(am__dirstamp) unittests/unittests_unittest_mtrie-unittest_mtrie.$(OBJEXT): \ unittests/$(am__dirstamp) unittests/$(DEPDIR)/$(am__dirstamp) unittests/unittest_mtrie$(EXEEXT): $(unittests_unittest_mtrie_OBJECTS) $(unittests_unittest_mtrie_DEPENDENCIES) $(EXTRA_unittests_unittest_mtrie_DEPENDENCIES) unittests/$(am__dirstamp) @rm -f unittests/unittest_mtrie$(EXEEXT) $(AM_V_CXXLD)$(unittests_unittest_mtrie_LINK) $(unittests_unittest_mtrie_OBJECTS) $(unittests_unittest_mtrie_LDADD) $(LIBS) unittests/unittests_unittest_poller-unittest_poller.$(OBJEXT): \ unittests/$(am__dirstamp) unittests/$(DEPDIR)/$(am__dirstamp) unittests/unittest_poller$(EXEEXT): $(unittests_unittest_poller_OBJECTS) $(unittests_unittest_poller_DEPENDENCIES) $(EXTRA_unittests_unittest_poller_DEPENDENCIES) unittests/$(am__dirstamp) @rm -f unittests/unittest_poller$(EXEEXT) $(AM_V_CXXLD)$(unittests_unittest_poller_LINK) $(unittests_unittest_poller_OBJECTS) $(unittests_unittest_poller_LDADD) $(LIBS) unittests/unittests_unittest_ypipe-unittest_ypipe.$(OBJEXT): \ unittests/$(am__dirstamp) unittests/$(DEPDIR)/$(am__dirstamp) unittests/unittest_ypipe$(EXEEXT): $(unittests_unittest_ypipe_OBJECTS) $(unittests_unittest_ypipe_DEPENDENCIES) $(EXTRA_unittests_unittest_ypipe_DEPENDENCIES) unittests/$(am__dirstamp) @rm -f unittests/unittest_ypipe$(EXEEXT) $(AM_V_CXXLD)$(unittests_unittest_ypipe_LINK) $(unittests_unittest_ypipe_OBJECTS) $(unittests_unittest_ypipe_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f external/unity/*.$(OBJEXT) -rm -f perf/*.$(OBJEXT) -rm -f src/*.$(OBJEXT) -rm -f src/*.lo -rm -f tests/*.$(OBJEXT) -rm -f tools/*.$(OBJEXT) -rm -f unittests/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@external/unity/$(DEPDIR)/unity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/inproc_lat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/inproc_thr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/local_lat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/local_thr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/remote_lat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@perf/$(DEPDIR)/remote_thr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-clock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-ctx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-curve_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-curve_mechanism_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-curve_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-dealer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-decoder_allocators.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-devpoll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-dgram.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-dish.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-dist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-epoll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-err.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-fq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-gather.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-gssapi_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-gssapi_mechanism_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-gssapi_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-io_object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-io_thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-ip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-ipc_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-ipc_connecter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-ipc_listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-kqueue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-lb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-mailbox.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-mailbox_safe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-mechanism.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-mechanism_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-metadata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-msg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-mtrie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-norm_engine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-null_mechanism.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-object.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-options.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-own.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pair.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pgm_receiver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pgm_sender.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pgm_socket.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pipe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-plain_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-plain_server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-poll.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-poller_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pollset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-precompiled.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-proxy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-pull.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-push.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-radio.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-random.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-raw_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-raw_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-reaper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-rep.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-req.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-router.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-scatter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-select.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-server.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-session_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-signaler.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-socket_base.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-socket_poller.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-socks.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-socks_connecter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-stream_engine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-sub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tcp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tcp_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tcp_connecter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tcp_listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-thread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-timers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tipc_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tipc_connecter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tipc_listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-trie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-tweetnacl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-udp_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-udp_engine.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-v1_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-v1_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-v2_decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-v2_encoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-vmci.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-vmci_address.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-vmci_connecter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-vmci_listener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-xpub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-xsub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-zap_client.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-zmq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_libzmq_la-zmq_utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tests_test_security_curve-clock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tests_test_security_curve-err.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tests_test_security_curve-random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_abstract_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_ancillaries.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_atomics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_base85.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_capabilities.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_connect_delay_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_connect_rid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_ctx_options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_dgram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_diffserv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_disconnect_inproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_filter_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_fork.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_getsockopt_memset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_heartbeats.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_hwm_pubsub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_inproc_connect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_invalid_rep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_iov.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_ipc_wildcard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_issue_566.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_many_sockets.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_metadata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_msg_ffn.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_msg_flags.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pair_inproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pair_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pair_tcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pair_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_probe_router.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_proxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_proxy_single_socket.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_proxy_terminate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_pub_invert_matching.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_rebind_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_req_correlate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_req_relaxed.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_device.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_device_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_inproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_router_mandatory_hwm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_router_mandatory_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_scatter_gather.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_security_gssapi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_security_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_security_plain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_security_zap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_setsockopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_shutdown_stress.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_shutdown_stress_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_sodium.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_spec_dealer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_spec_pushpull.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_spec_rep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_spec_req.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_spec_router.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_srcfd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_stream_disconnect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_stream_empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_stream_exceeds_buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_stream_timeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_sub_forward.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_sub_forward_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_system.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_term_endpoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_term_endpoint_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_timeo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_timers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_unbind_inproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_unbind_wildcard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_use_fd_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_use_fd_tcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_xpub_manual.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_xpub_nodrop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_xpub_welcome_msg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/test_zmq_poll_fd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_client_server-test_client_server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_conflate-test_conflate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_hwm-test_hwm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_immediate-test_immediate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_poller-test_poller.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/curve_keygen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< src/src_libzmq_la-tweetnacl.lo: src/tweetnacl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CFLAGS) $(CFLAGS) -MT src/src_libzmq_la-tweetnacl.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tweetnacl.Tpo -c -o src/src_libzmq_la-tweetnacl.lo `test -f 'src/tweetnacl.c' || echo '$(srcdir)/'`src/tweetnacl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tweetnacl.Tpo src/$(DEPDIR)/src_libzmq_la-tweetnacl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tweetnacl.c' object='src/src_libzmq_la-tweetnacl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CFLAGS) $(CFLAGS) -c -o src/src_libzmq_la-tweetnacl.lo `test -f 'src/tweetnacl.c' || echo '$(srcdir)/'`src/tweetnacl.c src/tests_test_security_curve-tweetnacl.o: src/tweetnacl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/tests_test_security_curve-tweetnacl.o -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Tpo -c -o src/tests_test_security_curve-tweetnacl.o `test -f 'src/tweetnacl.c' || echo '$(srcdir)/'`src/tweetnacl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Tpo src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tweetnacl.c' object='src/tests_test_security_curve-tweetnacl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/tests_test_security_curve-tweetnacl.o `test -f 'src/tweetnacl.c' || echo '$(srcdir)/'`src/tweetnacl.c src/tests_test_security_curve-tweetnacl.obj: src/tweetnacl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/tests_test_security_curve-tweetnacl.obj -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Tpo -c -o src/tests_test_security_curve-tweetnacl.obj `if test -f 'src/tweetnacl.c'; then $(CYGPATH_W) 'src/tweetnacl.c'; else $(CYGPATH_W) '$(srcdir)/src/tweetnacl.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Tpo src/$(DEPDIR)/tests_test_security_curve-tweetnacl.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/tweetnacl.c' object='src/tests_test_security_curve-tweetnacl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/tests_test_security_curve-tweetnacl.obj `if test -f 'src/tweetnacl.c'; then $(CYGPATH_W) 'src/tweetnacl.c'; else $(CYGPATH_W) '$(srcdir)/src/tweetnacl.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< src/src_libzmq_la-address.lo: src/address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-address.Tpo -c -o src/src_libzmq_la-address.lo `test -f 'src/address.cpp' || echo '$(srcdir)/'`src/address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-address.Tpo src/$(DEPDIR)/src_libzmq_la-address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/address.cpp' object='src/src_libzmq_la-address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-address.lo `test -f 'src/address.cpp' || echo '$(srcdir)/'`src/address.cpp src/src_libzmq_la-client.lo: src/client.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-client.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-client.Tpo -c -o src/src_libzmq_la-client.lo `test -f 'src/client.cpp' || echo '$(srcdir)/'`src/client.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-client.Tpo src/$(DEPDIR)/src_libzmq_la-client.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client.cpp' object='src/src_libzmq_la-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-client.lo `test -f 'src/client.cpp' || echo '$(srcdir)/'`src/client.cpp src/src_libzmq_la-clock.lo: src/clock.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-clock.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-clock.Tpo -c -o src/src_libzmq_la-clock.lo `test -f 'src/clock.cpp' || echo '$(srcdir)/'`src/clock.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-clock.Tpo src/$(DEPDIR)/src_libzmq_la-clock.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/clock.cpp' object='src/src_libzmq_la-clock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-clock.lo `test -f 'src/clock.cpp' || echo '$(srcdir)/'`src/clock.cpp src/src_libzmq_la-ctx.lo: src/ctx.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-ctx.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-ctx.Tpo -c -o src/src_libzmq_la-ctx.lo `test -f 'src/ctx.cpp' || echo '$(srcdir)/'`src/ctx.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-ctx.Tpo src/$(DEPDIR)/src_libzmq_la-ctx.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/ctx.cpp' object='src/src_libzmq_la-ctx.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-ctx.lo `test -f 'src/ctx.cpp' || echo '$(srcdir)/'`src/ctx.cpp src/src_libzmq_la-curve_client.lo: src/curve_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-curve_client.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-curve_client.Tpo -c -o src/src_libzmq_la-curve_client.lo `test -f 'src/curve_client.cpp' || echo '$(srcdir)/'`src/curve_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-curve_client.Tpo src/$(DEPDIR)/src_libzmq_la-curve_client.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/curve_client.cpp' object='src/src_libzmq_la-curve_client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-curve_client.lo `test -f 'src/curve_client.cpp' || echo '$(srcdir)/'`src/curve_client.cpp src/src_libzmq_la-curve_mechanism_base.lo: src/curve_mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-curve_mechanism_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-curve_mechanism_base.Tpo -c -o src/src_libzmq_la-curve_mechanism_base.lo `test -f 'src/curve_mechanism_base.cpp' || echo '$(srcdir)/'`src/curve_mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-curve_mechanism_base.Tpo src/$(DEPDIR)/src_libzmq_la-curve_mechanism_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/curve_mechanism_base.cpp' object='src/src_libzmq_la-curve_mechanism_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-curve_mechanism_base.lo `test -f 'src/curve_mechanism_base.cpp' || echo '$(srcdir)/'`src/curve_mechanism_base.cpp src/src_libzmq_la-curve_server.lo: src/curve_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-curve_server.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-curve_server.Tpo -c -o src/src_libzmq_la-curve_server.lo `test -f 'src/curve_server.cpp' || echo '$(srcdir)/'`src/curve_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-curve_server.Tpo src/$(DEPDIR)/src_libzmq_la-curve_server.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/curve_server.cpp' object='src/src_libzmq_la-curve_server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-curve_server.lo `test -f 'src/curve_server.cpp' || echo '$(srcdir)/'`src/curve_server.cpp src/src_libzmq_la-dealer.lo: src/dealer.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-dealer.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-dealer.Tpo -c -o src/src_libzmq_la-dealer.lo `test -f 'src/dealer.cpp' || echo '$(srcdir)/'`src/dealer.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-dealer.Tpo src/$(DEPDIR)/src_libzmq_la-dealer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/dealer.cpp' object='src/src_libzmq_la-dealer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-dealer.lo `test -f 'src/dealer.cpp' || echo '$(srcdir)/'`src/dealer.cpp src/src_libzmq_la-devpoll.lo: src/devpoll.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-devpoll.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-devpoll.Tpo -c -o src/src_libzmq_la-devpoll.lo `test -f 'src/devpoll.cpp' || echo '$(srcdir)/'`src/devpoll.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-devpoll.Tpo src/$(DEPDIR)/src_libzmq_la-devpoll.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/devpoll.cpp' object='src/src_libzmq_la-devpoll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-devpoll.lo `test -f 'src/devpoll.cpp' || echo '$(srcdir)/'`src/devpoll.cpp src/src_libzmq_la-dgram.lo: src/dgram.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-dgram.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-dgram.Tpo -c -o src/src_libzmq_la-dgram.lo `test -f 'src/dgram.cpp' || echo '$(srcdir)/'`src/dgram.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-dgram.Tpo src/$(DEPDIR)/src_libzmq_la-dgram.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/dgram.cpp' object='src/src_libzmq_la-dgram.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-dgram.lo `test -f 'src/dgram.cpp' || echo '$(srcdir)/'`src/dgram.cpp src/src_libzmq_la-dish.lo: src/dish.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-dish.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-dish.Tpo -c -o src/src_libzmq_la-dish.lo `test -f 'src/dish.cpp' || echo '$(srcdir)/'`src/dish.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-dish.Tpo src/$(DEPDIR)/src_libzmq_la-dish.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/dish.cpp' object='src/src_libzmq_la-dish.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-dish.lo `test -f 'src/dish.cpp' || echo '$(srcdir)/'`src/dish.cpp src/src_libzmq_la-dist.lo: src/dist.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-dist.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-dist.Tpo -c -o src/src_libzmq_la-dist.lo `test -f 'src/dist.cpp' || echo '$(srcdir)/'`src/dist.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-dist.Tpo src/$(DEPDIR)/src_libzmq_la-dist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/dist.cpp' object='src/src_libzmq_la-dist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-dist.lo `test -f 'src/dist.cpp' || echo '$(srcdir)/'`src/dist.cpp src/src_libzmq_la-epoll.lo: src/epoll.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-epoll.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-epoll.Tpo -c -o src/src_libzmq_la-epoll.lo `test -f 'src/epoll.cpp' || echo '$(srcdir)/'`src/epoll.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-epoll.Tpo src/$(DEPDIR)/src_libzmq_la-epoll.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/epoll.cpp' object='src/src_libzmq_la-epoll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-epoll.lo `test -f 'src/epoll.cpp' || echo '$(srcdir)/'`src/epoll.cpp src/src_libzmq_la-err.lo: src/err.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-err.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-err.Tpo -c -o src/src_libzmq_la-err.lo `test -f 'src/err.cpp' || echo '$(srcdir)/'`src/err.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-err.Tpo src/$(DEPDIR)/src_libzmq_la-err.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/err.cpp' object='src/src_libzmq_la-err.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-err.lo `test -f 'src/err.cpp' || echo '$(srcdir)/'`src/err.cpp src/src_libzmq_la-fq.lo: src/fq.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-fq.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-fq.Tpo -c -o src/src_libzmq_la-fq.lo `test -f 'src/fq.cpp' || echo '$(srcdir)/'`src/fq.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-fq.Tpo src/$(DEPDIR)/src_libzmq_la-fq.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/fq.cpp' object='src/src_libzmq_la-fq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-fq.lo `test -f 'src/fq.cpp' || echo '$(srcdir)/'`src/fq.cpp src/src_libzmq_la-gather.lo: src/gather.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-gather.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-gather.Tpo -c -o src/src_libzmq_la-gather.lo `test -f 'src/gather.cpp' || echo '$(srcdir)/'`src/gather.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-gather.Tpo src/$(DEPDIR)/src_libzmq_la-gather.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/gather.cpp' object='src/src_libzmq_la-gather.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-gather.lo `test -f 'src/gather.cpp' || echo '$(srcdir)/'`src/gather.cpp src/src_libzmq_la-gssapi_mechanism_base.lo: src/gssapi_mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-gssapi_mechanism_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-gssapi_mechanism_base.Tpo -c -o src/src_libzmq_la-gssapi_mechanism_base.lo `test -f 'src/gssapi_mechanism_base.cpp' || echo '$(srcdir)/'`src/gssapi_mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-gssapi_mechanism_base.Tpo src/$(DEPDIR)/src_libzmq_la-gssapi_mechanism_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/gssapi_mechanism_base.cpp' object='src/src_libzmq_la-gssapi_mechanism_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-gssapi_mechanism_base.lo `test -f 'src/gssapi_mechanism_base.cpp' || echo '$(srcdir)/'`src/gssapi_mechanism_base.cpp src/src_libzmq_la-gssapi_client.lo: src/gssapi_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-gssapi_client.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-gssapi_client.Tpo -c -o src/src_libzmq_la-gssapi_client.lo `test -f 'src/gssapi_client.cpp' || echo '$(srcdir)/'`src/gssapi_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-gssapi_client.Tpo src/$(DEPDIR)/src_libzmq_la-gssapi_client.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/gssapi_client.cpp' object='src/src_libzmq_la-gssapi_client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-gssapi_client.lo `test -f 'src/gssapi_client.cpp' || echo '$(srcdir)/'`src/gssapi_client.cpp src/src_libzmq_la-gssapi_server.lo: src/gssapi_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-gssapi_server.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-gssapi_server.Tpo -c -o src/src_libzmq_la-gssapi_server.lo `test -f 'src/gssapi_server.cpp' || echo '$(srcdir)/'`src/gssapi_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-gssapi_server.Tpo src/$(DEPDIR)/src_libzmq_la-gssapi_server.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/gssapi_server.cpp' object='src/src_libzmq_la-gssapi_server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-gssapi_server.lo `test -f 'src/gssapi_server.cpp' || echo '$(srcdir)/'`src/gssapi_server.cpp src/src_libzmq_la-io_object.lo: src/io_object.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-io_object.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-io_object.Tpo -c -o src/src_libzmq_la-io_object.lo `test -f 'src/io_object.cpp' || echo '$(srcdir)/'`src/io_object.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-io_object.Tpo src/$(DEPDIR)/src_libzmq_la-io_object.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/io_object.cpp' object='src/src_libzmq_la-io_object.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-io_object.lo `test -f 'src/io_object.cpp' || echo '$(srcdir)/'`src/io_object.cpp src/src_libzmq_la-io_thread.lo: src/io_thread.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-io_thread.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-io_thread.Tpo -c -o src/src_libzmq_la-io_thread.lo `test -f 'src/io_thread.cpp' || echo '$(srcdir)/'`src/io_thread.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-io_thread.Tpo src/$(DEPDIR)/src_libzmq_la-io_thread.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/io_thread.cpp' object='src/src_libzmq_la-io_thread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-io_thread.lo `test -f 'src/io_thread.cpp' || echo '$(srcdir)/'`src/io_thread.cpp src/src_libzmq_la-ip.lo: src/ip.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-ip.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-ip.Tpo -c -o src/src_libzmq_la-ip.lo `test -f 'src/ip.cpp' || echo '$(srcdir)/'`src/ip.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-ip.Tpo src/$(DEPDIR)/src_libzmq_la-ip.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/ip.cpp' object='src/src_libzmq_la-ip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-ip.lo `test -f 'src/ip.cpp' || echo '$(srcdir)/'`src/ip.cpp src/src_libzmq_la-ipc_address.lo: src/ipc_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-ipc_address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-ipc_address.Tpo -c -o src/src_libzmq_la-ipc_address.lo `test -f 'src/ipc_address.cpp' || echo '$(srcdir)/'`src/ipc_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-ipc_address.Tpo src/$(DEPDIR)/src_libzmq_la-ipc_address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/ipc_address.cpp' object='src/src_libzmq_la-ipc_address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-ipc_address.lo `test -f 'src/ipc_address.cpp' || echo '$(srcdir)/'`src/ipc_address.cpp src/src_libzmq_la-ipc_connecter.lo: src/ipc_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-ipc_connecter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-ipc_connecter.Tpo -c -o src/src_libzmq_la-ipc_connecter.lo `test -f 'src/ipc_connecter.cpp' || echo '$(srcdir)/'`src/ipc_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-ipc_connecter.Tpo src/$(DEPDIR)/src_libzmq_la-ipc_connecter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/ipc_connecter.cpp' object='src/src_libzmq_la-ipc_connecter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-ipc_connecter.lo `test -f 'src/ipc_connecter.cpp' || echo '$(srcdir)/'`src/ipc_connecter.cpp src/src_libzmq_la-ipc_listener.lo: src/ipc_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-ipc_listener.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-ipc_listener.Tpo -c -o src/src_libzmq_la-ipc_listener.lo `test -f 'src/ipc_listener.cpp' || echo '$(srcdir)/'`src/ipc_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-ipc_listener.Tpo src/$(DEPDIR)/src_libzmq_la-ipc_listener.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/ipc_listener.cpp' object='src/src_libzmq_la-ipc_listener.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-ipc_listener.lo `test -f 'src/ipc_listener.cpp' || echo '$(srcdir)/'`src/ipc_listener.cpp src/src_libzmq_la-kqueue.lo: src/kqueue.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-kqueue.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-kqueue.Tpo -c -o src/src_libzmq_la-kqueue.lo `test -f 'src/kqueue.cpp' || echo '$(srcdir)/'`src/kqueue.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-kqueue.Tpo src/$(DEPDIR)/src_libzmq_la-kqueue.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/kqueue.cpp' object='src/src_libzmq_la-kqueue.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-kqueue.lo `test -f 'src/kqueue.cpp' || echo '$(srcdir)/'`src/kqueue.cpp src/src_libzmq_la-lb.lo: src/lb.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-lb.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-lb.Tpo -c -o src/src_libzmq_la-lb.lo `test -f 'src/lb.cpp' || echo '$(srcdir)/'`src/lb.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-lb.Tpo src/$(DEPDIR)/src_libzmq_la-lb.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/lb.cpp' object='src/src_libzmq_la-lb.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-lb.lo `test -f 'src/lb.cpp' || echo '$(srcdir)/'`src/lb.cpp src/src_libzmq_la-mailbox.lo: src/mailbox.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-mailbox.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-mailbox.Tpo -c -o src/src_libzmq_la-mailbox.lo `test -f 'src/mailbox.cpp' || echo '$(srcdir)/'`src/mailbox.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-mailbox.Tpo src/$(DEPDIR)/src_libzmq_la-mailbox.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/mailbox.cpp' object='src/src_libzmq_la-mailbox.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-mailbox.lo `test -f 'src/mailbox.cpp' || echo '$(srcdir)/'`src/mailbox.cpp src/src_libzmq_la-mailbox_safe.lo: src/mailbox_safe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-mailbox_safe.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-mailbox_safe.Tpo -c -o src/src_libzmq_la-mailbox_safe.lo `test -f 'src/mailbox_safe.cpp' || echo '$(srcdir)/'`src/mailbox_safe.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-mailbox_safe.Tpo src/$(DEPDIR)/src_libzmq_la-mailbox_safe.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/mailbox_safe.cpp' object='src/src_libzmq_la-mailbox_safe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-mailbox_safe.lo `test -f 'src/mailbox_safe.cpp' || echo '$(srcdir)/'`src/mailbox_safe.cpp src/src_libzmq_la-mechanism.lo: src/mechanism.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-mechanism.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-mechanism.Tpo -c -o src/src_libzmq_la-mechanism.lo `test -f 'src/mechanism.cpp' || echo '$(srcdir)/'`src/mechanism.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-mechanism.Tpo src/$(DEPDIR)/src_libzmq_la-mechanism.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/mechanism.cpp' object='src/src_libzmq_la-mechanism.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-mechanism.lo `test -f 'src/mechanism.cpp' || echo '$(srcdir)/'`src/mechanism.cpp src/src_libzmq_la-mechanism_base.lo: src/mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-mechanism_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-mechanism_base.Tpo -c -o src/src_libzmq_la-mechanism_base.lo `test -f 'src/mechanism_base.cpp' || echo '$(srcdir)/'`src/mechanism_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-mechanism_base.Tpo src/$(DEPDIR)/src_libzmq_la-mechanism_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/mechanism_base.cpp' object='src/src_libzmq_la-mechanism_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-mechanism_base.lo `test -f 'src/mechanism_base.cpp' || echo '$(srcdir)/'`src/mechanism_base.cpp src/src_libzmq_la-metadata.lo: src/metadata.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-metadata.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-metadata.Tpo -c -o src/src_libzmq_la-metadata.lo `test -f 'src/metadata.cpp' || echo '$(srcdir)/'`src/metadata.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-metadata.Tpo src/$(DEPDIR)/src_libzmq_la-metadata.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/metadata.cpp' object='src/src_libzmq_la-metadata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-metadata.lo `test -f 'src/metadata.cpp' || echo '$(srcdir)/'`src/metadata.cpp src/src_libzmq_la-msg.lo: src/msg.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-msg.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-msg.Tpo -c -o src/src_libzmq_la-msg.lo `test -f 'src/msg.cpp' || echo '$(srcdir)/'`src/msg.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-msg.Tpo src/$(DEPDIR)/src_libzmq_la-msg.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/msg.cpp' object='src/src_libzmq_la-msg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-msg.lo `test -f 'src/msg.cpp' || echo '$(srcdir)/'`src/msg.cpp src/src_libzmq_la-mtrie.lo: src/mtrie.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-mtrie.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-mtrie.Tpo -c -o src/src_libzmq_la-mtrie.lo `test -f 'src/mtrie.cpp' || echo '$(srcdir)/'`src/mtrie.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-mtrie.Tpo src/$(DEPDIR)/src_libzmq_la-mtrie.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/mtrie.cpp' object='src/src_libzmq_la-mtrie.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-mtrie.lo `test -f 'src/mtrie.cpp' || echo '$(srcdir)/'`src/mtrie.cpp src/src_libzmq_la-norm_engine.lo: src/norm_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-norm_engine.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-norm_engine.Tpo -c -o src/src_libzmq_la-norm_engine.lo `test -f 'src/norm_engine.cpp' || echo '$(srcdir)/'`src/norm_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-norm_engine.Tpo src/$(DEPDIR)/src_libzmq_la-norm_engine.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/norm_engine.cpp' object='src/src_libzmq_la-norm_engine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-norm_engine.lo `test -f 'src/norm_engine.cpp' || echo '$(srcdir)/'`src/norm_engine.cpp src/src_libzmq_la-null_mechanism.lo: src/null_mechanism.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-null_mechanism.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-null_mechanism.Tpo -c -o src/src_libzmq_la-null_mechanism.lo `test -f 'src/null_mechanism.cpp' || echo '$(srcdir)/'`src/null_mechanism.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-null_mechanism.Tpo src/$(DEPDIR)/src_libzmq_la-null_mechanism.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/null_mechanism.cpp' object='src/src_libzmq_la-null_mechanism.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-null_mechanism.lo `test -f 'src/null_mechanism.cpp' || echo '$(srcdir)/'`src/null_mechanism.cpp src/src_libzmq_la-object.lo: src/object.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-object.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-object.Tpo -c -o src/src_libzmq_la-object.lo `test -f 'src/object.cpp' || echo '$(srcdir)/'`src/object.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-object.Tpo src/$(DEPDIR)/src_libzmq_la-object.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/object.cpp' object='src/src_libzmq_la-object.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-object.lo `test -f 'src/object.cpp' || echo '$(srcdir)/'`src/object.cpp src/src_libzmq_la-options.lo: src/options.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-options.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-options.Tpo -c -o src/src_libzmq_la-options.lo `test -f 'src/options.cpp' || echo '$(srcdir)/'`src/options.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-options.Tpo src/$(DEPDIR)/src_libzmq_la-options.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/options.cpp' object='src/src_libzmq_la-options.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-options.lo `test -f 'src/options.cpp' || echo '$(srcdir)/'`src/options.cpp src/src_libzmq_la-own.lo: src/own.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-own.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-own.Tpo -c -o src/src_libzmq_la-own.lo `test -f 'src/own.cpp' || echo '$(srcdir)/'`src/own.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-own.Tpo src/$(DEPDIR)/src_libzmq_la-own.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/own.cpp' object='src/src_libzmq_la-own.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-own.lo `test -f 'src/own.cpp' || echo '$(srcdir)/'`src/own.cpp src/src_libzmq_la-pair.lo: src/pair.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pair.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pair.Tpo -c -o src/src_libzmq_la-pair.lo `test -f 'src/pair.cpp' || echo '$(srcdir)/'`src/pair.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pair.Tpo src/$(DEPDIR)/src_libzmq_la-pair.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pair.cpp' object='src/src_libzmq_la-pair.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pair.lo `test -f 'src/pair.cpp' || echo '$(srcdir)/'`src/pair.cpp src/src_libzmq_la-pgm_receiver.lo: src/pgm_receiver.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pgm_receiver.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pgm_receiver.Tpo -c -o src/src_libzmq_la-pgm_receiver.lo `test -f 'src/pgm_receiver.cpp' || echo '$(srcdir)/'`src/pgm_receiver.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pgm_receiver.Tpo src/$(DEPDIR)/src_libzmq_la-pgm_receiver.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pgm_receiver.cpp' object='src/src_libzmq_la-pgm_receiver.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pgm_receiver.lo `test -f 'src/pgm_receiver.cpp' || echo '$(srcdir)/'`src/pgm_receiver.cpp src/src_libzmq_la-pgm_sender.lo: src/pgm_sender.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pgm_sender.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pgm_sender.Tpo -c -o src/src_libzmq_la-pgm_sender.lo `test -f 'src/pgm_sender.cpp' || echo '$(srcdir)/'`src/pgm_sender.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pgm_sender.Tpo src/$(DEPDIR)/src_libzmq_la-pgm_sender.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pgm_sender.cpp' object='src/src_libzmq_la-pgm_sender.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pgm_sender.lo `test -f 'src/pgm_sender.cpp' || echo '$(srcdir)/'`src/pgm_sender.cpp src/src_libzmq_la-pgm_socket.lo: src/pgm_socket.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pgm_socket.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pgm_socket.Tpo -c -o src/src_libzmq_la-pgm_socket.lo `test -f 'src/pgm_socket.cpp' || echo '$(srcdir)/'`src/pgm_socket.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pgm_socket.Tpo src/$(DEPDIR)/src_libzmq_la-pgm_socket.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pgm_socket.cpp' object='src/src_libzmq_la-pgm_socket.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pgm_socket.lo `test -f 'src/pgm_socket.cpp' || echo '$(srcdir)/'`src/pgm_socket.cpp src/src_libzmq_la-pipe.lo: src/pipe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pipe.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pipe.Tpo -c -o src/src_libzmq_la-pipe.lo `test -f 'src/pipe.cpp' || echo '$(srcdir)/'`src/pipe.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pipe.Tpo src/$(DEPDIR)/src_libzmq_la-pipe.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pipe.cpp' object='src/src_libzmq_la-pipe.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pipe.lo `test -f 'src/pipe.cpp' || echo '$(srcdir)/'`src/pipe.cpp src/src_libzmq_la-plain_client.lo: src/plain_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-plain_client.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-plain_client.Tpo -c -o src/src_libzmq_la-plain_client.lo `test -f 'src/plain_client.cpp' || echo '$(srcdir)/'`src/plain_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-plain_client.Tpo src/$(DEPDIR)/src_libzmq_la-plain_client.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/plain_client.cpp' object='src/src_libzmq_la-plain_client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-plain_client.lo `test -f 'src/plain_client.cpp' || echo '$(srcdir)/'`src/plain_client.cpp src/src_libzmq_la-plain_server.lo: src/plain_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-plain_server.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-plain_server.Tpo -c -o src/src_libzmq_la-plain_server.lo `test -f 'src/plain_server.cpp' || echo '$(srcdir)/'`src/plain_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-plain_server.Tpo src/$(DEPDIR)/src_libzmq_la-plain_server.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/plain_server.cpp' object='src/src_libzmq_la-plain_server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-plain_server.lo `test -f 'src/plain_server.cpp' || echo '$(srcdir)/'`src/plain_server.cpp src/src_libzmq_la-poll.lo: src/poll.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-poll.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-poll.Tpo -c -o src/src_libzmq_la-poll.lo `test -f 'src/poll.cpp' || echo '$(srcdir)/'`src/poll.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-poll.Tpo src/$(DEPDIR)/src_libzmq_la-poll.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/poll.cpp' object='src/src_libzmq_la-poll.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-poll.lo `test -f 'src/poll.cpp' || echo '$(srcdir)/'`src/poll.cpp src/src_libzmq_la-poller_base.lo: src/poller_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-poller_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-poller_base.Tpo -c -o src/src_libzmq_la-poller_base.lo `test -f 'src/poller_base.cpp' || echo '$(srcdir)/'`src/poller_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-poller_base.Tpo src/$(DEPDIR)/src_libzmq_la-poller_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/poller_base.cpp' object='src/src_libzmq_la-poller_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-poller_base.lo `test -f 'src/poller_base.cpp' || echo '$(srcdir)/'`src/poller_base.cpp src/src_libzmq_la-pollset.lo: src/pollset.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pollset.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pollset.Tpo -c -o src/src_libzmq_la-pollset.lo `test -f 'src/pollset.cpp' || echo '$(srcdir)/'`src/pollset.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pollset.Tpo src/$(DEPDIR)/src_libzmq_la-pollset.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pollset.cpp' object='src/src_libzmq_la-pollset.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pollset.lo `test -f 'src/pollset.cpp' || echo '$(srcdir)/'`src/pollset.cpp src/src_libzmq_la-precompiled.lo: src/precompiled.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-precompiled.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-precompiled.Tpo -c -o src/src_libzmq_la-precompiled.lo `test -f 'src/precompiled.cpp' || echo '$(srcdir)/'`src/precompiled.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-precompiled.Tpo src/$(DEPDIR)/src_libzmq_la-precompiled.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/precompiled.cpp' object='src/src_libzmq_la-precompiled.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-precompiled.lo `test -f 'src/precompiled.cpp' || echo '$(srcdir)/'`src/precompiled.cpp src/src_libzmq_la-proxy.lo: src/proxy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-proxy.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-proxy.Tpo -c -o src/src_libzmq_la-proxy.lo `test -f 'src/proxy.cpp' || echo '$(srcdir)/'`src/proxy.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-proxy.Tpo src/$(DEPDIR)/src_libzmq_la-proxy.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/proxy.cpp' object='src/src_libzmq_la-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-proxy.lo `test -f 'src/proxy.cpp' || echo '$(srcdir)/'`src/proxy.cpp src/src_libzmq_la-pub.lo: src/pub.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pub.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pub.Tpo -c -o src/src_libzmq_la-pub.lo `test -f 'src/pub.cpp' || echo '$(srcdir)/'`src/pub.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pub.Tpo src/$(DEPDIR)/src_libzmq_la-pub.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pub.cpp' object='src/src_libzmq_la-pub.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pub.lo `test -f 'src/pub.cpp' || echo '$(srcdir)/'`src/pub.cpp src/src_libzmq_la-pull.lo: src/pull.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-pull.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-pull.Tpo -c -o src/src_libzmq_la-pull.lo `test -f 'src/pull.cpp' || echo '$(srcdir)/'`src/pull.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-pull.Tpo src/$(DEPDIR)/src_libzmq_la-pull.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/pull.cpp' object='src/src_libzmq_la-pull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-pull.lo `test -f 'src/pull.cpp' || echo '$(srcdir)/'`src/pull.cpp src/src_libzmq_la-push.lo: src/push.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-push.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-push.Tpo -c -o src/src_libzmq_la-push.lo `test -f 'src/push.cpp' || echo '$(srcdir)/'`src/push.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-push.Tpo src/$(DEPDIR)/src_libzmq_la-push.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/push.cpp' object='src/src_libzmq_la-push.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-push.lo `test -f 'src/push.cpp' || echo '$(srcdir)/'`src/push.cpp src/src_libzmq_la-radio.lo: src/radio.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-radio.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-radio.Tpo -c -o src/src_libzmq_la-radio.lo `test -f 'src/radio.cpp' || echo '$(srcdir)/'`src/radio.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-radio.Tpo src/$(DEPDIR)/src_libzmq_la-radio.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/radio.cpp' object='src/src_libzmq_la-radio.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-radio.lo `test -f 'src/radio.cpp' || echo '$(srcdir)/'`src/radio.cpp src/src_libzmq_la-random.lo: src/random.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-random.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-random.Tpo -c -o src/src_libzmq_la-random.lo `test -f 'src/random.cpp' || echo '$(srcdir)/'`src/random.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-random.Tpo src/$(DEPDIR)/src_libzmq_la-random.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/random.cpp' object='src/src_libzmq_la-random.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-random.lo `test -f 'src/random.cpp' || echo '$(srcdir)/'`src/random.cpp src/src_libzmq_la-raw_decoder.lo: src/raw_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-raw_decoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-raw_decoder.Tpo -c -o src/src_libzmq_la-raw_decoder.lo `test -f 'src/raw_decoder.cpp' || echo '$(srcdir)/'`src/raw_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-raw_decoder.Tpo src/$(DEPDIR)/src_libzmq_la-raw_decoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/raw_decoder.cpp' object='src/src_libzmq_la-raw_decoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-raw_decoder.lo `test -f 'src/raw_decoder.cpp' || echo '$(srcdir)/'`src/raw_decoder.cpp src/src_libzmq_la-raw_encoder.lo: src/raw_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-raw_encoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-raw_encoder.Tpo -c -o src/src_libzmq_la-raw_encoder.lo `test -f 'src/raw_encoder.cpp' || echo '$(srcdir)/'`src/raw_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-raw_encoder.Tpo src/$(DEPDIR)/src_libzmq_la-raw_encoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/raw_encoder.cpp' object='src/src_libzmq_la-raw_encoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-raw_encoder.lo `test -f 'src/raw_encoder.cpp' || echo '$(srcdir)/'`src/raw_encoder.cpp src/src_libzmq_la-reaper.lo: src/reaper.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-reaper.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-reaper.Tpo -c -o src/src_libzmq_la-reaper.lo `test -f 'src/reaper.cpp' || echo '$(srcdir)/'`src/reaper.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-reaper.Tpo src/$(DEPDIR)/src_libzmq_la-reaper.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/reaper.cpp' object='src/src_libzmq_la-reaper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-reaper.lo `test -f 'src/reaper.cpp' || echo '$(srcdir)/'`src/reaper.cpp src/src_libzmq_la-rep.lo: src/rep.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-rep.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-rep.Tpo -c -o src/src_libzmq_la-rep.lo `test -f 'src/rep.cpp' || echo '$(srcdir)/'`src/rep.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-rep.Tpo src/$(DEPDIR)/src_libzmq_la-rep.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/rep.cpp' object='src/src_libzmq_la-rep.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-rep.lo `test -f 'src/rep.cpp' || echo '$(srcdir)/'`src/rep.cpp src/src_libzmq_la-req.lo: src/req.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-req.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-req.Tpo -c -o src/src_libzmq_la-req.lo `test -f 'src/req.cpp' || echo '$(srcdir)/'`src/req.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-req.Tpo src/$(DEPDIR)/src_libzmq_la-req.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/req.cpp' object='src/src_libzmq_la-req.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-req.lo `test -f 'src/req.cpp' || echo '$(srcdir)/'`src/req.cpp src/src_libzmq_la-router.lo: src/router.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-router.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-router.Tpo -c -o src/src_libzmq_la-router.lo `test -f 'src/router.cpp' || echo '$(srcdir)/'`src/router.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-router.Tpo src/$(DEPDIR)/src_libzmq_la-router.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/router.cpp' object='src/src_libzmq_la-router.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-router.lo `test -f 'src/router.cpp' || echo '$(srcdir)/'`src/router.cpp src/src_libzmq_la-scatter.lo: src/scatter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-scatter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-scatter.Tpo -c -o src/src_libzmq_la-scatter.lo `test -f 'src/scatter.cpp' || echo '$(srcdir)/'`src/scatter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-scatter.Tpo src/$(DEPDIR)/src_libzmq_la-scatter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/scatter.cpp' object='src/src_libzmq_la-scatter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-scatter.lo `test -f 'src/scatter.cpp' || echo '$(srcdir)/'`src/scatter.cpp src/src_libzmq_la-select.lo: src/select.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-select.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-select.Tpo -c -o src/src_libzmq_la-select.lo `test -f 'src/select.cpp' || echo '$(srcdir)/'`src/select.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-select.Tpo src/$(DEPDIR)/src_libzmq_la-select.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/select.cpp' object='src/src_libzmq_la-select.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-select.lo `test -f 'src/select.cpp' || echo '$(srcdir)/'`src/select.cpp src/src_libzmq_la-server.lo: src/server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-server.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-server.Tpo -c -o src/src_libzmq_la-server.lo `test -f 'src/server.cpp' || echo '$(srcdir)/'`src/server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-server.Tpo src/$(DEPDIR)/src_libzmq_la-server.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/server.cpp' object='src/src_libzmq_la-server.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-server.lo `test -f 'src/server.cpp' || echo '$(srcdir)/'`src/server.cpp src/src_libzmq_la-session_base.lo: src/session_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-session_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-session_base.Tpo -c -o src/src_libzmq_la-session_base.lo `test -f 'src/session_base.cpp' || echo '$(srcdir)/'`src/session_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-session_base.Tpo src/$(DEPDIR)/src_libzmq_la-session_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/session_base.cpp' object='src/src_libzmq_la-session_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-session_base.lo `test -f 'src/session_base.cpp' || echo '$(srcdir)/'`src/session_base.cpp src/src_libzmq_la-signaler.lo: src/signaler.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-signaler.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-signaler.Tpo -c -o src/src_libzmq_la-signaler.lo `test -f 'src/signaler.cpp' || echo '$(srcdir)/'`src/signaler.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-signaler.Tpo src/$(DEPDIR)/src_libzmq_la-signaler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/signaler.cpp' object='src/src_libzmq_la-signaler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-signaler.lo `test -f 'src/signaler.cpp' || echo '$(srcdir)/'`src/signaler.cpp src/src_libzmq_la-socket_base.lo: src/socket_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-socket_base.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-socket_base.Tpo -c -o src/src_libzmq_la-socket_base.lo `test -f 'src/socket_base.cpp' || echo '$(srcdir)/'`src/socket_base.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-socket_base.Tpo src/$(DEPDIR)/src_libzmq_la-socket_base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/socket_base.cpp' object='src/src_libzmq_la-socket_base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-socket_base.lo `test -f 'src/socket_base.cpp' || echo '$(srcdir)/'`src/socket_base.cpp src/src_libzmq_la-socks.lo: src/socks.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-socks.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-socks.Tpo -c -o src/src_libzmq_la-socks.lo `test -f 'src/socks.cpp' || echo '$(srcdir)/'`src/socks.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-socks.Tpo src/$(DEPDIR)/src_libzmq_la-socks.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/socks.cpp' object='src/src_libzmq_la-socks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-socks.lo `test -f 'src/socks.cpp' || echo '$(srcdir)/'`src/socks.cpp src/src_libzmq_la-socks_connecter.lo: src/socks_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-socks_connecter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-socks_connecter.Tpo -c -o src/src_libzmq_la-socks_connecter.lo `test -f 'src/socks_connecter.cpp' || echo '$(srcdir)/'`src/socks_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-socks_connecter.Tpo src/$(DEPDIR)/src_libzmq_la-socks_connecter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/socks_connecter.cpp' object='src/src_libzmq_la-socks_connecter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-socks_connecter.lo `test -f 'src/socks_connecter.cpp' || echo '$(srcdir)/'`src/socks_connecter.cpp src/src_libzmq_la-stream.lo: src/stream.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-stream.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-stream.Tpo -c -o src/src_libzmq_la-stream.lo `test -f 'src/stream.cpp' || echo '$(srcdir)/'`src/stream.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-stream.Tpo src/$(DEPDIR)/src_libzmq_la-stream.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/stream.cpp' object='src/src_libzmq_la-stream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-stream.lo `test -f 'src/stream.cpp' || echo '$(srcdir)/'`src/stream.cpp src/src_libzmq_la-stream_engine.lo: src/stream_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-stream_engine.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-stream_engine.Tpo -c -o src/src_libzmq_la-stream_engine.lo `test -f 'src/stream_engine.cpp' || echo '$(srcdir)/'`src/stream_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-stream_engine.Tpo src/$(DEPDIR)/src_libzmq_la-stream_engine.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/stream_engine.cpp' object='src/src_libzmq_la-stream_engine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-stream_engine.lo `test -f 'src/stream_engine.cpp' || echo '$(srcdir)/'`src/stream_engine.cpp src/src_libzmq_la-sub.lo: src/sub.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-sub.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-sub.Tpo -c -o src/src_libzmq_la-sub.lo `test -f 'src/sub.cpp' || echo '$(srcdir)/'`src/sub.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-sub.Tpo src/$(DEPDIR)/src_libzmq_la-sub.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/sub.cpp' object='src/src_libzmq_la-sub.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-sub.lo `test -f 'src/sub.cpp' || echo '$(srcdir)/'`src/sub.cpp src/src_libzmq_la-tcp.lo: src/tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tcp.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tcp.Tpo -c -o src/src_libzmq_la-tcp.lo `test -f 'src/tcp.cpp' || echo '$(srcdir)/'`src/tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tcp.Tpo src/$(DEPDIR)/src_libzmq_la-tcp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tcp.cpp' object='src/src_libzmq_la-tcp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tcp.lo `test -f 'src/tcp.cpp' || echo '$(srcdir)/'`src/tcp.cpp src/src_libzmq_la-tcp_address.lo: src/tcp_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tcp_address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tcp_address.Tpo -c -o src/src_libzmq_la-tcp_address.lo `test -f 'src/tcp_address.cpp' || echo '$(srcdir)/'`src/tcp_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tcp_address.Tpo src/$(DEPDIR)/src_libzmq_la-tcp_address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tcp_address.cpp' object='src/src_libzmq_la-tcp_address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tcp_address.lo `test -f 'src/tcp_address.cpp' || echo '$(srcdir)/'`src/tcp_address.cpp src/src_libzmq_la-tcp_connecter.lo: src/tcp_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tcp_connecter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tcp_connecter.Tpo -c -o src/src_libzmq_la-tcp_connecter.lo `test -f 'src/tcp_connecter.cpp' || echo '$(srcdir)/'`src/tcp_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tcp_connecter.Tpo src/$(DEPDIR)/src_libzmq_la-tcp_connecter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tcp_connecter.cpp' object='src/src_libzmq_la-tcp_connecter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tcp_connecter.lo `test -f 'src/tcp_connecter.cpp' || echo '$(srcdir)/'`src/tcp_connecter.cpp src/src_libzmq_la-tcp_listener.lo: src/tcp_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tcp_listener.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tcp_listener.Tpo -c -o src/src_libzmq_la-tcp_listener.lo `test -f 'src/tcp_listener.cpp' || echo '$(srcdir)/'`src/tcp_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tcp_listener.Tpo src/$(DEPDIR)/src_libzmq_la-tcp_listener.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tcp_listener.cpp' object='src/src_libzmq_la-tcp_listener.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tcp_listener.lo `test -f 'src/tcp_listener.cpp' || echo '$(srcdir)/'`src/tcp_listener.cpp src/src_libzmq_la-thread.lo: src/thread.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-thread.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-thread.Tpo -c -o src/src_libzmq_la-thread.lo `test -f 'src/thread.cpp' || echo '$(srcdir)/'`src/thread.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-thread.Tpo src/$(DEPDIR)/src_libzmq_la-thread.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/thread.cpp' object='src/src_libzmq_la-thread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-thread.lo `test -f 'src/thread.cpp' || echo '$(srcdir)/'`src/thread.cpp src/src_libzmq_la-timers.lo: src/timers.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-timers.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-timers.Tpo -c -o src/src_libzmq_la-timers.lo `test -f 'src/timers.cpp' || echo '$(srcdir)/'`src/timers.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-timers.Tpo src/$(DEPDIR)/src_libzmq_la-timers.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/timers.cpp' object='src/src_libzmq_la-timers.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-timers.lo `test -f 'src/timers.cpp' || echo '$(srcdir)/'`src/timers.cpp src/src_libzmq_la-tipc_address.lo: src/tipc_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tipc_address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tipc_address.Tpo -c -o src/src_libzmq_la-tipc_address.lo `test -f 'src/tipc_address.cpp' || echo '$(srcdir)/'`src/tipc_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tipc_address.Tpo src/$(DEPDIR)/src_libzmq_la-tipc_address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tipc_address.cpp' object='src/src_libzmq_la-tipc_address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tipc_address.lo `test -f 'src/tipc_address.cpp' || echo '$(srcdir)/'`src/tipc_address.cpp src/src_libzmq_la-tipc_connecter.lo: src/tipc_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tipc_connecter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tipc_connecter.Tpo -c -o src/src_libzmq_la-tipc_connecter.lo `test -f 'src/tipc_connecter.cpp' || echo '$(srcdir)/'`src/tipc_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tipc_connecter.Tpo src/$(DEPDIR)/src_libzmq_la-tipc_connecter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tipc_connecter.cpp' object='src/src_libzmq_la-tipc_connecter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tipc_connecter.lo `test -f 'src/tipc_connecter.cpp' || echo '$(srcdir)/'`src/tipc_connecter.cpp src/src_libzmq_la-tipc_listener.lo: src/tipc_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-tipc_listener.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-tipc_listener.Tpo -c -o src/src_libzmq_la-tipc_listener.lo `test -f 'src/tipc_listener.cpp' || echo '$(srcdir)/'`src/tipc_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-tipc_listener.Tpo src/$(DEPDIR)/src_libzmq_la-tipc_listener.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tipc_listener.cpp' object='src/src_libzmq_la-tipc_listener.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-tipc_listener.lo `test -f 'src/tipc_listener.cpp' || echo '$(srcdir)/'`src/tipc_listener.cpp src/src_libzmq_la-trie.lo: src/trie.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-trie.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-trie.Tpo -c -o src/src_libzmq_la-trie.lo `test -f 'src/trie.cpp' || echo '$(srcdir)/'`src/trie.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-trie.Tpo src/$(DEPDIR)/src_libzmq_la-trie.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/trie.cpp' object='src/src_libzmq_la-trie.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-trie.lo `test -f 'src/trie.cpp' || echo '$(srcdir)/'`src/trie.cpp src/src_libzmq_la-udp_address.lo: src/udp_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-udp_address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-udp_address.Tpo -c -o src/src_libzmq_la-udp_address.lo `test -f 'src/udp_address.cpp' || echo '$(srcdir)/'`src/udp_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-udp_address.Tpo src/$(DEPDIR)/src_libzmq_la-udp_address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/udp_address.cpp' object='src/src_libzmq_la-udp_address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-udp_address.lo `test -f 'src/udp_address.cpp' || echo '$(srcdir)/'`src/udp_address.cpp src/src_libzmq_la-udp_engine.lo: src/udp_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-udp_engine.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-udp_engine.Tpo -c -o src/src_libzmq_la-udp_engine.lo `test -f 'src/udp_engine.cpp' || echo '$(srcdir)/'`src/udp_engine.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-udp_engine.Tpo src/$(DEPDIR)/src_libzmq_la-udp_engine.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/udp_engine.cpp' object='src/src_libzmq_la-udp_engine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-udp_engine.lo `test -f 'src/udp_engine.cpp' || echo '$(srcdir)/'`src/udp_engine.cpp src/src_libzmq_la-v1_decoder.lo: src/v1_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-v1_decoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-v1_decoder.Tpo -c -o src/src_libzmq_la-v1_decoder.lo `test -f 'src/v1_decoder.cpp' || echo '$(srcdir)/'`src/v1_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-v1_decoder.Tpo src/$(DEPDIR)/src_libzmq_la-v1_decoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/v1_decoder.cpp' object='src/src_libzmq_la-v1_decoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-v1_decoder.lo `test -f 'src/v1_decoder.cpp' || echo '$(srcdir)/'`src/v1_decoder.cpp src/src_libzmq_la-v2_decoder.lo: src/v2_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-v2_decoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-v2_decoder.Tpo -c -o src/src_libzmq_la-v2_decoder.lo `test -f 'src/v2_decoder.cpp' || echo '$(srcdir)/'`src/v2_decoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-v2_decoder.Tpo src/$(DEPDIR)/src_libzmq_la-v2_decoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/v2_decoder.cpp' object='src/src_libzmq_la-v2_decoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-v2_decoder.lo `test -f 'src/v2_decoder.cpp' || echo '$(srcdir)/'`src/v2_decoder.cpp src/src_libzmq_la-v1_encoder.lo: src/v1_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-v1_encoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-v1_encoder.Tpo -c -o src/src_libzmq_la-v1_encoder.lo `test -f 'src/v1_encoder.cpp' || echo '$(srcdir)/'`src/v1_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-v1_encoder.Tpo src/$(DEPDIR)/src_libzmq_la-v1_encoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/v1_encoder.cpp' object='src/src_libzmq_la-v1_encoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-v1_encoder.lo `test -f 'src/v1_encoder.cpp' || echo '$(srcdir)/'`src/v1_encoder.cpp src/src_libzmq_la-v2_encoder.lo: src/v2_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-v2_encoder.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-v2_encoder.Tpo -c -o src/src_libzmq_la-v2_encoder.lo `test -f 'src/v2_encoder.cpp' || echo '$(srcdir)/'`src/v2_encoder.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-v2_encoder.Tpo src/$(DEPDIR)/src_libzmq_la-v2_encoder.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/v2_encoder.cpp' object='src/src_libzmq_la-v2_encoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-v2_encoder.lo `test -f 'src/v2_encoder.cpp' || echo '$(srcdir)/'`src/v2_encoder.cpp src/src_libzmq_la-vmci.lo: src/vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-vmci.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-vmci.Tpo -c -o src/src_libzmq_la-vmci.lo `test -f 'src/vmci.cpp' || echo '$(srcdir)/'`src/vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-vmci.Tpo src/$(DEPDIR)/src_libzmq_la-vmci.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/vmci.cpp' object='src/src_libzmq_la-vmci.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-vmci.lo `test -f 'src/vmci.cpp' || echo '$(srcdir)/'`src/vmci.cpp src/src_libzmq_la-vmci_address.lo: src/vmci_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-vmci_address.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-vmci_address.Tpo -c -o src/src_libzmq_la-vmci_address.lo `test -f 'src/vmci_address.cpp' || echo '$(srcdir)/'`src/vmci_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-vmci_address.Tpo src/$(DEPDIR)/src_libzmq_la-vmci_address.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/vmci_address.cpp' object='src/src_libzmq_la-vmci_address.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-vmci_address.lo `test -f 'src/vmci_address.cpp' || echo '$(srcdir)/'`src/vmci_address.cpp src/src_libzmq_la-vmci_connecter.lo: src/vmci_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-vmci_connecter.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-vmci_connecter.Tpo -c -o src/src_libzmq_la-vmci_connecter.lo `test -f 'src/vmci_connecter.cpp' || echo '$(srcdir)/'`src/vmci_connecter.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-vmci_connecter.Tpo src/$(DEPDIR)/src_libzmq_la-vmci_connecter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/vmci_connecter.cpp' object='src/src_libzmq_la-vmci_connecter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-vmci_connecter.lo `test -f 'src/vmci_connecter.cpp' || echo '$(srcdir)/'`src/vmci_connecter.cpp src/src_libzmq_la-vmci_listener.lo: src/vmci_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-vmci_listener.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-vmci_listener.Tpo -c -o src/src_libzmq_la-vmci_listener.lo `test -f 'src/vmci_listener.cpp' || echo '$(srcdir)/'`src/vmci_listener.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-vmci_listener.Tpo src/$(DEPDIR)/src_libzmq_la-vmci_listener.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/vmci_listener.cpp' object='src/src_libzmq_la-vmci_listener.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-vmci_listener.lo `test -f 'src/vmci_listener.cpp' || echo '$(srcdir)/'`src/vmci_listener.cpp src/src_libzmq_la-xpub.lo: src/xpub.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-xpub.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-xpub.Tpo -c -o src/src_libzmq_la-xpub.lo `test -f 'src/xpub.cpp' || echo '$(srcdir)/'`src/xpub.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-xpub.Tpo src/$(DEPDIR)/src_libzmq_la-xpub.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/xpub.cpp' object='src/src_libzmq_la-xpub.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-xpub.lo `test -f 'src/xpub.cpp' || echo '$(srcdir)/'`src/xpub.cpp src/src_libzmq_la-xsub.lo: src/xsub.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-xsub.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-xsub.Tpo -c -o src/src_libzmq_la-xsub.lo `test -f 'src/xsub.cpp' || echo '$(srcdir)/'`src/xsub.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-xsub.Tpo src/$(DEPDIR)/src_libzmq_la-xsub.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/xsub.cpp' object='src/src_libzmq_la-xsub.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-xsub.lo `test -f 'src/xsub.cpp' || echo '$(srcdir)/'`src/xsub.cpp src/src_libzmq_la-zmq.lo: src/zmq.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-zmq.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-zmq.Tpo -c -o src/src_libzmq_la-zmq.lo `test -f 'src/zmq.cpp' || echo '$(srcdir)/'`src/zmq.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-zmq.Tpo src/$(DEPDIR)/src_libzmq_la-zmq.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/zmq.cpp' object='src/src_libzmq_la-zmq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-zmq.lo `test -f 'src/zmq.cpp' || echo '$(srcdir)/'`src/zmq.cpp src/src_libzmq_la-zmq_utils.lo: src/zmq_utils.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-zmq_utils.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-zmq_utils.Tpo -c -o src/src_libzmq_la-zmq_utils.lo `test -f 'src/zmq_utils.cpp' || echo '$(srcdir)/'`src/zmq_utils.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-zmq_utils.Tpo src/$(DEPDIR)/src_libzmq_la-zmq_utils.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/zmq_utils.cpp' object='src/src_libzmq_la-zmq_utils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-zmq_utils.lo `test -f 'src/zmq_utils.cpp' || echo '$(srcdir)/'`src/zmq_utils.cpp src/src_libzmq_la-decoder_allocators.lo: src/decoder_allocators.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-decoder_allocators.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-decoder_allocators.Tpo -c -o src/src_libzmq_la-decoder_allocators.lo `test -f 'src/decoder_allocators.cpp' || echo '$(srcdir)/'`src/decoder_allocators.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-decoder_allocators.Tpo src/$(DEPDIR)/src_libzmq_la-decoder_allocators.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/decoder_allocators.cpp' object='src/src_libzmq_la-decoder_allocators.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-decoder_allocators.lo `test -f 'src/decoder_allocators.cpp' || echo '$(srcdir)/'`src/decoder_allocators.cpp src/src_libzmq_la-socket_poller.lo: src/socket_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-socket_poller.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-socket_poller.Tpo -c -o src/src_libzmq_la-socket_poller.lo `test -f 'src/socket_poller.cpp' || echo '$(srcdir)/'`src/socket_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-socket_poller.Tpo src/$(DEPDIR)/src_libzmq_la-socket_poller.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/socket_poller.cpp' object='src/src_libzmq_la-socket_poller.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-socket_poller.lo `test -f 'src/socket_poller.cpp' || echo '$(srcdir)/'`src/socket_poller.cpp src/src_libzmq_la-zap_client.lo: src/zap_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -MT src/src_libzmq_la-zap_client.lo -MD -MP -MF src/$(DEPDIR)/src_libzmq_la-zap_client.Tpo -c -o src/src_libzmq_la-zap_client.lo `test -f 'src/zap_client.cpp' || echo '$(srcdir)/'`src/zap_client.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/src_libzmq_la-zap_client.Tpo src/$(DEPDIR)/src_libzmq_la-zap_client.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/zap_client.cpp' object='src/src_libzmq_la-zap_client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_libzmq_la_CPPFLAGS) $(CPPFLAGS) $(src_libzmq_la_CXXFLAGS) $(CXXFLAGS) -c -o src/src_libzmq_la-zap_client.lo `test -f 'src/zap_client.cpp' || echo '$(srcdir)/'`src/zap_client.cpp tests/test_pair_vmci-test_pair_vmci.o: tests/test_pair_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pair_vmci_CXXFLAGS) $(CXXFLAGS) -MT tests/test_pair_vmci-test_pair_vmci.o -MD -MP -MF tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Tpo -c -o tests/test_pair_vmci-test_pair_vmci.o `test -f 'tests/test_pair_vmci.cpp' || echo '$(srcdir)/'`tests/test_pair_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Tpo tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_pair_vmci.cpp' object='tests/test_pair_vmci-test_pair_vmci.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pair_vmci_CXXFLAGS) $(CXXFLAGS) -c -o tests/test_pair_vmci-test_pair_vmci.o `test -f 'tests/test_pair_vmci.cpp' || echo '$(srcdir)/'`tests/test_pair_vmci.cpp tests/test_pair_vmci-test_pair_vmci.obj: tests/test_pair_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pair_vmci_CXXFLAGS) $(CXXFLAGS) -MT tests/test_pair_vmci-test_pair_vmci.obj -MD -MP -MF tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Tpo -c -o tests/test_pair_vmci-test_pair_vmci.obj `if test -f 'tests/test_pair_vmci.cpp'; then $(CYGPATH_W) 'tests/test_pair_vmci.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_pair_vmci.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Tpo tests/$(DEPDIR)/test_pair_vmci-test_pair_vmci.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_pair_vmci.cpp' object='tests/test_pair_vmci-test_pair_vmci.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_pair_vmci_CXXFLAGS) $(CXXFLAGS) -c -o tests/test_pair_vmci-test_pair_vmci.obj `if test -f 'tests/test_pair_vmci.cpp'; then $(CYGPATH_W) 'tests/test_pair_vmci.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_pair_vmci.cpp'; fi` tests/test_reqrep_vmci-test_reqrep_vmci.o: tests/test_reqrep_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_reqrep_vmci_CXXFLAGS) $(CXXFLAGS) -MT tests/test_reqrep_vmci-test_reqrep_vmci.o -MD -MP -MF tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Tpo -c -o tests/test_reqrep_vmci-test_reqrep_vmci.o `test -f 'tests/test_reqrep_vmci.cpp' || echo '$(srcdir)/'`tests/test_reqrep_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Tpo tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reqrep_vmci.cpp' object='tests/test_reqrep_vmci-test_reqrep_vmci.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_reqrep_vmci_CXXFLAGS) $(CXXFLAGS) -c -o tests/test_reqrep_vmci-test_reqrep_vmci.o `test -f 'tests/test_reqrep_vmci.cpp' || echo '$(srcdir)/'`tests/test_reqrep_vmci.cpp tests/test_reqrep_vmci-test_reqrep_vmci.obj: tests/test_reqrep_vmci.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_reqrep_vmci_CXXFLAGS) $(CXXFLAGS) -MT tests/test_reqrep_vmci-test_reqrep_vmci.obj -MD -MP -MF tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Tpo -c -o tests/test_reqrep_vmci-test_reqrep_vmci.obj `if test -f 'tests/test_reqrep_vmci.cpp'; then $(CYGPATH_W) 'tests/test_reqrep_vmci.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reqrep_vmci.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Tpo tests/$(DEPDIR)/test_reqrep_vmci-test_reqrep_vmci.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reqrep_vmci.cpp' object='tests/test_reqrep_vmci-test_reqrep_vmci.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_reqrep_vmci_CXXFLAGS) $(CXXFLAGS) -c -o tests/test_reqrep_vmci-test_reqrep_vmci.obj `if test -f 'tests/test_reqrep_vmci.cpp'; then $(CYGPATH_W) 'tests/test_reqrep_vmci.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reqrep_vmci.cpp'; fi` tests/tests_test_address_tipc-test_address_tipc.o: tests/test_address_tipc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_address_tipc_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_address_tipc-test_address_tipc.o -MD -MP -MF tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Tpo -c -o tests/tests_test_address_tipc-test_address_tipc.o `test -f 'tests/test_address_tipc.cpp' || echo '$(srcdir)/'`tests/test_address_tipc.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Tpo tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_address_tipc.cpp' object='tests/tests_test_address_tipc-test_address_tipc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_address_tipc_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_address_tipc-test_address_tipc.o `test -f 'tests/test_address_tipc.cpp' || echo '$(srcdir)/'`tests/test_address_tipc.cpp tests/tests_test_address_tipc-test_address_tipc.obj: tests/test_address_tipc.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_address_tipc_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_address_tipc-test_address_tipc.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Tpo -c -o tests/tests_test_address_tipc-test_address_tipc.obj `if test -f 'tests/test_address_tipc.cpp'; then $(CYGPATH_W) 'tests/test_address_tipc.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_address_tipc.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Tpo tests/$(DEPDIR)/tests_test_address_tipc-test_address_tipc.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_address_tipc.cpp' object='tests/tests_test_address_tipc-test_address_tipc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_address_tipc_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_address_tipc-test_address_tipc.obj `if test -f 'tests/test_address_tipc.cpp'; then $(CYGPATH_W) 'tests/test_address_tipc.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_address_tipc.cpp'; fi` tests/tests_test_app_meta-test_app_meta.o: tests/test_app_meta.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_app_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_app_meta-test_app_meta.o -MD -MP -MF tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Tpo -c -o tests/tests_test_app_meta-test_app_meta.o `test -f 'tests/test_app_meta.cpp' || echo '$(srcdir)/'`tests/test_app_meta.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Tpo tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_app_meta.cpp' object='tests/tests_test_app_meta-test_app_meta.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_app_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_app_meta-test_app_meta.o `test -f 'tests/test_app_meta.cpp' || echo '$(srcdir)/'`tests/test_app_meta.cpp tests/tests_test_app_meta-test_app_meta.obj: tests/test_app_meta.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_app_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_app_meta-test_app_meta.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Tpo -c -o tests/tests_test_app_meta-test_app_meta.obj `if test -f 'tests/test_app_meta.cpp'; then $(CYGPATH_W) 'tests/test_app_meta.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_app_meta.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Tpo tests/$(DEPDIR)/tests_test_app_meta-test_app_meta.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_app_meta.cpp' object='tests/tests_test_app_meta-test_app_meta.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_app_meta_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_app_meta-test_app_meta.obj `if test -f 'tests/test_app_meta.cpp'; then $(CYGPATH_W) 'tests/test_app_meta.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_app_meta.cpp'; fi` tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.o: tests/test_bind_after_connect_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_after_connect_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.o -MD -MP -MF tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Tpo -c -o tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.o `test -f 'tests/test_bind_after_connect_tcp.cpp' || echo '$(srcdir)/'`tests/test_bind_after_connect_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Tpo tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_bind_after_connect_tcp.cpp' object='tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_after_connect_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.o `test -f 'tests/test_bind_after_connect_tcp.cpp' || echo '$(srcdir)/'`tests/test_bind_after_connect_tcp.cpp tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.obj: tests/test_bind_after_connect_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_after_connect_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Tpo -c -o tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.obj `if test -f 'tests/test_bind_after_connect_tcp.cpp'; then $(CYGPATH_W) 'tests/test_bind_after_connect_tcp.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_bind_after_connect_tcp.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Tpo tests/$(DEPDIR)/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_bind_after_connect_tcp.cpp' object='tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_after_connect_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_bind_after_connect_tcp-test_bind_after_connect_tcp.obj `if test -f 'tests/test_bind_after_connect_tcp.cpp'; then $(CYGPATH_W) 'tests/test_bind_after_connect_tcp.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_bind_after_connect_tcp.cpp'; fi` tests/tests_test_bind_src_address-test_bind_src_address.o: tests/test_bind_src_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_src_address_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_bind_src_address-test_bind_src_address.o -MD -MP -MF tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Tpo -c -o tests/tests_test_bind_src_address-test_bind_src_address.o `test -f 'tests/test_bind_src_address.cpp' || echo '$(srcdir)/'`tests/test_bind_src_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Tpo tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_bind_src_address.cpp' object='tests/tests_test_bind_src_address-test_bind_src_address.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_src_address_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_bind_src_address-test_bind_src_address.o `test -f 'tests/test_bind_src_address.cpp' || echo '$(srcdir)/'`tests/test_bind_src_address.cpp tests/tests_test_bind_src_address-test_bind_src_address.obj: tests/test_bind_src_address.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_src_address_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_bind_src_address-test_bind_src_address.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Tpo -c -o tests/tests_test_bind_src_address-test_bind_src_address.obj `if test -f 'tests/test_bind_src_address.cpp'; then $(CYGPATH_W) 'tests/test_bind_src_address.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_bind_src_address.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Tpo tests/$(DEPDIR)/tests_test_bind_src_address-test_bind_src_address.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_bind_src_address.cpp' object='tests/tests_test_bind_src_address-test_bind_src_address.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_bind_src_address_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_bind_src_address-test_bind_src_address.obj `if test -f 'tests/test_bind_src_address.cpp'; then $(CYGPATH_W) 'tests/test_bind_src_address.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_bind_src_address.cpp'; fi` tests/tests_test_client_server-test_client_server.o: tests/test_client_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_client_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_client_server-test_client_server.o -MD -MP -MF tests/$(DEPDIR)/tests_test_client_server-test_client_server.Tpo -c -o tests/tests_test_client_server-test_client_server.o `test -f 'tests/test_client_server.cpp' || echo '$(srcdir)/'`tests/test_client_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_client_server-test_client_server.Tpo tests/$(DEPDIR)/tests_test_client_server-test_client_server.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_client_server.cpp' object='tests/tests_test_client_server-test_client_server.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_client_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_client_server-test_client_server.o `test -f 'tests/test_client_server.cpp' || echo '$(srcdir)/'`tests/test_client_server.cpp tests/tests_test_client_server-test_client_server.obj: tests/test_client_server.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_client_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_client_server-test_client_server.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_client_server-test_client_server.Tpo -c -o tests/tests_test_client_server-test_client_server.obj `if test -f 'tests/test_client_server.cpp'; then $(CYGPATH_W) 'tests/test_client_server.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_client_server.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_client_server-test_client_server.Tpo tests/$(DEPDIR)/tests_test_client_server-test_client_server.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_client_server.cpp' object='tests/tests_test_client_server-test_client_server.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_client_server_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_client_server-test_client_server.obj `if test -f 'tests/test_client_server.cpp'; then $(CYGPATH_W) 'tests/test_client_server.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_client_server.cpp'; fi` tests/tests_test_conflate-test_conflate.o: tests/test_conflate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_conflate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_conflate-test_conflate.o -MD -MP -MF tests/$(DEPDIR)/tests_test_conflate-test_conflate.Tpo -c -o tests/tests_test_conflate-test_conflate.o `test -f 'tests/test_conflate.cpp' || echo '$(srcdir)/'`tests/test_conflate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_conflate-test_conflate.Tpo tests/$(DEPDIR)/tests_test_conflate-test_conflate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_conflate.cpp' object='tests/tests_test_conflate-test_conflate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_conflate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_conflate-test_conflate.o `test -f 'tests/test_conflate.cpp' || echo '$(srcdir)/'`tests/test_conflate.cpp tests/tests_test_conflate-test_conflate.obj: tests/test_conflate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_conflate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_conflate-test_conflate.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_conflate-test_conflate.Tpo -c -o tests/tests_test_conflate-test_conflate.obj `if test -f 'tests/test_conflate.cpp'; then $(CYGPATH_W) 'tests/test_conflate.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_conflate.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_conflate-test_conflate.Tpo tests/$(DEPDIR)/tests_test_conflate-test_conflate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_conflate.cpp' object='tests/tests_test_conflate-test_conflate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_conflate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_conflate-test_conflate.obj `if test -f 'tests/test_conflate.cpp'; then $(CYGPATH_W) 'tests/test_conflate.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_conflate.cpp'; fi` tests/tests_test_connect_resolve-test_connect_resolve.o: tests/test_connect_resolve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_connect_resolve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_connect_resolve-test_connect_resolve.o -MD -MP -MF tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Tpo -c -o tests/tests_test_connect_resolve-test_connect_resolve.o `test -f 'tests/test_connect_resolve.cpp' || echo '$(srcdir)/'`tests/test_connect_resolve.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Tpo tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_connect_resolve.cpp' object='tests/tests_test_connect_resolve-test_connect_resolve.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_connect_resolve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_connect_resolve-test_connect_resolve.o `test -f 'tests/test_connect_resolve.cpp' || echo '$(srcdir)/'`tests/test_connect_resolve.cpp tests/tests_test_connect_resolve-test_connect_resolve.obj: tests/test_connect_resolve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_connect_resolve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_connect_resolve-test_connect_resolve.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Tpo -c -o tests/tests_test_connect_resolve-test_connect_resolve.obj `if test -f 'tests/test_connect_resolve.cpp'; then $(CYGPATH_W) 'tests/test_connect_resolve.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_connect_resolve.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Tpo tests/$(DEPDIR)/tests_test_connect_resolve-test_connect_resolve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_connect_resolve.cpp' object='tests/tests_test_connect_resolve-test_connect_resolve.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_connect_resolve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_connect_resolve-test_connect_resolve.obj `if test -f 'tests/test_connect_resolve.cpp'; then $(CYGPATH_W) 'tests/test_connect_resolve.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_connect_resolve.cpp'; fi` tests/tests_test_ctx_destroy-test_ctx_destroy.o: tests/test_ctx_destroy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_ctx_destroy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_ctx_destroy-test_ctx_destroy.o -MD -MP -MF tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Tpo -c -o tests/tests_test_ctx_destroy-test_ctx_destroy.o `test -f 'tests/test_ctx_destroy.cpp' || echo '$(srcdir)/'`tests/test_ctx_destroy.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Tpo tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_ctx_destroy.cpp' object='tests/tests_test_ctx_destroy-test_ctx_destroy.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_ctx_destroy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_ctx_destroy-test_ctx_destroy.o `test -f 'tests/test_ctx_destroy.cpp' || echo '$(srcdir)/'`tests/test_ctx_destroy.cpp tests/tests_test_ctx_destroy-test_ctx_destroy.obj: tests/test_ctx_destroy.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_ctx_destroy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_ctx_destroy-test_ctx_destroy.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Tpo -c -o tests/tests_test_ctx_destroy-test_ctx_destroy.obj `if test -f 'tests/test_ctx_destroy.cpp'; then $(CYGPATH_W) 'tests/test_ctx_destroy.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_ctx_destroy.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Tpo tests/$(DEPDIR)/tests_test_ctx_destroy-test_ctx_destroy.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_ctx_destroy.cpp' object='tests/tests_test_ctx_destroy-test_ctx_destroy.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_ctx_destroy_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_ctx_destroy-test_ctx_destroy.obj `if test -f 'tests/test_ctx_destroy.cpp'; then $(CYGPATH_W) 'tests/test_ctx_destroy.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_ctx_destroy.cpp'; fi` tests/tests_test_hwm-test_hwm.o: tests/test_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_hwm-test_hwm.o -MD -MP -MF tests/$(DEPDIR)/tests_test_hwm-test_hwm.Tpo -c -o tests/tests_test_hwm-test_hwm.o `test -f 'tests/test_hwm.cpp' || echo '$(srcdir)/'`tests/test_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_hwm-test_hwm.Tpo tests/$(DEPDIR)/tests_test_hwm-test_hwm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_hwm.cpp' object='tests/tests_test_hwm-test_hwm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_hwm-test_hwm.o `test -f 'tests/test_hwm.cpp' || echo '$(srcdir)/'`tests/test_hwm.cpp tests/tests_test_hwm-test_hwm.obj: tests/test_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_hwm-test_hwm.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_hwm-test_hwm.Tpo -c -o tests/tests_test_hwm-test_hwm.obj `if test -f 'tests/test_hwm.cpp'; then $(CYGPATH_W) 'tests/test_hwm.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_hwm.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_hwm-test_hwm.Tpo tests/$(DEPDIR)/tests_test_hwm-test_hwm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_hwm.cpp' object='tests/tests_test_hwm-test_hwm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_hwm-test_hwm.obj `if test -f 'tests/test_hwm.cpp'; then $(CYGPATH_W) 'tests/test_hwm.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_hwm.cpp'; fi` tests/tests_test_immediate-test_immediate.o: tests/test_immediate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_immediate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_immediate-test_immediate.o -MD -MP -MF tests/$(DEPDIR)/tests_test_immediate-test_immediate.Tpo -c -o tests/tests_test_immediate-test_immediate.o `test -f 'tests/test_immediate.cpp' || echo '$(srcdir)/'`tests/test_immediate.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_immediate-test_immediate.Tpo tests/$(DEPDIR)/tests_test_immediate-test_immediate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_immediate.cpp' object='tests/tests_test_immediate-test_immediate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_immediate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_immediate-test_immediate.o `test -f 'tests/test_immediate.cpp' || echo '$(srcdir)/'`tests/test_immediate.cpp tests/tests_test_immediate-test_immediate.obj: tests/test_immediate.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_immediate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_immediate-test_immediate.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_immediate-test_immediate.Tpo -c -o tests/tests_test_immediate-test_immediate.obj `if test -f 'tests/test_immediate.cpp'; then $(CYGPATH_W) 'tests/test_immediate.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_immediate.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_immediate-test_immediate.Tpo tests/$(DEPDIR)/tests_test_immediate-test_immediate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_immediate.cpp' object='tests/tests_test_immediate-test_immediate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_immediate_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_immediate-test_immediate.obj `if test -f 'tests/test_immediate.cpp'; then $(CYGPATH_W) 'tests/test_immediate.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_immediate.cpp'; fi` tests/tests_test_last_endpoint-test_last_endpoint.o: tests/test_last_endpoint.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_last_endpoint_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_last_endpoint-test_last_endpoint.o -MD -MP -MF tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Tpo -c -o tests/tests_test_last_endpoint-test_last_endpoint.o `test -f 'tests/test_last_endpoint.cpp' || echo '$(srcdir)/'`tests/test_last_endpoint.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Tpo tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_last_endpoint.cpp' object='tests/tests_test_last_endpoint-test_last_endpoint.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_last_endpoint_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_last_endpoint-test_last_endpoint.o `test -f 'tests/test_last_endpoint.cpp' || echo '$(srcdir)/'`tests/test_last_endpoint.cpp tests/tests_test_last_endpoint-test_last_endpoint.obj: tests/test_last_endpoint.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_last_endpoint_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_last_endpoint-test_last_endpoint.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Tpo -c -o tests/tests_test_last_endpoint-test_last_endpoint.obj `if test -f 'tests/test_last_endpoint.cpp'; then $(CYGPATH_W) 'tests/test_last_endpoint.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_last_endpoint.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Tpo tests/$(DEPDIR)/tests_test_last_endpoint-test_last_endpoint.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_last_endpoint.cpp' object='tests/tests_test_last_endpoint-test_last_endpoint.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_last_endpoint_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_last_endpoint-test_last_endpoint.obj `if test -f 'tests/test_last_endpoint.cpp'; then $(CYGPATH_W) 'tests/test_last_endpoint.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_last_endpoint.cpp'; fi` tests/tests_test_poller-test_poller.o: tests/test_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_poller_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_poller-test_poller.o -MD -MP -MF tests/$(DEPDIR)/tests_test_poller-test_poller.Tpo -c -o tests/tests_test_poller-test_poller.o `test -f 'tests/test_poller.cpp' || echo '$(srcdir)/'`tests/test_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_poller-test_poller.Tpo tests/$(DEPDIR)/tests_test_poller-test_poller.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_poller.cpp' object='tests/tests_test_poller-test_poller.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_poller_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_poller-test_poller.o `test -f 'tests/test_poller.cpp' || echo '$(srcdir)/'`tests/test_poller.cpp tests/tests_test_poller-test_poller.obj: tests/test_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_poller_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_poller-test_poller.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_poller-test_poller.Tpo -c -o tests/tests_test_poller-test_poller.obj `if test -f 'tests/test_poller.cpp'; then $(CYGPATH_W) 'tests/test_poller.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_poller.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_poller-test_poller.Tpo tests/$(DEPDIR)/tests_test_poller-test_poller.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_poller.cpp' object='tests/tests_test_poller-test_poller.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_poller_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_poller-test_poller.obj `if test -f 'tests/test_poller.cpp'; then $(CYGPATH_W) 'tests/test_poller.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_poller.cpp'; fi` tests/tests_test_radio_dish-test_radio_dish.o: tests/test_radio_dish.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_radio_dish_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_radio_dish-test_radio_dish.o -MD -MP -MF tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Tpo -c -o tests/tests_test_radio_dish-test_radio_dish.o `test -f 'tests/test_radio_dish.cpp' || echo '$(srcdir)/'`tests/test_radio_dish.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Tpo tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_radio_dish.cpp' object='tests/tests_test_radio_dish-test_radio_dish.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_radio_dish_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_radio_dish-test_radio_dish.o `test -f 'tests/test_radio_dish.cpp' || echo '$(srcdir)/'`tests/test_radio_dish.cpp tests/tests_test_radio_dish-test_radio_dish.obj: tests/test_radio_dish.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_radio_dish_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_radio_dish-test_radio_dish.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Tpo -c -o tests/tests_test_radio_dish-test_radio_dish.obj `if test -f 'tests/test_radio_dish.cpp'; then $(CYGPATH_W) 'tests/test_radio_dish.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_radio_dish.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Tpo tests/$(DEPDIR)/tests_test_radio_dish-test_radio_dish.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_radio_dish.cpp' object='tests/tests_test_radio_dish-test_radio_dish.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_radio_dish_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_radio_dish-test_radio_dish.obj `if test -f 'tests/test_radio_dish.cpp'; then $(CYGPATH_W) 'tests/test_radio_dish.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_radio_dish.cpp'; fi` tests/tests_test_reconnect_ivl-test_reconnect_ivl.o: tests/test_reconnect_ivl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reconnect_ivl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_reconnect_ivl-test_reconnect_ivl.o -MD -MP -MF tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Tpo -c -o tests/tests_test_reconnect_ivl-test_reconnect_ivl.o `test -f 'tests/test_reconnect_ivl.cpp' || echo '$(srcdir)/'`tests/test_reconnect_ivl.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Tpo tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reconnect_ivl.cpp' object='tests/tests_test_reconnect_ivl-test_reconnect_ivl.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reconnect_ivl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_reconnect_ivl-test_reconnect_ivl.o `test -f 'tests/test_reconnect_ivl.cpp' || echo '$(srcdir)/'`tests/test_reconnect_ivl.cpp tests/tests_test_reconnect_ivl-test_reconnect_ivl.obj: tests/test_reconnect_ivl.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reconnect_ivl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_reconnect_ivl-test_reconnect_ivl.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Tpo -c -o tests/tests_test_reconnect_ivl-test_reconnect_ivl.obj `if test -f 'tests/test_reconnect_ivl.cpp'; then $(CYGPATH_W) 'tests/test_reconnect_ivl.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reconnect_ivl.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Tpo tests/$(DEPDIR)/tests_test_reconnect_ivl-test_reconnect_ivl.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reconnect_ivl.cpp' object='tests/tests_test_reconnect_ivl-test_reconnect_ivl.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reconnect_ivl_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_reconnect_ivl-test_reconnect_ivl.obj `if test -f 'tests/test_reconnect_ivl.cpp'; then $(CYGPATH_W) 'tests/test_reconnect_ivl.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reconnect_ivl.cpp'; fi` tests/tests_test_reqrep_tcp-test_reqrep_tcp.o: tests/test_reqrep_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reqrep_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_reqrep_tcp-test_reqrep_tcp.o -MD -MP -MF tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Tpo -c -o tests/tests_test_reqrep_tcp-test_reqrep_tcp.o `test -f 'tests/test_reqrep_tcp.cpp' || echo '$(srcdir)/'`tests/test_reqrep_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Tpo tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reqrep_tcp.cpp' object='tests/tests_test_reqrep_tcp-test_reqrep_tcp.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reqrep_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_reqrep_tcp-test_reqrep_tcp.o `test -f 'tests/test_reqrep_tcp.cpp' || echo '$(srcdir)/'`tests/test_reqrep_tcp.cpp tests/tests_test_reqrep_tcp-test_reqrep_tcp.obj: tests/test_reqrep_tcp.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reqrep_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_reqrep_tcp-test_reqrep_tcp.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Tpo -c -o tests/tests_test_reqrep_tcp-test_reqrep_tcp.obj `if test -f 'tests/test_reqrep_tcp.cpp'; then $(CYGPATH_W) 'tests/test_reqrep_tcp.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reqrep_tcp.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Tpo tests/$(DEPDIR)/tests_test_reqrep_tcp-test_reqrep_tcp.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_reqrep_tcp.cpp' object='tests/tests_test_reqrep_tcp-test_reqrep_tcp.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_reqrep_tcp_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_reqrep_tcp-test_reqrep_tcp.obj `if test -f 'tests/test_reqrep_tcp.cpp'; then $(CYGPATH_W) 'tests/test_reqrep_tcp.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_reqrep_tcp.cpp'; fi` tests/tests_test_router_handover-test_router_handover.o: tests/test_router_handover.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_handover_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_router_handover-test_router_handover.o -MD -MP -MF tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Tpo -c -o tests/tests_test_router_handover-test_router_handover.o `test -f 'tests/test_router_handover.cpp' || echo '$(srcdir)/'`tests/test_router_handover.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Tpo tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_router_handover.cpp' object='tests/tests_test_router_handover-test_router_handover.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_handover_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_router_handover-test_router_handover.o `test -f 'tests/test_router_handover.cpp' || echo '$(srcdir)/'`tests/test_router_handover.cpp tests/tests_test_router_handover-test_router_handover.obj: tests/test_router_handover.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_handover_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_router_handover-test_router_handover.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Tpo -c -o tests/tests_test_router_handover-test_router_handover.obj `if test -f 'tests/test_router_handover.cpp'; then $(CYGPATH_W) 'tests/test_router_handover.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_router_handover.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Tpo tests/$(DEPDIR)/tests_test_router_handover-test_router_handover.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_router_handover.cpp' object='tests/tests_test_router_handover-test_router_handover.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_handover_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_router_handover-test_router_handover.obj `if test -f 'tests/test_router_handover.cpp'; then $(CYGPATH_W) 'tests/test_router_handover.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_router_handover.cpp'; fi` tests/tests_test_router_mandatory-test_router_mandatory.o: tests/test_router_mandatory.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_mandatory_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_router_mandatory-test_router_mandatory.o -MD -MP -MF tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Tpo -c -o tests/tests_test_router_mandatory-test_router_mandatory.o `test -f 'tests/test_router_mandatory.cpp' || echo '$(srcdir)/'`tests/test_router_mandatory.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Tpo tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_router_mandatory.cpp' object='tests/tests_test_router_mandatory-test_router_mandatory.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_mandatory_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_router_mandatory-test_router_mandatory.o `test -f 'tests/test_router_mandatory.cpp' || echo '$(srcdir)/'`tests/test_router_mandatory.cpp tests/tests_test_router_mandatory-test_router_mandatory.obj: tests/test_router_mandatory.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_mandatory_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_router_mandatory-test_router_mandatory.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Tpo -c -o tests/tests_test_router_mandatory-test_router_mandatory.obj `if test -f 'tests/test_router_mandatory.cpp'; then $(CYGPATH_W) 'tests/test_router_mandatory.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_router_mandatory.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Tpo tests/$(DEPDIR)/tests_test_router_mandatory-test_router_mandatory.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_router_mandatory.cpp' object='tests/tests_test_router_mandatory-test_router_mandatory.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_router_mandatory_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_router_mandatory-test_router_mandatory.obj `if test -f 'tests/test_router_mandatory.cpp'; then $(CYGPATH_W) 'tests/test_router_mandatory.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_router_mandatory.cpp'; fi` tests/tests_test_security_curve-test_security_curve.o: tests/test_security_curve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_security_curve-test_security_curve.o -MD -MP -MF tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Tpo -c -o tests/tests_test_security_curve-test_security_curve.o `test -f 'tests/test_security_curve.cpp' || echo '$(srcdir)/'`tests/test_security_curve.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Tpo tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_security_curve.cpp' object='tests/tests_test_security_curve-test_security_curve.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_security_curve-test_security_curve.o `test -f 'tests/test_security_curve.cpp' || echo '$(srcdir)/'`tests/test_security_curve.cpp tests/tests_test_security_curve-test_security_curve.obj: tests/test_security_curve.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_security_curve-test_security_curve.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Tpo -c -o tests/tests_test_security_curve-test_security_curve.obj `if test -f 'tests/test_security_curve.cpp'; then $(CYGPATH_W) 'tests/test_security_curve.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_security_curve.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Tpo tests/$(DEPDIR)/tests_test_security_curve-test_security_curve.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_security_curve.cpp' object='tests/tests_test_security_curve-test_security_curve.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_security_curve-test_security_curve.obj `if test -f 'tests/test_security_curve.cpp'; then $(CYGPATH_W) 'tests/test_security_curve.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_security_curve.cpp'; fi` src/tests_test_security_curve-clock.o: src/clock.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-clock.o -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-clock.Tpo -c -o src/tests_test_security_curve-clock.o `test -f 'src/clock.cpp' || echo '$(srcdir)/'`src/clock.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-clock.Tpo src/$(DEPDIR)/tests_test_security_curve-clock.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/clock.cpp' object='src/tests_test_security_curve-clock.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-clock.o `test -f 'src/clock.cpp' || echo '$(srcdir)/'`src/clock.cpp src/tests_test_security_curve-clock.obj: src/clock.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-clock.obj -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-clock.Tpo -c -o src/tests_test_security_curve-clock.obj `if test -f 'src/clock.cpp'; then $(CYGPATH_W) 'src/clock.cpp'; else $(CYGPATH_W) '$(srcdir)/src/clock.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-clock.Tpo src/$(DEPDIR)/tests_test_security_curve-clock.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/clock.cpp' object='src/tests_test_security_curve-clock.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-clock.obj `if test -f 'src/clock.cpp'; then $(CYGPATH_W) 'src/clock.cpp'; else $(CYGPATH_W) '$(srcdir)/src/clock.cpp'; fi` src/tests_test_security_curve-random.o: src/random.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-random.o -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-random.Tpo -c -o src/tests_test_security_curve-random.o `test -f 'src/random.cpp' || echo '$(srcdir)/'`src/random.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-random.Tpo src/$(DEPDIR)/tests_test_security_curve-random.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/random.cpp' object='src/tests_test_security_curve-random.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-random.o `test -f 'src/random.cpp' || echo '$(srcdir)/'`src/random.cpp src/tests_test_security_curve-random.obj: src/random.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-random.obj -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-random.Tpo -c -o src/tests_test_security_curve-random.obj `if test -f 'src/random.cpp'; then $(CYGPATH_W) 'src/random.cpp'; else $(CYGPATH_W) '$(srcdir)/src/random.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-random.Tpo src/$(DEPDIR)/tests_test_security_curve-random.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/random.cpp' object='src/tests_test_security_curve-random.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-random.obj `if test -f 'src/random.cpp'; then $(CYGPATH_W) 'src/random.cpp'; else $(CYGPATH_W) '$(srcdir)/src/random.cpp'; fi` src/tests_test_security_curve-err.o: src/err.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-err.o -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-err.Tpo -c -o src/tests_test_security_curve-err.o `test -f 'src/err.cpp' || echo '$(srcdir)/'`src/err.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-err.Tpo src/$(DEPDIR)/tests_test_security_curve-err.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/err.cpp' object='src/tests_test_security_curve-err.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-err.o `test -f 'src/err.cpp' || echo '$(srcdir)/'`src/err.cpp src/tests_test_security_curve-err.obj: src/err.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tests_test_security_curve-err.obj -MD -MP -MF src/$(DEPDIR)/tests_test_security_curve-err.Tpo -c -o src/tests_test_security_curve-err.obj `if test -f 'src/err.cpp'; then $(CYGPATH_W) 'src/err.cpp'; else $(CYGPATH_W) '$(srcdir)/src/err.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/tests_test_security_curve-err.Tpo src/$(DEPDIR)/tests_test_security_curve-err.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/err.cpp' object='src/tests_test_security_curve-err.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_security_curve_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tests_test_security_curve-err.obj `if test -f 'src/err.cpp'; then $(CYGPATH_W) 'src/err.cpp'; else $(CYGPATH_W) '$(srcdir)/src/err.cpp'; fi` tests/tests_test_socket_null-test_socket_null.o: tests/test_socket_null.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_socket_null_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_socket_null-test_socket_null.o -MD -MP -MF tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Tpo -c -o tests/tests_test_socket_null-test_socket_null.o `test -f 'tests/test_socket_null.cpp' || echo '$(srcdir)/'`tests/test_socket_null.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Tpo tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_socket_null.cpp' object='tests/tests_test_socket_null-test_socket_null.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_socket_null_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_socket_null-test_socket_null.o `test -f 'tests/test_socket_null.cpp' || echo '$(srcdir)/'`tests/test_socket_null.cpp tests/tests_test_socket_null-test_socket_null.obj: tests/test_socket_null.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_socket_null_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_socket_null-test_socket_null.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Tpo -c -o tests/tests_test_socket_null-test_socket_null.obj `if test -f 'tests/test_socket_null.cpp'; then $(CYGPATH_W) 'tests/test_socket_null.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_socket_null.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Tpo tests/$(DEPDIR)/tests_test_socket_null-test_socket_null.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_socket_null.cpp' object='tests/tests_test_socket_null-test_socket_null.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_socket_null_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_socket_null-test_socket_null.obj `if test -f 'tests/test_socket_null.cpp'; then $(CYGPATH_W) 'tests/test_socket_null.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_socket_null.cpp'; fi` tests/tests_test_sockopt_hwm-test_sockopt_hwm.o: tests/test_sockopt_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_sockopt_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_sockopt_hwm-test_sockopt_hwm.o -MD -MP -MF tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Tpo -c -o tests/tests_test_sockopt_hwm-test_sockopt_hwm.o `test -f 'tests/test_sockopt_hwm.cpp' || echo '$(srcdir)/'`tests/test_sockopt_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Tpo tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_sockopt_hwm.cpp' object='tests/tests_test_sockopt_hwm-test_sockopt_hwm.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_sockopt_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_sockopt_hwm-test_sockopt_hwm.o `test -f 'tests/test_sockopt_hwm.cpp' || echo '$(srcdir)/'`tests/test_sockopt_hwm.cpp tests/tests_test_sockopt_hwm-test_sockopt_hwm.obj: tests/test_sockopt_hwm.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_sockopt_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_sockopt_hwm-test_sockopt_hwm.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Tpo -c -o tests/tests_test_sockopt_hwm-test_sockopt_hwm.obj `if test -f 'tests/test_sockopt_hwm.cpp'; then $(CYGPATH_W) 'tests/test_sockopt_hwm.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_sockopt_hwm.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Tpo tests/$(DEPDIR)/tests_test_sockopt_hwm-test_sockopt_hwm.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_sockopt_hwm.cpp' object='tests/tests_test_sockopt_hwm-test_sockopt_hwm.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_sockopt_hwm_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_sockopt_hwm-test_sockopt_hwm.obj `if test -f 'tests/test_sockopt_hwm.cpp'; then $(CYGPATH_W) 'tests/test_sockopt_hwm.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_sockopt_hwm.cpp'; fi` tests/tests_test_thread_safe-test_thread_safe.o: tests/test_thread_safe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_thread_safe_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_thread_safe-test_thread_safe.o -MD -MP -MF tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Tpo -c -o tests/tests_test_thread_safe-test_thread_safe.o `test -f 'tests/test_thread_safe.cpp' || echo '$(srcdir)/'`tests/test_thread_safe.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Tpo tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_thread_safe.cpp' object='tests/tests_test_thread_safe-test_thread_safe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_thread_safe_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_thread_safe-test_thread_safe.o `test -f 'tests/test_thread_safe.cpp' || echo '$(srcdir)/'`tests/test_thread_safe.cpp tests/tests_test_thread_safe-test_thread_safe.obj: tests/test_thread_safe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_thread_safe_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_thread_safe-test_thread_safe.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Tpo -c -o tests/tests_test_thread_safe-test_thread_safe.obj `if test -f 'tests/test_thread_safe.cpp'; then $(CYGPATH_W) 'tests/test_thread_safe.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_thread_safe.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Tpo tests/$(DEPDIR)/tests_test_thread_safe-test_thread_safe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_thread_safe.cpp' object='tests/tests_test_thread_safe-test_thread_safe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_thread_safe_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_thread_safe-test_thread_safe.obj `if test -f 'tests/test_thread_safe.cpp'; then $(CYGPATH_W) 'tests/test_thread_safe.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_thread_safe.cpp'; fi` tests/tests_test_xpub_verbose-test_xpub_verbose.o: tests/test_xpub_verbose.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_xpub_verbose_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_xpub_verbose-test_xpub_verbose.o -MD -MP -MF tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Tpo -c -o tests/tests_test_xpub_verbose-test_xpub_verbose.o `test -f 'tests/test_xpub_verbose.cpp' || echo '$(srcdir)/'`tests/test_xpub_verbose.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Tpo tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_xpub_verbose.cpp' object='tests/tests_test_xpub_verbose-test_xpub_verbose.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_xpub_verbose_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_xpub_verbose-test_xpub_verbose.o `test -f 'tests/test_xpub_verbose.cpp' || echo '$(srcdir)/'`tests/test_xpub_verbose.cpp tests/tests_test_xpub_verbose-test_xpub_verbose.obj: tests/test_xpub_verbose.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_xpub_verbose_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT tests/tests_test_xpub_verbose-test_xpub_verbose.obj -MD -MP -MF tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Tpo -c -o tests/tests_test_xpub_verbose-test_xpub_verbose.obj `if test -f 'tests/test_xpub_verbose.cpp'; then $(CYGPATH_W) 'tests/test_xpub_verbose.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_xpub_verbose.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Tpo tests/$(DEPDIR)/tests_test_xpub_verbose-test_xpub_verbose.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tests/test_xpub_verbose.cpp' object='tests/tests_test_xpub_verbose-test_xpub_verbose.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tests_test_xpub_verbose_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tests/tests_test_xpub_verbose-test_xpub_verbose.obj `if test -f 'tests/test_xpub_verbose.cpp'; then $(CYGPATH_W) 'tests/test_xpub_verbose.cpp'; else $(CYGPATH_W) '$(srcdir)/tests/test_xpub_verbose.cpp'; fi` unittests/unittests_unittest_mtrie-unittest_mtrie.o: unittests/unittest_mtrie.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_mtrie_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_mtrie_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_mtrie-unittest_mtrie.o -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Tpo -c -o unittests/unittests_unittest_mtrie-unittest_mtrie.o `test -f 'unittests/unittest_mtrie.cpp' || echo '$(srcdir)/'`unittests/unittest_mtrie.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Tpo unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_mtrie.cpp' object='unittests/unittests_unittest_mtrie-unittest_mtrie.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_mtrie_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_mtrie_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_mtrie-unittest_mtrie.o `test -f 'unittests/unittest_mtrie.cpp' || echo '$(srcdir)/'`unittests/unittest_mtrie.cpp unittests/unittests_unittest_mtrie-unittest_mtrie.obj: unittests/unittest_mtrie.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_mtrie_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_mtrie_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_mtrie-unittest_mtrie.obj -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Tpo -c -o unittests/unittests_unittest_mtrie-unittest_mtrie.obj `if test -f 'unittests/unittest_mtrie.cpp'; then $(CYGPATH_W) 'unittests/unittest_mtrie.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_mtrie.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Tpo unittests/$(DEPDIR)/unittests_unittest_mtrie-unittest_mtrie.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_mtrie.cpp' object='unittests/unittests_unittest_mtrie-unittest_mtrie.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_mtrie_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_mtrie_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_mtrie-unittest_mtrie.obj `if test -f 'unittests/unittest_mtrie.cpp'; then $(CYGPATH_W) 'unittests/unittest_mtrie.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_mtrie.cpp'; fi` unittests/unittests_unittest_poller-unittest_poller.o: unittests/unittest_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_poller_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_poller_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_poller-unittest_poller.o -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Tpo -c -o unittests/unittests_unittest_poller-unittest_poller.o `test -f 'unittests/unittest_poller.cpp' || echo '$(srcdir)/'`unittests/unittest_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Tpo unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_poller.cpp' object='unittests/unittests_unittest_poller-unittest_poller.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_poller_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_poller_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_poller-unittest_poller.o `test -f 'unittests/unittest_poller.cpp' || echo '$(srcdir)/'`unittests/unittest_poller.cpp unittests/unittests_unittest_poller-unittest_poller.obj: unittests/unittest_poller.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_poller_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_poller_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_poller-unittest_poller.obj -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Tpo -c -o unittests/unittests_unittest_poller-unittest_poller.obj `if test -f 'unittests/unittest_poller.cpp'; then $(CYGPATH_W) 'unittests/unittest_poller.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_poller.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Tpo unittests/$(DEPDIR)/unittests_unittest_poller-unittest_poller.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_poller.cpp' object='unittests/unittests_unittest_poller-unittest_poller.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_poller_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_poller_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_poller-unittest_poller.obj `if test -f 'unittests/unittest_poller.cpp'; then $(CYGPATH_W) 'unittests/unittest_poller.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_poller.cpp'; fi` unittests/unittests_unittest_ypipe-unittest_ypipe.o: unittests/unittest_ypipe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_ypipe_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_ypipe_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_ypipe-unittest_ypipe.o -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Tpo -c -o unittests/unittests_unittest_ypipe-unittest_ypipe.o `test -f 'unittests/unittest_ypipe.cpp' || echo '$(srcdir)/'`unittests/unittest_ypipe.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Tpo unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_ypipe.cpp' object='unittests/unittests_unittest_ypipe-unittest_ypipe.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_ypipe_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_ypipe_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_ypipe-unittest_ypipe.o `test -f 'unittests/unittest_ypipe.cpp' || echo '$(srcdir)/'`unittests/unittest_ypipe.cpp unittests/unittests_unittest_ypipe-unittest_ypipe.obj: unittests/unittest_ypipe.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_ypipe_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_ypipe_CXXFLAGS) $(CXXFLAGS) -MT unittests/unittests_unittest_ypipe-unittest_ypipe.obj -MD -MP -MF unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Tpo -c -o unittests/unittests_unittest_ypipe-unittest_ypipe.obj `if test -f 'unittests/unittest_ypipe.cpp'; then $(CYGPATH_W) 'unittests/unittest_ypipe.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_ypipe.cpp'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Tpo unittests/$(DEPDIR)/unittests_unittest_ypipe-unittest_ypipe.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='unittests/unittest_ypipe.cpp' object='unittests/unittests_unittest_ypipe-unittest_ypipe.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(unittests_unittest_ypipe_CPPFLAGS) $(CPPFLAGS) $(unittests_unittest_ypipe_CXXFLAGS) $(CXXFLAGS) -c -o unittests/unittests_unittest_ypipe-unittest_ypipe.obj `if test -f 'unittests/unittest_ypipe.cpp'; then $(CYGPATH_W) 'unittests/unittest_ypipe.cpp'; else $(CYGPATH_W) '$(srcdir)/unittests/unittest_ypipe.cpp'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf perf/.libs perf/_libs -rm -rf src/.libs src/_libs -rm -rf tests/.libs tests/_libs -rm -rf tools/.libs tools/_libs -rm -rf unittests/.libs unittests/_libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all $(check_PROGRAMS) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? tests/test_ancillaries.log: tests/test_ancillaries$(EXEEXT) @p='tests/test_ancillaries$(EXEEXT)'; \ b='tests/test_ancillaries'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_system.log: tests/test_system$(EXEEXT) @p='tests/test_system$(EXEEXT)'; \ b='tests/test_system'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_pair_inproc.log: tests/test_pair_inproc$(EXEEXT) @p='tests/test_pair_inproc$(EXEEXT)'; \ b='tests/test_pair_inproc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_pair_tcp.log: tests/test_pair_tcp$(EXEEXT) @p='tests/test_pair_tcp$(EXEEXT)'; \ b='tests/test_pair_tcp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_inproc.log: tests/test_reqrep_inproc$(EXEEXT) @p='tests/test_reqrep_inproc$(EXEEXT)'; \ b='tests/test_reqrep_inproc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_tcp.log: tests/test_reqrep_tcp$(EXEEXT) @p='tests/test_reqrep_tcp$(EXEEXT)'; \ b='tests/test_reqrep_tcp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_hwm.log: tests/test_hwm$(EXEEXT) @p='tests/test_hwm$(EXEEXT)'; \ b='tests/test_hwm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_hwm_pubsub.log: tests/test_hwm_pubsub$(EXEEXT) @p='tests/test_hwm_pubsub$(EXEEXT)'; \ b='tests/test_hwm_pubsub'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_device.log: tests/test_reqrep_device$(EXEEXT) @p='tests/test_reqrep_device$(EXEEXT)'; \ b='tests/test_reqrep_device'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_sub_forward.log: tests/test_sub_forward$(EXEEXT) @p='tests/test_sub_forward$(EXEEXT)'; \ b='tests/test_sub_forward'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_invalid_rep.log: tests/test_invalid_rep$(EXEEXT) @p='tests/test_invalid_rep$(EXEEXT)'; \ b='tests/test_invalid_rep'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_msg_flags.log: tests/test_msg_flags$(EXEEXT) @p='tests/test_msg_flags$(EXEEXT)'; \ b='tests/test_msg_flags'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_msg_ffn.log: tests/test_msg_ffn$(EXEEXT) @p='tests/test_msg_ffn$(EXEEXT)'; \ b='tests/test_msg_ffn'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_connect_resolve.log: tests/test_connect_resolve$(EXEEXT) @p='tests/test_connect_resolve$(EXEEXT)'; \ b='tests/test_connect_resolve'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_immediate.log: tests/test_immediate$(EXEEXT) @p='tests/test_immediate$(EXEEXT)'; \ b='tests/test_immediate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_last_endpoint.log: tests/test_last_endpoint$(EXEEXT) @p='tests/test_last_endpoint$(EXEEXT)'; \ b='tests/test_last_endpoint'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_term_endpoint.log: tests/test_term_endpoint$(EXEEXT) @p='tests/test_term_endpoint$(EXEEXT)'; \ b='tests/test_term_endpoint'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_srcfd.log: tests/test_srcfd$(EXEEXT) @p='tests/test_srcfd$(EXEEXT)'; \ b='tests/test_srcfd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_monitor.log: tests/test_monitor$(EXEEXT) @p='tests/test_monitor$(EXEEXT)'; \ b='tests/test_monitor'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_router_mandatory.log: tests/test_router_mandatory$(EXEEXT) @p='tests/test_router_mandatory$(EXEEXT)'; \ b='tests/test_router_mandatory'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_router_mandatory_hwm.log: tests/test_router_mandatory_hwm$(EXEEXT) @p='tests/test_router_mandatory_hwm$(EXEEXT)'; \ b='tests/test_router_mandatory_hwm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_router_handover.log: tests/test_router_handover$(EXEEXT) @p='tests/test_router_handover$(EXEEXT)'; \ b='tests/test_router_handover'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_probe_router.log: tests/test_probe_router$(EXEEXT) @p='tests/test_probe_router$(EXEEXT)'; \ b='tests/test_probe_router'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_stream.log: tests/test_stream$(EXEEXT) @p='tests/test_stream$(EXEEXT)'; \ b='tests/test_stream'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_stream_empty.log: tests/test_stream_empty$(EXEEXT) @p='tests/test_stream_empty$(EXEEXT)'; \ b='tests/test_stream_empty'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_stream_disconnect.log: tests/test_stream_disconnect$(EXEEXT) @p='tests/test_stream_disconnect$(EXEEXT)'; \ b='tests/test_stream_disconnect'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_stream_timeout.log: tests/test_stream_timeout$(EXEEXT) @p='tests/test_stream_timeout$(EXEEXT)'; \ b='tests/test_stream_timeout'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_disconnect_inproc.log: tests/test_disconnect_inproc$(EXEEXT) @p='tests/test_disconnect_inproc$(EXEEXT)'; \ b='tests/test_disconnect_inproc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_unbind_inproc.log: tests/test_unbind_inproc$(EXEEXT) @p='tests/test_unbind_inproc$(EXEEXT)'; \ b='tests/test_unbind_inproc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_unbind_wildcard.log: tests/test_unbind_wildcard$(EXEEXT) @p='tests/test_unbind_wildcard$(EXEEXT)'; \ b='tests/test_unbind_wildcard'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_ctx_options.log: tests/test_ctx_options$(EXEEXT) @p='tests/test_ctx_options$(EXEEXT)'; \ b='tests/test_ctx_options'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_ctx_destroy.log: tests/test_ctx_destroy$(EXEEXT) @p='tests/test_ctx_destroy$(EXEEXT)'; \ b='tests/test_ctx_destroy'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_security_null.log: tests/test_security_null$(EXEEXT) @p='tests/test_security_null$(EXEEXT)'; \ b='tests/test_security_null'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_security_plain.log: tests/test_security_plain$(EXEEXT) @p='tests/test_security_plain$(EXEEXT)'; \ b='tests/test_security_plain'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_security_zap.log: tests/test_security_zap$(EXEEXT) @p='tests/test_security_zap$(EXEEXT)'; \ b='tests/test_security_zap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_iov.log: tests/test_iov$(EXEEXT) @p='tests/test_iov$(EXEEXT)'; \ b='tests/test_iov'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_spec_req.log: tests/test_spec_req$(EXEEXT) @p='tests/test_spec_req$(EXEEXT)'; \ b='tests/test_spec_req'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_spec_rep.log: tests/test_spec_rep$(EXEEXT) @p='tests/test_spec_rep$(EXEEXT)'; \ b='tests/test_spec_rep'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_spec_dealer.log: tests/test_spec_dealer$(EXEEXT) @p='tests/test_spec_dealer$(EXEEXT)'; \ b='tests/test_spec_dealer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_spec_router.log: tests/test_spec_router$(EXEEXT) @p='tests/test_spec_router$(EXEEXT)'; \ b='tests/test_spec_router'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_spec_pushpull.log: tests/test_spec_pushpull$(EXEEXT) @p='tests/test_spec_pushpull$(EXEEXT)'; \ b='tests/test_spec_pushpull'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_req_correlate.log: tests/test_req_correlate$(EXEEXT) @p='tests/test_req_correlate$(EXEEXT)'; \ b='tests/test_req_correlate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_req_relaxed.log: tests/test_req_relaxed$(EXEEXT) @p='tests/test_req_relaxed$(EXEEXT)'; \ b='tests/test_req_relaxed'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_conflate.log: tests/test_conflate$(EXEEXT) @p='tests/test_conflate$(EXEEXT)'; \ b='tests/test_conflate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_inproc_connect.log: tests/test_inproc_connect$(EXEEXT) @p='tests/test_inproc_connect$(EXEEXT)'; \ b='tests/test_inproc_connect'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_issue_566.log: tests/test_issue_566$(EXEEXT) @p='tests/test_issue_566$(EXEEXT)'; \ b='tests/test_issue_566'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_proxy.log: tests/test_proxy$(EXEEXT) @p='tests/test_proxy$(EXEEXT)'; \ b='tests/test_proxy'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_proxy_single_socket.log: tests/test_proxy_single_socket$(EXEEXT) @p='tests/test_proxy_single_socket$(EXEEXT)'; \ b='tests/test_proxy_single_socket'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_proxy_terminate.log: tests/test_proxy_terminate$(EXEEXT) @p='tests/test_proxy_terminate$(EXEEXT)'; \ b='tests/test_proxy_terminate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_getsockopt_memset.log: tests/test_getsockopt_memset$(EXEEXT) @p='tests/test_getsockopt_memset$(EXEEXT)'; \ b='tests/test_getsockopt_memset'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_setsockopt.log: tests/test_setsockopt$(EXEEXT) @p='tests/test_setsockopt$(EXEEXT)'; \ b='tests/test_setsockopt'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_diffserv.log: tests/test_diffserv$(EXEEXT) @p='tests/test_diffserv$(EXEEXT)'; \ b='tests/test_diffserv'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_connect_rid.log: tests/test_connect_rid$(EXEEXT) @p='tests/test_connect_rid$(EXEEXT)'; \ b='tests/test_connect_rid'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_bind_src_address.log: tests/test_bind_src_address$(EXEEXT) @p='tests/test_bind_src_address$(EXEEXT)'; \ b='tests/test_bind_src_address'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_metadata.log: tests/test_metadata$(EXEEXT) @p='tests/test_metadata$(EXEEXT)'; \ b='tests/test_metadata'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_capabilities.log: tests/test_capabilities$(EXEEXT) @p='tests/test_capabilities$(EXEEXT)'; \ b='tests/test_capabilities'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_xpub_nodrop.log: tests/test_xpub_nodrop$(EXEEXT) @p='tests/test_xpub_nodrop$(EXEEXT)'; \ b='tests/test_xpub_nodrop'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_xpub_manual.log: tests/test_xpub_manual$(EXEEXT) @p='tests/test_xpub_manual$(EXEEXT)'; \ b='tests/test_xpub_manual'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_xpub_welcome_msg.log: tests/test_xpub_welcome_msg$(EXEEXT) @p='tests/test_xpub_welcome_msg$(EXEEXT)'; \ b='tests/test_xpub_welcome_msg'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_xpub_verbose.log: tests/test_xpub_verbose$(EXEEXT) @p='tests/test_xpub_verbose$(EXEEXT)'; \ b='tests/test_xpub_verbose'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_atomics.log: tests/test_atomics$(EXEEXT) @p='tests/test_atomics$(EXEEXT)'; \ b='tests/test_atomics'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_sockopt_hwm.log: tests/test_sockopt_hwm$(EXEEXT) @p='tests/test_sockopt_hwm$(EXEEXT)'; \ b='tests/test_sockopt_hwm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_heartbeats.log: tests/test_heartbeats$(EXEEXT) @p='tests/test_heartbeats$(EXEEXT)'; \ b='tests/test_heartbeats'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_stream_exceeds_buffer.log: tests/test_stream_exceeds_buffer$(EXEEXT) @p='tests/test_stream_exceeds_buffer$(EXEEXT)'; \ b='tests/test_stream_exceeds_buffer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_pub_invert_matching.log: tests/test_pub_invert_matching$(EXEEXT) @p='tests/test_pub_invert_matching$(EXEEXT)'; \ b='tests/test_pub_invert_matching'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_base85.log: tests/test_base85$(EXEEXT) @p='tests/test_base85$(EXEEXT)'; \ b='tests/test_base85'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_bind_after_connect_tcp.log: tests/test_bind_after_connect_tcp$(EXEEXT) @p='tests/test_bind_after_connect_tcp$(EXEEXT)'; \ b='tests/test_bind_after_connect_tcp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_sodium.log: tests/test_sodium$(EXEEXT) @p='tests/test_sodium$(EXEEXT)'; \ b='tests/test_sodium'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reconnect_ivl.log: tests/test_reconnect_ivl$(EXEEXT) @p='tests/test_reconnect_ivl$(EXEEXT)'; \ b='tests/test_reconnect_ivl'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_socket_null.log: tests/test_socket_null$(EXEEXT) @p='tests/test_socket_null$(EXEEXT)'; \ b='tests/test_socket_null'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_security_curve.log: tests/test_security_curve$(EXEEXT) @p='tests/test_security_curve$(EXEEXT)'; \ b='tests/test_security_curve'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_shutdown_stress.log: tests/test_shutdown_stress$(EXEEXT) @p='tests/test_shutdown_stress$(EXEEXT)'; \ b='tests/test_shutdown_stress'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_ipc_wildcard.log: tests/test_ipc_wildcard$(EXEEXT) @p='tests/test_ipc_wildcard$(EXEEXT)'; \ b='tests/test_ipc_wildcard'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_pair_ipc.log: tests/test_pair_ipc$(EXEEXT) @p='tests/test_pair_ipc$(EXEEXT)'; \ b='tests/test_pair_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_rebind_ipc.log: tests/test_rebind_ipc$(EXEEXT) @p='tests/test_rebind_ipc$(EXEEXT)'; \ b='tests/test_rebind_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_ipc.log: tests/test_reqrep_ipc$(EXEEXT) @p='tests/test_reqrep_ipc$(EXEEXT)'; \ b='tests/test_reqrep_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_use_fd_ipc.log: tests/test_use_fd_ipc$(EXEEXT) @p='tests/test_use_fd_ipc$(EXEEXT)'; \ b='tests/test_use_fd_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_use_fd_tcp.log: tests/test_use_fd_tcp$(EXEEXT) @p='tests/test_use_fd_tcp$(EXEEXT)'; \ b='tests/test_use_fd_tcp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_zmq_poll_fd.log: tests/test_zmq_poll_fd$(EXEEXT) @p='tests/test_zmq_poll_fd$(EXEEXT)'; \ b='tests/test_zmq_poll_fd'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_timeo.log: tests/test_timeo$(EXEEXT) @p='tests/test_timeo$(EXEEXT)'; \ b='tests/test_timeo'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_filter_ipc.log: tests/test_filter_ipc$(EXEEXT) @p='tests/test_filter_ipc$(EXEEXT)'; \ b='tests/test_filter_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_fork.log: tests/test_fork$(EXEEXT) @p='tests/test_fork$(EXEEXT)'; \ b='tests/test_fork'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_connect_delay_tipc.log: tests/test_connect_delay_tipc$(EXEEXT) @p='tests/test_connect_delay_tipc$(EXEEXT)'; \ b='tests/test_connect_delay_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_pair_tipc.log: tests/test_pair_tipc$(EXEEXT) @p='tests/test_pair_tipc$(EXEEXT)'; \ b='tests/test_pair_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_device_tipc.log: tests/test_reqrep_device_tipc$(EXEEXT) @p='tests/test_reqrep_device_tipc$(EXEEXT)'; \ b='tests/test_reqrep_device_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_reqrep_tipc.log: tests/test_reqrep_tipc$(EXEEXT) @p='tests/test_reqrep_tipc$(EXEEXT)'; \ b='tests/test_reqrep_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_router_mandatory_tipc.log: tests/test_router_mandatory_tipc$(EXEEXT) @p='tests/test_router_mandatory_tipc$(EXEEXT)'; \ b='tests/test_router_mandatory_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_shutdown_stress_tipc.log: tests/test_shutdown_stress_tipc$(EXEEXT) @p='tests/test_shutdown_stress_tipc$(EXEEXT)'; \ b='tests/test_shutdown_stress_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_sub_forward_tipc.log: tests/test_sub_forward_tipc$(EXEEXT) @p='tests/test_sub_forward_tipc$(EXEEXT)'; \ b='tests/test_sub_forward_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_term_endpoint_tipc.log: tests/test_term_endpoint_tipc$(EXEEXT) @p='tests/test_term_endpoint_tipc$(EXEEXT)'; \ b='tests/test_term_endpoint_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_address_tipc.log: tests/test_address_tipc$(EXEEXT) @p='tests/test_address_tipc$(EXEEXT)'; \ b='tests/test_address_tipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_security_gssapi.log: tests/test_security_gssapi$(EXEEXT) @p='tests/test_security_gssapi$(EXEEXT)'; \ b='tests/test_security_gssapi'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_abstract_ipc.log: tests/test_abstract_ipc$(EXEEXT) @p='tests/test_abstract_ipc$(EXEEXT)'; \ b='tests/test_abstract_ipc'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_many_sockets.log: tests/test_many_sockets$(EXEEXT) @p='tests/test_many_sockets$(EXEEXT)'; \ b='tests/test_many_sockets'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_pair_vmci.log: test_pair_vmci$(EXEEXT) @p='test_pair_vmci$(EXEEXT)'; \ b='test_pair_vmci'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test_reqrep_vmci.log: test_reqrep_vmci$(EXEEXT) @p='test_reqrep_vmci$(EXEEXT)'; \ b='test_reqrep_vmci'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_poller.log: tests/test_poller$(EXEEXT) @p='tests/test_poller$(EXEEXT)'; \ b='tests/test_poller'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_client_server.log: tests/test_client_server$(EXEEXT) @p='tests/test_client_server$(EXEEXT)'; \ b='tests/test_client_server'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_thread_safe.log: tests/test_thread_safe$(EXEEXT) @p='tests/test_thread_safe$(EXEEXT)'; \ b='tests/test_thread_safe'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_timers.log: tests/test_timers$(EXEEXT) @p='tests/test_timers$(EXEEXT)'; \ b='tests/test_timers'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_radio_dish.log: tests/test_radio_dish$(EXEEXT) @p='tests/test_radio_dish$(EXEEXT)'; \ b='tests/test_radio_dish'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_scatter_gather.log: tests/test_scatter_gather$(EXEEXT) @p='tests/test_scatter_gather$(EXEEXT)'; \ b='tests/test_scatter_gather'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_dgram.log: tests/test_dgram$(EXEEXT) @p='tests/test_dgram$(EXEEXT)'; \ b='tests/test_dgram'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) tests/test_app_meta.log: tests/test_app_meta$(EXEEXT) @p='tests/test_app_meta$(EXEEXT)'; \ b='tests/test_app_meta'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) unittests/unittest_poller.log: unittests/unittest_poller$(EXEEXT) @p='unittests/unittest_poller$(EXEEXT)'; \ b='unittests/unittest_poller'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) unittests/unittest_ypipe.log: unittests/unittest_ypipe$(EXEEXT) @p='unittests/unittest_ypipe$(EXEEXT)'; \ b='unittests/unittest_ypipe'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) unittests/unittest_mtrie.log: unittests/unittest_mtrie$(EXEEXT) @p='unittests/unittest_mtrie$(EXEEXT)'; \ b='unittests/unittest_mtrie'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(DATA) \ $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f external/unity/$(DEPDIR)/$(am__dirstamp) -rm -f external/unity/$(am__dirstamp) -rm -f perf/$(DEPDIR)/$(am__dirstamp) -rm -f perf/$(am__dirstamp) -rm -f src/$(DEPDIR)/$(am__dirstamp) -rm -f src/$(am__dirstamp) -rm -f tests/$(DEPDIR)/$(am__dirstamp) -rm -f tests/$(am__dirstamp) -rm -f tools/$(DEPDIR)/$(am__dirstamp) -rm -f tools/$(am__dirstamp) -rm -f unittests/$(DEPDIR)/$(am__dirstamp) -rm -f unittests/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf external/unity/$(DEPDIR) perf/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR) tools/$(DEPDIR) unittests/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-includeHEADERS install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf external/unity/$(DEPDIR) perf/$(DEPDIR) src/$(DEPDIR) tests/$(DEPDIR) tools/$(DEPDIR) unittests/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-TESTS check-am clean clean-binPROGRAMS \ clean-checkPROGRAMS clean-cscope clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstLIBRARIES \ clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ dist-tarZ dist-xz dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-pkgconfigDATA # Check if any sources need to be fixed, report the filenames and an error code @WITH_CLANG_FORMAT_TRUE@clang-format-check: $(ALL_SOURCE_FILES) @WITH_CLANG_FORMAT_TRUE@ @FAILED=0 ; IFS=";" ; IDS="`printf '\n\b'`" ; export IFS IDS; \ @WITH_CLANG_FORMAT_TRUE@ for FILE in $(ALL_SOURCE_FILES) ; do \ @WITH_CLANG_FORMAT_TRUE@ test -s $$FILE || continue ; \ @WITH_CLANG_FORMAT_TRUE@ $(CLANG_FORMAT) -style=file -output-replacements-xml "$$FILE" | grep "/dev/null && \ @WITH_CLANG_FORMAT_TRUE@ { echo "$$FILE is not correctly formatted" >&2 ; FAILED=1; } ; \ @WITH_CLANG_FORMAT_TRUE@ done; \ @WITH_CLANG_FORMAT_TRUE@ if test "$$FAILED" != 0 ; then \ @WITH_CLANG_FORMAT_TRUE@ exit 1 ; \ @WITH_CLANG_FORMAT_TRUE@ fi # Change source formatting @WITH_CLANG_FORMAT_TRUE@clang-format: $(ALL_SOURCE_FILES) @WITH_CLANG_FORMAT_TRUE@ $(CLANG_FORMAT) -style=file -i $(ALL_SOURCE_FILES) # Change source formatting AND report the diff @WITH_CLANG_FORMAT_TRUE@clang-format-diff: clang-format @WITH_CLANG_FORMAT_TRUE@ git diff $(ALL_SOURCE_FILES) @WITH_CLANG_FORMAT_FALSE@clang-format clang-format-check clang-format-diff: @WITH_CLANG_FORMAT_FALSE@ @echo "Install the clang-format program, reconfigure and re-run this request" @WITH_CLANG_FORMAT_FALSE@ @exit 1 @CODE_COVERAGE_RULES@ dist-hook: -rm $(distdir)/src/platform.hpp @if test -d "$(srcdir)/.git"; \ then \ echo Creating ChangeLog && \ ( cd "$(top_srcdir)" && \ echo '# Generated by Makefile. Do not edit.'; echo; \ $(top_srcdir)/config/missing --run git log --stat ) > ChangeLog.tmp \ && mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \ || ( rm -f ChangeLog.tmp ; \ echo Failed to generate ChangeLog >&2 ); \ else \ echo A git clone is required to generate a ChangeLog >&2; \ fi maintainer-clean-local: -rm -rf $(top_srcdir)/config @VALGRIND_CHECK_RULES@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: zeromq-4.2.5/tests/0000775000372000037200000000000013255253302015103 5ustar00travistravis00000000000000zeromq-4.2.5/tests/test_reqrep_ipc.cpp0000664000372000037200000000574613255253220021012 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" void test_leak (void) { char my_endpoint[256]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, "ipc://*"); assert (rc == 0); size_t len = sizeof (my_endpoint); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); rc = s_send (sc, "leakymsg"); assert (rc == strlen ("leakymsg")); char *buf = s_recv (sb); free (buf); rc = zmq_close (sc); assert (rc == 0); msleep (SETTLE_TIME); rc = s_send (sb, "leakymsg"); assert (rc == strlen ("leakymsg")); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_simple (void) { char my_endpoint[256]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, "ipc://*"); assert (rc == 0); size_t len = sizeof (my_endpoint); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_simple (); test_leak (); return 0; } zeromq-4.2.5/tests/testutil_security.hpp0000664000372000037200000005644713255253220021437 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __TESTUTIL_SECURITY_HPP_INCLUDED__ #define __TESTUTIL_SECURITY_HPP_INCLUDED__ #include "testutil.hpp" // security test utils typedef void(socket_config_fn) (void *, void *); const char *test_zap_domain = "ZAPTEST"; // NULL specific functions void socket_config_null_client (void *server, void *server_secret) { LIBZMQ_UNUSED (server); LIBZMQ_UNUSED (server_secret); } void socket_config_null_server (void *server, void *server_secret) { int rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, test_zap_domain, strlen (test_zap_domain)); assert (rc == 0); #ifdef ZMQ_ZAP_ENFORCE_DOMAIN int required = server_secret ? *(int *) server_secret : 0; rc = zmq_setsockopt (server, ZMQ_ZAP_ENFORCE_DOMAIN, &required, sizeof (int)); assert (rc == 0); #else LIBZMQ_UNUSED (server_secret); #endif } // PLAIN specific functions const char *test_plain_username = "testuser"; const char *test_plain_password = "testpass"; void socket_config_plain_client (void *server, void *server_secret) { LIBZMQ_UNUSED (server_secret); int rc = zmq_setsockopt (server, ZMQ_PLAIN_PASSWORD, test_plain_password, 8); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_PLAIN_USERNAME, test_plain_username, 8); assert (rc == 0); } void socket_config_plain_server (void *server, void *server_secret) { LIBZMQ_UNUSED (server_secret); int as_server = 1; int rc = zmq_setsockopt (server, ZMQ_PLAIN_SERVER, &as_server, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, test_zap_domain, strlen (test_zap_domain)); assert (rc == 0); } // CURVE specific functions // We'll generate random test keys at startup char valid_client_public[41]; char valid_client_secret[41]; char valid_server_public[41]; char valid_server_secret[41]; void setup_testutil_security_curve () { // Generate new keypairs for these tests int rc = zmq_curve_keypair (valid_client_public, valid_client_secret); assert (rc == 0); rc = zmq_curve_keypair (valid_server_public, valid_server_secret); assert (rc == 0); } void socket_config_curve_server (void *server, void *server_secret) { int as_server = 1; int rc = zmq_setsockopt (server, ZMQ_CURVE_SERVER, &as_server, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_CURVE_SECRETKEY, server_secret, 41); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, test_zap_domain, strlen (test_zap_domain)); assert (rc == 0); #ifdef ZMQ_ZAP_ENFORCE_DOMAIN int required = 1; rc = zmq_setsockopt (server, ZMQ_ZAP_ENFORCE_DOMAIN, &required, sizeof (int)); assert (rc == 0); #endif } struct curve_client_data_t { const char *server_public; const char *client_public; const char *client_secret; }; void socket_config_curve_client (void *client, void *data) { curve_client_data_t *curve_client_data = static_cast (data); int rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, curve_client_data->server_public, 41); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, curve_client_data->client_public, 41); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, curve_client_data->client_secret, 41); assert (rc == 0); } // -------------------------------------------------------------------------- // This methods receives and validates ZAP requests (allowing or denying // each client connection). enum zap_protocol_t { zap_ok, // ZAP-compliant non-standard cases zap_status_temporary_failure, zap_status_internal_error, // ZAP protocol errors zap_wrong_version, zap_wrong_request_id, zap_status_invalid, zap_too_many_parts, zap_disconnect, zap_do_not_recv, zap_do_not_send }; void *zap_requests_handled; void zap_handler_generic (void *ctx, zap_protocol_t zap_protocol, const char *expected_routing_id = "IDENT") { void *control = zmq_socket (ctx, ZMQ_REQ); assert (control); int rc = zmq_connect (control, "inproc://handler-control"); assert (rc == 0); void *handler = zmq_socket (ctx, ZMQ_REP); assert (handler); rc = zmq_bind (handler, "inproc://zeromq.zap.01"); assert (rc == 0); // Signal main thread that we are ready rc = s_send (control, "GO"); assert (rc == 2); zmq_pollitem_t items[] = { {control, 0, ZMQ_POLLIN, 0}, {handler, 0, ZMQ_POLLIN, 0}, }; // if ordered not to receive the request, ignore the second poll item const int numitems = (zap_protocol == zap_do_not_recv) ? 1 : 2; // Process ZAP requests forever while (zmq_poll (items, numitems, -1) >= 0) { if (items[0].revents & ZMQ_POLLIN) { char *buf = s_recv (control); assert (buf); assert (streq (buf, "STOP")); free (buf); break; // Terminating - main thread signal } if (!(items[1].revents & ZMQ_POLLIN)) continue; char *version = s_recv (handler); if (!version) break; // Terminating - peer's socket closed if (zap_protocol == zap_disconnect) { free (version); break; } char *sequence = s_recv (handler); char *domain = s_recv (handler); char *address = s_recv (handler); char *routing_id = s_recv (handler); char *mechanism = s_recv (handler); bool authentication_succeeded = false; if (streq (mechanism, "CURVE")) { uint8_t client_key[32]; int size = zmq_recv (handler, client_key, 32, 0); assert (size == 32); char client_key_text[41]; zmq_z85_encode (client_key_text, client_key, 32); authentication_succeeded = streq (client_key_text, valid_client_public); } else if (streq (mechanism, "PLAIN")) { char client_username[32]; int size = zmq_recv (handler, client_username, 32, 0); assert (size > 0); client_username[size] = 0; char client_password[32]; size = zmq_recv (handler, client_password, 32, 0); assert (size > 0); client_password[size] = 0; authentication_succeeded = streq (test_plain_username, client_username) && streq (test_plain_password, client_password); } else if (streq (mechanism, "NULL")) { authentication_succeeded = true; } else { fprintf (stderr, "Unsupported mechanism: %s\n", mechanism); assert (false); } assert (streq (version, "1.0")); assert (streq (routing_id, expected_routing_id)); s_sendmore (handler, zap_protocol == zap_wrong_version ? "invalid_version" : version); s_sendmore (handler, zap_protocol == zap_wrong_request_id ? "invalid_request_id" : sequence); if (authentication_succeeded) { const char *status_code; switch (zap_protocol) { case zap_status_internal_error: status_code = "500"; break; case zap_status_temporary_failure: status_code = "300"; break; case zap_status_invalid: status_code = "invalid_status"; break; default: status_code = "200"; } s_sendmore (handler, status_code); s_sendmore (handler, "OK"); s_sendmore (handler, "anonymous"); if (zap_protocol == zap_too_many_parts) { s_sendmore (handler, ""); } if (zap_protocol != zap_do_not_send) s_send (handler, ""); } else { s_sendmore (handler, "400"); s_sendmore (handler, "Invalid client public key"); s_sendmore (handler, ""); if (zap_protocol != zap_do_not_send) s_send (handler, ""); } free (version); free (sequence); free (domain); free (address); free (routing_id); free (mechanism); zmq_atomic_counter_inc (zap_requests_handled); } rc = zmq_unbind (handler, "inproc://zeromq.zap.01"); assert (rc == 0); close_zero_linger (handler); if (zap_protocol != zap_disconnect) { rc = s_send (control, "STOPPED"); assert (rc == 7); } close_zero_linger (control); } void zap_handler (void *ctx) { zap_handler_generic (ctx, zap_ok); } // Monitor event utilities // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. static int get_monitor_event_internal (void *monitor, int *value, char **address, int recv_flag) { // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, recv_flag) == -1) { assert (errno == EAGAIN); return -1; // timed out or no message available } assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); if (value) *value = *(uint32_t *) (data + 2); // Second frame in message contains event address zmq_msg_init (&msg); int res = zmq_msg_recv (&msg, monitor, recv_flag) == -1; assert (res != -1); assert (!zmq_msg_more (&msg)); if (address) { uint8_t *data = (uint8_t *) zmq_msg_data (&msg); size_t size = zmq_msg_size (&msg); *address = (char *) malloc (size + 1); memcpy (*address, data, size); *address[size] = 0; } return event; } int get_monitor_event_with_timeout (void *monitor, int *value, char **address, int timeout) { int res; if (timeout == -1) { // process infinite timeout in small steps to allow the user // to see some information on the console int timeout_step = 250; int wait_time = 0; zmq_setsockopt (monitor, ZMQ_RCVTIMEO, &timeout_step, sizeof (timeout_step)); while ((res = get_monitor_event_internal (monitor, value, address, 0)) == -1) { wait_time += timeout_step; fprintf (stderr, "Still waiting for monitor event after %i ms\n", wait_time); } } else { zmq_setsockopt (monitor, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); res = get_monitor_event_internal (monitor, value, address, 0); } int timeout_infinite = -1; zmq_setsockopt (monitor, ZMQ_RCVTIMEO, &timeout_infinite, sizeof (timeout_infinite)); return res; } int get_monitor_event (void *monitor, int *value, char **address) { return get_monitor_event_with_timeout (monitor, value, address, -1); } void expect_monitor_event (void *monitor, int expected_event) { int event = get_monitor_event (monitor, NULL, NULL); if (event != expected_event) { fprintf (stderr, "Expected monitor event %x but received %x\n", expected_event, event); assert (event == expected_event); } } #ifdef ZMQ_BUILD_DRAFT_API void print_unexpected_event (int event, int err, int expected_event, int expected_err) { fprintf (stderr, "Unexpected event: 0x%x, value = %i/0x%x (expected: 0x%x, value " "= %i/0x%x)\n", event, err, err, expected_event, expected_err, expected_err); } // expects that one or more occurrences of the expected event are received // via the specified socket monitor // returns the number of occurrences of the expected event // interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL with EPIPE, ECONNRESET // or ECONNABORTED occurs; in this case, 0 is returned // this should be investigated further, see // https://github.com/zeromq/libzmq/issues/2644 int expect_monitor_event_multiple (void *server_mon, int expected_event, int expected_err = -1, bool optional = false) { int count_of_expected_events = 0; int client_closed_connection = 0; int timeout = 250; int wait_time = 0; int event; int err; while ( (event = get_monitor_event_with_timeout (server_mon, &err, NULL, timeout)) != -1 || !count_of_expected_events) { if (event == -1) { if (optional) break; wait_time += timeout; fprintf (stderr, "Still waiting for first event after %ims (expected event " "%x (value %i/0x%x))\n", wait_time, expected_event, expected_err, expected_err); continue; } // ignore errors with EPIPE/ECONNRESET/ECONNABORTED, which can happen // ECONNRESET can happen on very slow machines, when the engine writes // to the peer and then tries to read the socket before the peer reads // ECONNABORTED happens when a client aborts a connection via RST/timeout if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL && ((err == EPIPE && expected_err != EPIPE) || err == ECONNRESET || err == ECONNABORTED)) { fprintf (stderr, "Ignored event (skipping any further events): %x (err = " "%i == %s)\n", event, err, zmq_strerror (err)); client_closed_connection = 1; break; } if (event != expected_event || (-1 != expected_err && err != expected_err)) { print_unexpected_event (event, err, expected_event, expected_err); assert (false); } ++count_of_expected_events; } assert (optional || count_of_expected_events > 0 || client_closed_connection); return count_of_expected_events; } // assert_* are macros rather than functions, to allow assertion failures be // attributed to the causing source code line #define assert_no_more_monitor_events_with_timeout(monitor, timeout) \ { \ int event_count = 0; \ int event, err; \ while ((event = get_monitor_event_with_timeout ((monitor), &err, NULL, \ (timeout))) \ != -1) { \ if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL \ && (err == EPIPE || err == ECONNRESET \ || err == ECONNABORTED)) { \ fprintf (stderr, \ "Ignored event (skipping any further events): %x " \ "(err = %i == %s)\n", \ event, err, zmq_strerror (err)); \ continue; \ } \ ++event_count; \ print_unexpected_event (event, err, 0, 0); \ } \ assert (event_count == 0); \ } #endif void setup_handshake_socket_monitor (void *ctx, void *server, void **server_mon, const char *monitor_endpoint) { #ifdef ZMQ_BUILD_DRAFT_API // Monitor handshake events on the server int rc = zmq_socket_monitor (server, monitor_endpoint, ZMQ_EVENT_HANDSHAKE_SUCCEEDED | ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL | ZMQ_EVENT_HANDSHAKE_FAILED_AUTH | ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL); assert (rc == 0); // Create socket for collecting monitor events *server_mon = zmq_socket (ctx, ZMQ_PAIR); assert (*server_mon); int linger = 0; rc = zmq_setsockopt (*server_mon, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); // Connect it to the inproc endpoints so they'll get events rc = zmq_connect (*server_mon, monitor_endpoint); assert (rc == 0); #endif } void setup_context_and_server_side ( void **ctx, void **zap_control, void **zap_thread, void **server, void **server_mon, char *my_endpoint, zmq_thread_fn zap_handler_ = &zap_handler, socket_config_fn socket_config_ = &socket_config_curve_server, void *socket_config_data_ = valid_server_secret, const char *routing_id = "IDENT") { *ctx = zmq_ctx_new (); assert (*ctx); // Spawn ZAP handler zap_requests_handled = zmq_atomic_counter_new (); assert (zap_requests_handled != NULL); *zap_control = zmq_socket (*ctx, ZMQ_REP); assert (*zap_control); int rc = zmq_bind (*zap_control, "inproc://handler-control"); assert (rc == 0); int linger = 0; rc = zmq_setsockopt (*zap_control, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); if (zap_handler_) { *zap_thread = zmq_threadstart (zap_handler_, *ctx); char *buf = s_recv (*zap_control); assert (buf); assert (streq (buf, "GO")); free (buf); } else *zap_thread = NULL; // Server socket will accept connections *server = zmq_socket (*ctx, ZMQ_DEALER); assert (*server); rc = zmq_setsockopt (*server, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); socket_config_ (*server, socket_config_data_); rc = zmq_setsockopt (*server, ZMQ_ROUTING_ID, routing_id, strlen (routing_id)); assert (rc == 0); rc = zmq_bind (*server, "tcp://127.0.0.1:*"); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (*server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); const char server_monitor_endpoint[] = "inproc://monitor-server"; setup_handshake_socket_monitor (*ctx, *server, server_mon, server_monitor_endpoint); } void shutdown_context_and_server_side (void *ctx, void *zap_thread, void *server, void *server_mon, void *zap_control, bool zap_handler_stopped = false) { if (zap_thread && !zap_handler_stopped) { int rc = s_send (zap_control, "STOP"); assert (rc == 4); char *buf = s_recv (zap_control); assert (buf); assert (streq (buf, "STOPPED")); free (buf); rc = zmq_unbind (zap_control, "inproc://handler-control"); assert (rc == 0); } int rc = zmq_close (zap_control); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API rc = zmq_close (server_mon); assert (rc == 0); #endif rc = zmq_close (server); assert (rc == 0); // Wait until ZAP handler terminates if (zap_thread) zmq_threadclose (zap_thread); rc = zmq_ctx_term (ctx); assert (rc == 0); zmq_atomic_counter_destroy (&zap_requests_handled); } void *create_and_connect_client (void *ctx, char *my_endpoint, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon = NULL) { void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); socket_config_ (client, socket_config_data_); int rc = zmq_connect (client, my_endpoint); assert (rc == 0); if (client_mon) { setup_handshake_socket_monitor (ctx, client, client_mon, "inproc://client-monitor"); } return client; } void expect_new_client_bounce_fail (void *ctx, char *my_endpoint, void *server, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon = NULL, int expected_client_event = 0, int expected_client_value = 0) { void *my_client_mon; assert (client_mon == NULL || expected_client_event == 0); if (expected_client_event != 0) client_mon = &my_client_mon; void *client = create_and_connect_client (ctx, my_endpoint, socket_config_, socket_config_data_, client_mon); expect_bounce_fail (server, client); #ifdef ZMQ_BUILD_DRAFT_API if (expected_client_event != 0) { int events_received = 0; events_received = expect_monitor_event_multiple ( my_client_mon, expected_client_event, expected_client_value, false); assert (events_received == 1); int rc = zmq_close (my_client_mon); assert (rc == 0); } #endif close_zero_linger (client); } #endif zeromq-4.2.5/tests/test_spec_rep.cpp0000664000372000037200000001224113255253220020445 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *bind_address = 0; char connect_address[MAX_SOCKET_STRING]; void test_fair_queue_in (void *ctx) { void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); int timeout = 250; int rc = zmq_setsockopt (rep, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_bind (rep, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (rep, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *reqs[services]; for (size_t peer = 0; peer < services; ++peer) { reqs[peer] = zmq_socket (ctx, ZMQ_REQ); assert (reqs[peer]); rc = zmq_setsockopt (reqs[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (reqs[peer], connect_address); assert (rc == 0); } msleep (SETTLE_TIME); s_send_seq (reqs[0], "A", SEQ_END); s_recv_seq (rep, "A", SEQ_END); s_send_seq (rep, "A", SEQ_END); s_recv_seq (reqs[0], "A", SEQ_END); s_send_seq (reqs[0], "A", SEQ_END); s_recv_seq (rep, "A", SEQ_END); s_send_seq (rep, "A", SEQ_END); s_recv_seq (reqs[0], "A", SEQ_END); // TODO: following test fails randomly on some boxes #ifdef SOMEONE_FIXES_THIS // send N requests for (size_t peer = 0; peer < services; ++peer) { char *str = strdup ("A"); str[0] += peer; s_send_seq (reqs[peer], str, SEQ_END); free (str); } // handle N requests for (size_t peer = 0; peer < services; ++peer) { char *str = strdup ("A"); str[0] += peer; // Test fails here s_recv_seq (rep, str, SEQ_END); s_send_seq (rep, str, SEQ_END); s_recv_seq (reqs[peer], str, SEQ_END); free (str); } #endif close_zero_linger (rep); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (reqs[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_envelope (void *ctx) { void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); int rc = zmq_bind (rep, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (rep, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_connect (dealer, connect_address); assert (rc == 0); // minimal envelope s_send_seq (dealer, 0, "A", SEQ_END); s_recv_seq (rep, "A", SEQ_END); s_send_seq (rep, "A", SEQ_END); s_recv_seq (dealer, 0, "A", SEQ_END); // big envelope s_send_seq (dealer, "X", "Y", 0, "A", SEQ_END); s_recv_seq (rep, "A", SEQ_END); s_send_seq (rep, "A", SEQ_END); s_recv_seq (dealer, "X", "Y", 0, "A", SEQ_END); close_zero_linger (rep); close_zero_linger (dealer); // Wait for disconnects. msleep (SETTLE_TIME); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); const char *binds[] = {"inproc://a", "tcp://127.0.0.1:*"}; for (int transport = 0; transport < 2; ++transport) { bind_address = binds[transport]; // SHALL receive incoming messages from its peers using a fair-queuing // strategy. test_fair_queue_in (ctx); // For an incoming message: // SHALL remove and store the address envelope, including the delimiter. // SHALL pass the remaining data frames to its calling application. // SHALL wait for a single reply message from its calling application. // SHALL prepend the address envelope and delimiter. // SHALL deliver this message back to the originating peer. test_envelope (ctx); } int rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_security_curve.cpp0000664000372000037200000005326213255253220021730 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_security.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket #else #include #include #include #include #endif #include #include "../src/tweetnacl.h" #include "../src/curve_client_tools.hpp" #include "../src/random.hpp" char error_message_buffer[256]; #if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif const char *zmq_errno_message () { snprintf (error_message_buffer, sizeof (error_message_buffer), "errno=%i (%s)", zmq_errno (), zmq_strerror (zmq_errno ())); return error_message_buffer; } #define TEST_ASSERT_ZMQ_ERRNO(condition) \ TEST_ASSERT_MESSAGE ((condition), zmq_errno_message ()) void *ctx; void *handler; void *zap_thread; void *server; void *server_mon; char my_endpoint[MAX_SOCKET_STRING]; void setUp () { setup_context_and_server_side (&ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint); } void tearDown () { shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); } const int timeout = 250; const char large_routing_id[] = "0123456789012345678901234567890123456789" "0123456789012345678901234567890123456789" "0123456789012345678901234567890123456789" "0123456789012345678901234567890123456789" "0123456789012345678901234567890123456789" "0123456789012345678901234567890123456789" "012345678901234"; static void zap_handler_large_routing_id (void *ctx) { zap_handler_generic (ctx, zap_ok, large_routing_id); } void expect_new_client_curve_bounce_fail (void *ctx, char *server_public, char *client_public, char *client_secret, char *my_endpoint, void *server, void **client_mon = NULL, int expected_client_event = 0, int expected_client_value = 0) { curve_client_data_t curve_client_data = {server_public, client_public, client_secret}; expect_new_client_bounce_fail ( ctx, my_endpoint, server, socket_config_curve_client, &curve_client_data, client_mon, expected_client_event, expected_client_value); } void test_null_key (void *ctx, void *server, void *server_mon, char *my_endpoint, char *server_public, char *client_public, char *client_secret) { expect_new_client_curve_bounce_fail (ctx, server_public, client_public, client_secret, my_endpoint, server); #ifdef ZMQ_BUILD_DRAFT_API int handshake_failed_encryption_event_count = expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); // handshake_failed_encryption_event_count should be at least two because // expect_bounce_fail involves two exchanges // however, with valgrind we see only one event (maybe the next one takes // very long, or does not happen at all because something else takes very // long) fprintf (stderr, "count of " "ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL/" "ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC events: %i\n", handshake_failed_encryption_event_count); #endif } void test_curve_security_with_valid_credentials () { curve_client_data_t curve_client_data = { valid_server_public, valid_client_public, valid_client_secret}; void *client_mon; void *client = create_and_connect_client (ctx, my_endpoint, socket_config_curve_client, &curve_client_data, &client_mon); bounce (server, client); int rc = zmq_close (client); TEST_ASSERT_ZMQ_ERRNO (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API int event = get_monitor_event_with_timeout (server_mon, NULL, NULL, -1); assert (event == ZMQ_EVENT_HANDSHAKE_SUCCEEDED); assert_no_more_monitor_events_with_timeout (server_mon, timeout); event = get_monitor_event_with_timeout (client_mon, NULL, NULL, -1); assert (event == ZMQ_EVENT_HANDSHAKE_SUCCEEDED); assert_no_more_monitor_events_with_timeout (client_mon, timeout); rc = zmq_close (client_mon); TEST_ASSERT_ZMQ_ERRNO (rc == 0); #endif } void test_curve_security_with_bogus_client_credentials () { // This must be caught by the ZAP handler char bogus_public[41]; char bogus_secret[41]; zmq_curve_keypair (bogus_public, bogus_secret); expect_new_client_curve_bounce_fail (ctx, valid_server_public, bogus_public, bogus_secret, my_endpoint, server, NULL, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, 400 #else 0, 0 #endif ); int server_event_count = 0; #ifdef ZMQ_BUILD_DRAFT_API server_event_count = expect_monitor_event_multiple ( server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, 400); TEST_ASSERT_LESS_OR_EQUAL_INT (1, server_event_count); #endif // there may be more than one ZAP request due to repeated attempts by the client TEST_ASSERT (0 == server_event_count || 1 <= zmq_atomic_counter_value (zap_requests_handled)); } void expect_zmtp_mechanism_mismatch (void *client, char *my_endpoint, void *server, void *server_mon) { // This must be caught by the curve_server class, not passed to ZAP int rc = zmq_connect (client, my_endpoint); TEST_ASSERT_ZMQ_ERRNO (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH); #endif TEST_ASSERT_EQUAL_INT (0, zmq_atomic_counter_value (zap_requests_handled)); } void test_curve_security_with_null_client_credentials () { void *client = zmq_socket (ctx, ZMQ_DEALER); TEST_ASSERT_NOT_NULL (client); expect_zmtp_mechanism_mismatch (client, my_endpoint, server, server_mon); } void test_curve_security_with_plain_client_credentials () { void *client = zmq_socket (ctx, ZMQ_DEALER); TEST_ASSERT_NOT_NULL (client); int rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, "admin", 5); TEST_ASSERT_ZMQ_ERRNO (rc == 0); rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, "password", 8); TEST_ASSERT_ZMQ_ERRNO (rc == 0); expect_zmtp_mechanism_mismatch (client, my_endpoint, server, server_mon); } int connect_vanilla_socket (char *my_endpoint) { int s; struct sockaddr_in ip4addr; unsigned short int port; int rc = sscanf (my_endpoint, "tcp://127.0.0.1:%hu", &port); TEST_ASSERT_EQUAL_INT (1, rc); ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons (port); #if defined(ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600) ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1"); #else inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #endif s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); rc = connect (s, (struct sockaddr *) &ip4addr, sizeof (ip4addr)); TEST_ASSERT_GREATER_THAN_INT (-1, rc); return s; } void test_curve_security_unauthenticated_message () { // Unauthenticated messages from a vanilla socket shouldn't be received int s = connect_vanilla_socket (my_endpoint); // send anonymous ZMTP/1.0 greeting send (s, "\x01\x00", 2, 0); // send sneaky message that shouldn't be received send (s, "\x08\x00sneaky\0", 9, 0); zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); char *buf = s_recv (server); TEST_ASSERT_NULL_MESSAGE (buf, "Received unauthenticated message"); close (s); } void send_all (int fd, const char *data, size_t size) { while (size > 0) { int res = send (fd, data, size, 0); TEST_ASSERT_GREATER_THAN_INT (0, res); size -= res; data += res; } } template void send (int fd, const char (&data)[N]) { send_all (fd, data, N - 1); } void send_greeting (int s) { send (s, "\xff\0\0\0\0\0\0\0\0\x7f"); // signature send (s, "\x03\x00"); // version 3.0 send (s, "CURVE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); // mechanism CURVE send (s, "\0"); // as-server == false send (s, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); } void test_curve_security_invalid_hello_wrong_length () { int s = connect_vanilla_socket (my_endpoint); // send GREETING send_greeting (s); // send CURVE HELLO of wrong size send (s, "\x04\x06\x05HELLO"); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple ( server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); #endif close (s); } const size_t hello_length = 200; const size_t welcome_length = 168; zmq::curve_client_tools_t make_curve_client_tools () { uint8_t valid_client_secret_decoded[32]; uint8_t valid_client_public_decoded[32]; zmq_z85_decode (valid_client_public_decoded, valid_client_public); zmq_z85_decode (valid_client_secret_decoded, valid_client_secret); uint8_t valid_server_public_decoded[32]; zmq_z85_decode (valid_server_public_decoded, valid_server_public); return zmq::curve_client_tools_t (valid_client_public_decoded, valid_client_secret_decoded, valid_server_public_decoded); } #ifndef htonll uint64_t htonll (uint64_t value) { // The answer is 42 static const int num = 42; // Check the endianness if (*reinterpret_cast (&num) == num) { const uint32_t high_part = htonl (static_cast (value >> 32)); const uint32_t low_part = htonl (static_cast (value & 0xFFFFFFFFLL)); return (static_cast (low_part) << 32) | high_part; } else { return value; } } #endif template void send_command (int s, char (&command)[N]) { if (N < 256) { send (s, "\x04"); char len = (char) N; send_all (s, &len, 1); } else { send (s, "\x06"); uint64_t len = htonll (N); send_all (s, (char *) &len, 8); } send_all (s, command, N); } void test_curve_security_invalid_hello_command_name () { int s = connect_vanilla_socket (my_endpoint); send_greeting (s); zmq::curve_client_tools_t tools = make_curve_client_tools (); // send CURVE HELLO with a misspelled command name (but otherwise correct) char hello[hello_length]; int rc = tools.produce_hello (hello, 0); TEST_ASSERT_ZMQ_ERRNO (rc == 0); hello[5] = 'X'; send_command (s, hello); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); #endif close (s); } void test_curve_security_invalid_hello_version () { int s = connect_vanilla_socket (my_endpoint); send_greeting (s); zmq::curve_client_tools_t tools = make_curve_client_tools (); // send CURVE HELLO with a wrong version number (but otherwise correct) char hello[hello_length]; int rc = tools.produce_hello (hello, 0); TEST_ASSERT_ZMQ_ERRNO (rc == 0); hello[6] = 2; send_command (s, hello); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple ( server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); #endif close (s); } void flush_read (int fd) { int res; char buf[256]; while ((res = recv (fd, buf, 256, 0)) == 256) { } TEST_ASSERT_NOT_EQUAL (-1, res); } void recv_all (int fd, uint8_t *data, size_t len) { size_t received = 0; while (received < len) { int res = recv (fd, (char *) data, len, 0); TEST_ASSERT_GREATER_THAN_INT (0, res); data += res; received += res; } } void recv_greeting (int fd) { uint8_t greeting[64]; recv_all (fd, greeting, 64); // TODO assert anything about the greeting received from the server? } int connect_exchange_greeting_and_send_hello (char *my_endpoint, zmq::curve_client_tools_t &tools) { int s = connect_vanilla_socket (my_endpoint); send_greeting (s); recv_greeting (s); // send valid CURVE HELLO char hello[hello_length]; int rc = tools.produce_hello (hello, 0); TEST_ASSERT_ZMQ_ERRNO (rc == 0); send_command (s, hello); return s; } void test_curve_security_invalid_initiate_wrong_length () { zmq::curve_client_tools_t tools = make_curve_client_tools (); int s = connect_exchange_greeting_and_send_hello (my_endpoint, tools); // receive but ignore WELCOME flush_read (s); #ifdef ZMQ_BUILD_DRAFT_API int res = get_monitor_event_with_timeout (server_mon, NULL, NULL, timeout); TEST_ASSERT_EQUAL_INT (-1, res); #else LIBZMQ_UNUSED (timeout); #endif send (s, "\x04\x09\x08INITIATE"); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple ( server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE); #endif close (s); } int connect_exchange_greeting_and_hello_welcome ( char *my_endpoint, void *server_mon, int timeout, zmq::curve_client_tools_t &tools) { int s = connect_exchange_greeting_and_send_hello (my_endpoint, tools); // receive but ignore WELCOME uint8_t welcome[welcome_length + 2]; recv_all (s, welcome, welcome_length + 2); uint8_t cn_precom[crypto_box_BEFORENMBYTES]; int res = tools.process_welcome (welcome + 2, welcome_length, cn_precom); TEST_ASSERT_ZMQ_ERRNO (res == 0); #ifdef ZMQ_BUILD_DRAFT_API res = get_monitor_event_with_timeout (server_mon, NULL, NULL, timeout); TEST_ASSERT_EQUAL_INT (-1, res); #endif return s; } void test_curve_security_invalid_initiate_command_name () { zmq::curve_client_tools_t tools = make_curve_client_tools (); int s = connect_exchange_greeting_and_hello_welcome ( my_endpoint, server_mon, timeout, tools); char initiate[257]; tools.produce_initiate (initiate, 257, 1, NULL, 0); // modify command name initiate[5] = 'X'; send_command (s, initiate); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); #endif close (s); } void test_curve_security_invalid_initiate_command_encrypted_cookie () { zmq::curve_client_tools_t tools = make_curve_client_tools (); int s = connect_exchange_greeting_and_hello_welcome ( my_endpoint, server_mon, timeout, tools); char initiate[257]; tools.produce_initiate (initiate, 257, 1, NULL, 0); // make garbage from encrypted cookie initiate[30] = !initiate[30]; send_command (s, initiate); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); #endif close (s); } void test_curve_security_invalid_initiate_command_encrypted_content () { zmq::curve_client_tools_t tools = make_curve_client_tools (); int s = connect_exchange_greeting_and_hello_welcome ( my_endpoint, server_mon, timeout, tools); char initiate[257]; tools.produce_initiate (initiate, 257, 1, NULL, 0); // make garbage from encrypted content initiate[150] = !initiate[150]; send_command (s, initiate); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event_multiple (server_mon, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); #endif close (s); } void test_curve_security_invalid_keysize (void *ctx) { // Check return codes for invalid buffer sizes void *client = zmq_socket (ctx, ZMQ_DEALER); TEST_ASSERT_NOT_NULL (client); errno = 0; int rc = zmq_setsockopt (client, ZMQ_CURVE_SERVERKEY, valid_server_public, 123); assert (rc == -1 && errno == EINVAL); errno = 0; rc = zmq_setsockopt (client, ZMQ_CURVE_PUBLICKEY, valid_client_public, 123); assert (rc == -1 && errno == EINVAL); errno = 0; rc = zmq_setsockopt (client, ZMQ_CURVE_SECRETKEY, valid_client_secret, 123); assert (rc == -1 && errno == EINVAL); rc = zmq_close (client); TEST_ASSERT_ZMQ_ERRNO (rc == 0); } // TODO why isn't this const? char null_key[] = "0000000000000000000000000000000000000000"; void test_null_server_key () { // Check CURVE security with a null server key // This will be caught by the curve_server class, not passed to ZAP test_null_key (ctx, server, server_mon, my_endpoint, null_key, valid_client_public, valid_client_secret); } void test_null_client_public_key () { // Check CURVE security with a null client public key // This will be caught by the curve_server class, not passed to ZAP test_null_key (ctx, server, server_mon, my_endpoint, valid_server_public, null_key, valid_client_secret); } void test_null_client_secret_key () { // Check CURVE security with a null client public key // This will be caught by the curve_server class, not passed to ZAP test_null_key (ctx, server, server_mon, my_endpoint, valid_server_public, valid_client_public, null_key); } int main (void) { if (!zmq_has ("curve")) { printf ("CURVE encryption not installed, skipping test\n"); return 0; } zmq::random_open (); setup_testutil_security_curve (); setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_curve_security_with_valid_credentials); RUN_TEST (test_null_server_key); RUN_TEST (test_null_client_public_key); RUN_TEST (test_null_client_secret_key); RUN_TEST (test_curve_security_with_bogus_client_credentials); RUN_TEST (test_curve_security_with_null_client_credentials); RUN_TEST (test_curve_security_with_plain_client_credentials); RUN_TEST (test_curve_security_unauthenticated_message); // tests with misbehaving CURVE client RUN_TEST (test_curve_security_invalid_hello_wrong_length); RUN_TEST (test_curve_security_invalid_hello_command_name); RUN_TEST (test_curve_security_invalid_hello_version); RUN_TEST (test_curve_security_invalid_initiate_wrong_length); RUN_TEST (test_curve_security_invalid_initiate_command_name); RUN_TEST (test_curve_security_invalid_initiate_command_encrypted_cookie); RUN_TEST (test_curve_security_invalid_initiate_command_encrypted_content); // TODO this requires a deviating test setup, must be moved to a separate executable/fixture // test with a large routing id (resulting in large metadata) fprintf (stderr, "test_curve_security_with_valid_credentials (large routing id)\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_large_routing_id, &socket_config_curve_server, &valid_server_secret, large_routing_id); test_curve_security_with_valid_credentials (); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); ctx = zmq_ctx_new (); test_curve_security_invalid_keysize (ctx); int rc = zmq_ctx_term (ctx); TEST_ASSERT_ZMQ_ERRNO (rc == 0); zmq::random_close (); return UNITY_END (); } zeromq-4.2.5/tests/test_spec_pushpull.cpp0000664000372000037200000002077313255253220021544 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *bind_address = 0; char connect_address[MAX_SOCKET_STRING]; void test_push_round_robin_out (void *ctx) { void *push = zmq_socket (ctx, ZMQ_PUSH); assert (push); int rc = zmq_bind (push, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (push, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *pulls[services]; for (size_t peer = 0; peer < services; ++peer) { pulls[peer] = zmq_socket (ctx, ZMQ_PULL); assert (pulls[peer]); int timeout = 250; rc = zmq_setsockopt (pulls[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (pulls[peer], connect_address); assert (rc == 0); } // Wait for connections. msleep (SETTLE_TIME); // Send 2N messages for (size_t peer = 0; peer < services; ++peer) s_send_seq (push, "ABC", SEQ_END); for (size_t peer = 0; peer < services; ++peer) s_send_seq (push, "DEF", SEQ_END); // Expect every PULL got one of each for (size_t peer = 0; peer < services; ++peer) { s_recv_seq (pulls[peer], "ABC", SEQ_END); s_recv_seq (pulls[peer], "DEF", SEQ_END); } close_zero_linger (push); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (pulls[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_pull_fair_queue_in (void *ctx) { void *pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); int rc = zmq_bind (pull, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *pushs[services]; for (size_t peer = 0; peer < services; ++peer) { pushs[peer] = zmq_socket (ctx, ZMQ_PUSH); assert (pushs[peer]); rc = zmq_connect (pushs[peer], connect_address); assert (rc == 0); } // Wait for connections. msleep (SETTLE_TIME); int first_half = 0; int second_half = 0; // Send 2N messages for (size_t peer = 0; peer < services; ++peer) { char *str = strdup ("A"); str[0] += peer; s_send_seq (pushs[peer], str, SEQ_END); first_half += str[0]; str[0] += services; s_send_seq (pushs[peer], str, SEQ_END); second_half += str[0]; free (str); } // Wait for data. msleep (SETTLE_TIME); zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); // Expect to pull one from each first for (size_t peer = 0; peer < services; ++peer) { rc = zmq_msg_recv (&msg, pull, 0); assert (rc == 2); const char *str = (const char *) zmq_msg_data (&msg); first_half -= str[0]; } assert (first_half == 0); // And then get the second batch for (size_t peer = 0; peer < services; ++peer) { rc = zmq_msg_recv (&msg, pull, 0); assert (rc == 2); const char *str = (const char *) zmq_msg_data (&msg); second_half -= str[0]; } assert (second_half == 0); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (pull); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (pushs[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_push_block_on_send_no_peers (void *ctx) { void *sc = zmq_socket (ctx, ZMQ_PUSH); assert (sc); int timeout = 250; int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); assert (rc == 0); rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_send (sc, 0, 0, 0); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_close (sc); assert (rc == 0); } void test_destroy_queue_on_disconnect (void *ctx) { void *A = zmq_socket (ctx, ZMQ_PUSH); assert (A); int hwm = 1; int rc = zmq_setsockopt (A, ZMQ_SNDHWM, &hwm, sizeof (hwm)); assert (rc == 0); rc = zmq_bind (A, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (A, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); void *B = zmq_socket (ctx, ZMQ_PULL); assert (B); rc = zmq_setsockopt (B, ZMQ_RCVHWM, &hwm, sizeof (hwm)); assert (rc == 0); rc = zmq_connect (B, connect_address); assert (rc == 0); // Send two messages, one should be stuck in A's outgoing queue, the other // arrives at B. s_send_seq (A, "ABC", SEQ_END); s_send_seq (A, "DEF", SEQ_END); // Both queues should now be full, indicated by A blocking on send. rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_disconnect (B, connect_address); assert (rc == 0); // Disconnect may take time and need command processing. zmq_pollitem_t poller[2] = {{A, 0, 0, 0}, {B, 0, 0, 0}}; rc = zmq_poll (poller, 2, 100); assert (rc == 0); rc = zmq_poll (poller, 2, 100); assert (rc == 0); zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); // Can't receive old data on B. rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Sending fails. rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Reconnect B rc = zmq_connect (B, connect_address); assert (rc == 0); // Still can't receive old data on B. rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // two messages should be sendable before the queues are filled up. s_send_seq (A, "ABC", SEQ_END); s_send_seq (A, "DEF", SEQ_END); rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (A); close_zero_linger (B); // Wait for disconnects. msleep (SETTLE_TIME); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); const char *binds[] = {"inproc://a", "tcp://127.0.0.1:*"}; for (int transport = 0; transport < 2; ++transport) { bind_address = binds[transport]; // PUSH: SHALL route outgoing messages to connected peers using a // round-robin strategy. test_push_round_robin_out (ctx); // PULL: SHALL receive incoming messages from its peers using a fair-queuing // strategy. test_pull_fair_queue_in (ctx); // PUSH: SHALL block on sending, or return a suitable error, when it has no // available peers. test_push_block_on_send_no_peers (ctx); // PUSH and PULL: SHALL create this queue when a peer connects to it. If // this peer disconnects, the socket SHALL destroy its queue and SHALL // discard any messages it contains. // *** Test disabled until libzmq does this properly *** // test_destroy_queue_on_disconnect (ctx); } int rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_stream_exceeds_buffer.cpp0000664000372000037200000000774613255253220023207 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket #endif int main () { const int msgsize = 8193; char sndbuf[msgsize] = "\xde\xad\xbe\xef"; unsigned char rcvbuf[msgsize]; char my_endpoint[MAX_SOCKET_STRING]; int server_sock = socket (AF_INET, SOCK_STREAM, 0); assert (server_sock != -1); int enable = 1; int rc = setsockopt (server_sock, SOL_SOCKET, SO_REUSEADDR, (char *) &enable, sizeof (enable)); assert (rc != -1); struct sockaddr_in saddr; memset (&saddr, 0, sizeof (saddr)); saddr.sin_family = AF_INET; saddr.sin_addr.s_addr = INADDR_ANY; #if !defined(_WIN32_WINNT) || (_WIN32_WINNT >= 0x0600) saddr.sin_port = 0; #else saddr.sin_port = htons (12345); #endif rc = bind (server_sock, (struct sockaddr *) &saddr, sizeof (saddr)); assert (rc != -1); rc = listen (server_sock, 1); assert (rc != -1); #if !defined(_WIN32_WINNT) || (_WIN32_WINNT >= 0x0600) socklen_t saddr_len = sizeof (saddr); rc = getsockname (server_sock, (struct sockaddr *) &saddr, &saddr_len); assert (rc != -1); #endif sprintf (my_endpoint, "tcp://127.0.0.1:%d", ntohs (saddr.sin_port)); void *zctx = zmq_ctx_new (); assert (zctx); void *zsock = zmq_socket (zctx, ZMQ_STREAM); assert (zsock); rc = zmq_connect (zsock, my_endpoint); assert (rc != -1); int client_sock = accept (server_sock, NULL, NULL); assert (client_sock != -1); rc = close (server_sock); assert (rc != -1); rc = send (client_sock, sndbuf, msgsize, 0); assert (rc == msgsize); zmq_msg_t msg; zmq_msg_init (&msg); int rcvbytes = 0; while (rcvbytes == 0) // skip connection notification, if any { rc = zmq_msg_recv (&msg, zsock, 0); // peerid assert (rc != -1); assert (zmq_msg_more (&msg)); rcvbytes = zmq_msg_recv (&msg, zsock, 0); assert (rcvbytes != -1); assert (!zmq_msg_more (&msg)); } // for this test, we only collect the first chunk // since the corruption already occurs in the first chunk memcpy (rcvbuf, zmq_msg_data (&msg), zmq_msg_size (&msg)); zmq_msg_close (&msg); zmq_close (zsock); close (client_sock); zmq_ctx_destroy (zctx); assert (rcvbytes >= 4); // notice that only the 1st byte gets corrupted assert (rcvbuf[3] == 0xef); assert (rcvbuf[2] == 0xbe); assert (rcvbuf[1] == 0xad); assert (rcvbuf[0] == 0xde); (void) (rc); // avoid -Wunused-but-set-variable warning in release build } zeromq-4.2.5/tests/test_ctx_options.cpp0000664000372000037200000002230313255253220021216 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include "testutil.hpp" #define WAIT_FOR_BACKGROUND_THREAD_INSPECTION (0) #ifdef ZMQ_HAVE_LINUX #include #include #include // for sleep() #define TEST_POLICY \ (SCHED_OTHER) // NOTE: SCHED_OTHER is the default Linux scheduler bool is_allowed_to_raise_priority () { // NOTE1: if setrlimit() fails with EPERM, this means that current user has not enough permissions. // NOTE2: even for privileged users (e.g., root) getrlimit() would usually return 0 as nice limit; the only way to // discover if the user is able to increase the nice value is to actually try to change the rlimit: struct rlimit rlim; rlim.rlim_cur = 40; rlim.rlim_max = 40; if (setrlimit (RLIMIT_NICE, &rlim) == 0) { // rlim_cur == 40 means that this process is allowed to set a nice value of -20 if (WAIT_FOR_BACKGROUND_THREAD_INSPECTION) printf ("This process has enough permissions to raise ZMQ " "background thread priority!\n"); return true; } if (WAIT_FOR_BACKGROUND_THREAD_INSPECTION) printf ("This process has NOT enough permissions to raise ZMQ " "background thread priority.\n"); return false; } #else #define TEST_POLICY (0) bool is_allowed_to_raise_priority () { return false; } #endif void test_ctx_thread_opts (void *ctx) { int rc; // verify that setting negative values (e.g., default values) fail: rc = zmq_ctx_set (ctx, ZMQ_THREAD_SCHED_POLICY, ZMQ_THREAD_SCHED_POLICY_DFLT); assert (rc == -1 && errno == EINVAL); rc = zmq_ctx_set (ctx, ZMQ_THREAD_PRIORITY, ZMQ_THREAD_PRIORITY_DFLT); assert (rc == -1 && errno == EINVAL); // test scheduling policy: // set context options that alter the background thread CPU scheduling/affinity settings; // as of ZMQ 4.2.3 this has an effect only on POSIX systems (nothing happens on Windows, but still it should return success): rc = zmq_ctx_set (ctx, ZMQ_THREAD_SCHED_POLICY, TEST_POLICY); assert (rc == 0); // test priority: // in theory SCHED_OTHER supports only the static priority 0 but quoting the docs // http://man7.org/linux/man-pages/man7/sched.7.html // "The thread to run is chosen from the static priority 0 list based on // a dynamic priority that is determined only inside this list. The // dynamic priority is based on the nice value [...] // The nice value can be modified using nice(2), setpriority(2), or sched_setattr(2)." // ZMQ will internally use nice(2) to set the nice value when using SCHED_OTHER. // However changing the nice value of a process requires appropriate permissions... // check that the current effective user is able to do that: if (is_allowed_to_raise_priority ()) { rc = zmq_ctx_set ( ctx, ZMQ_THREAD_PRIORITY, 1 /* any positive value different than the default will be ok */); assert (rc == 0); } #ifdef ZMQ_THREAD_AFFINITY_CPU_ADD // test affinity: // this should result in background threads being placed only on the // first CPU available on this system; try experimenting with other values // (e.g., 5 to use CPU index 5) and use "top -H" or "taskset -pc" to see the result int cpus_add[] = {0, 1}; for (unsigned int idx = 0; idx < sizeof (cpus_add) / sizeof (cpus_add[0]); idx++) { rc = zmq_ctx_set (ctx, ZMQ_THREAD_AFFINITY_CPU_ADD, cpus_add[idx]); assert (rc == 0); } // you can also remove CPUs from list of affinities: int cpus_remove[] = {1}; for (unsigned int idx = 0; idx < sizeof (cpus_remove) / sizeof (cpus_remove[0]); idx++) { rc = zmq_ctx_set (ctx, ZMQ_THREAD_AFFINITY_CPU_REMOVE, cpus_remove[idx]); assert (rc == 0); } #endif #ifdef ZMQ_THREAD_NAME_PREFIX // test thread name prefix: rc = zmq_ctx_set (ctx, ZMQ_THREAD_NAME_PREFIX, 1234); assert (rc == 0); #endif } void test_ctx_zero_copy (void *ctx) { #ifdef ZMQ_ZERO_COPY_RECV int zero_copy; // Default value is 1. zero_copy = zmq_ctx_get (ctx, ZMQ_ZERO_COPY_RECV); assert (zero_copy == 1); // Test we can set it to 0. assert (0 == zmq_ctx_set (ctx, ZMQ_ZERO_COPY_RECV, 0)); zero_copy = zmq_ctx_get (ctx, ZMQ_ZERO_COPY_RECV); assert (zero_copy == 0); // Create a TCP socket pair using the context and test that messages can be // received. Note that inproc sockets cannot be used for this test. void *pull = zmq_socket (ctx, ZMQ_PULL); assert (0 == zmq_bind (pull, "tcp://127.0.0.1:*")); void *push = zmq_socket (ctx, ZMQ_PUSH); size_t endpoint_len = MAX_SOCKET_STRING; char endpoint[MAX_SOCKET_STRING]; assert ( 0 == zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len)); assert (0 == zmq_connect (push, endpoint)); const char *small_str = "abcd"; const char *large_str = "01234567890123456789012345678901234567890123456789"; assert (4 == zmq_send (push, (void *) small_str, 4, 0)); assert (40 == zmq_send (push, (void *) large_str, 40, 0)); zmq_msg_t small_msg, large_msg; zmq_msg_init (&small_msg); zmq_msg_init (&large_msg); assert (4 == zmq_msg_recv (&small_msg, pull, 0)); assert (40 == zmq_msg_recv (&large_msg, pull, 0)); assert (!strncmp (small_str, (const char *) zmq_msg_data (&small_msg), 4)); assert (!strncmp (large_str, (const char *) zmq_msg_data (&large_msg), 40)); // Clean up. assert (0 == zmq_close (push)); assert (0 == zmq_close (pull)); assert (0 == zmq_msg_close (&small_msg)); assert (0 == zmq_msg_close (&large_msg)); assert (0 == zmq_ctx_set (ctx, ZMQ_ZERO_COPY_RECV, 1)); zero_copy = zmq_ctx_get (ctx, ZMQ_ZERO_COPY_RECV); assert (zero_copy == 1); #endif } int main (void) { setup_test_environment (); int rc; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); assert (zmq_ctx_get (ctx, ZMQ_MAX_SOCKETS) == ZMQ_MAX_SOCKETS_DFLT); #if defined(ZMQ_USE_SELECT) assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT) == FD_SETSIZE - 1); #elif defined(ZMQ_USE_POLL) || defined(ZMQ_USE_EPOLL) \ || defined(ZMQ_USE_DEVPOLL) || defined(ZMQ_USE_KQUEUE) assert (zmq_ctx_get (ctx, ZMQ_SOCKET_LIMIT) == 65535); #endif assert (zmq_ctx_get (ctx, ZMQ_IO_THREADS) == ZMQ_IO_THREADS_DFLT); assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 0); #if defined(ZMQ_MSG_T_SIZE) assert (zmq_ctx_get (ctx, ZMQ_MSG_T_SIZE) == sizeof (zmq_msg_t)); #endif rc = zmq_ctx_set (ctx, ZMQ_IPV6, true); assert (zmq_ctx_get (ctx, ZMQ_IPV6) == 1); test_ctx_thread_opts (ctx); test_ctx_zero_copy (ctx); void *router = zmq_socket (ctx, ZMQ_ROUTER); int value; size_t optsize = sizeof (int); rc = zmq_getsockopt (router, ZMQ_IPV6, &value, &optsize); assert (rc == 0); assert (value == 1); rc = zmq_getsockopt (router, ZMQ_LINGER, &value, &optsize); assert (rc == 0); assert (value == -1); rc = zmq_close (router); assert (rc == 0); #if WAIT_FOR_BACKGROUND_THREAD_INSPECTION // this is useful when you want to use an external tool (like top or taskset) to view // properties of the background threads printf ("Sleeping for 100sec. You can now use 'top -H -p $(pgrep -f " "test_ctx_options)' and 'taskset -pc ' " "to view ZMQ background thread properties.\n"); sleep (100); #endif rc = zmq_ctx_set (ctx, ZMQ_BLOCKY, false); assert (zmq_ctx_get (ctx, ZMQ_BLOCKY) == 0); router = zmq_socket (ctx, ZMQ_ROUTER); rc = zmq_getsockopt (router, ZMQ_LINGER, &value, &optsize); assert (rc == 0); assert (value == 0); rc = zmq_close (router); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_term_endpoint_tipc.cpp0000664000372000037200000000743213255253220022541 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } int rc; char buf[32]; const char *ep = "tipc://{5560,0,0}"; const char *name = "tipc://{5560,0}@0.0.0"; fprintf (stderr, "unbind endpoint test running...\n"); // Create infrastructure. void *ctx = zmq_init (1); assert (ctx); void *push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_bind (push, ep); assert (rc == 0); void *pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); rc = zmq_connect (pull, name); assert (rc == 0); // Pass one message through to ensure the connection is established. rc = zmq_send (push, "ABC", 3, 0); assert (rc == 3); rc = zmq_recv (pull, buf, sizeof (buf), 0); assert (rc == 3); // Unbind the lisnening endpoint rc = zmq_unbind (push, ep); assert (rc == 0); // Let events some time msleep (SETTLE_TIME); // Check that sending would block (there's no outbound connection). rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT); assert (rc == -1 && zmq_errno () == EAGAIN); // Clean up. rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Now the other way round. fprintf (stderr, "disconnect endpoint test running...\n"); // Create infrastructure. ctx = zmq_init (1); assert (ctx); push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_connect (push, name); assert (rc == 0); pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); rc = zmq_bind (pull, ep); assert (rc == 0); // Pass one message through to ensure the connection is established. rc = zmq_send (push, "ABC", 3, 0); assert (rc == 3); rc = zmq_recv (pull, buf, sizeof (buf), 0); assert (rc == 3); // Disconnect the bound endpoint rc = zmq_disconnect (push, name); assert (rc == 0); msleep (SETTLE_TIME); // Check that sending would block (there's no inbound connections). rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT); assert (rc == -1 && zmq_errno () == EAGAIN); // Clean up. rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_reqrep_inproc.cpp0000664000372000037200000000367213255253220021525 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, "inproc://a"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_xpub_welcome_msg.cpp0000664000372000037200000000503613255253220022210 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_XPUB); assert (pub); int rc = zmq_bind (pub, "inproc://soname"); assert (rc == 0); // set pub socket options rc = zmq_setsockopt (pub, ZMQ_XPUB_WELCOME_MSG, "W", 1); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_SUB); // Subscribe to the welcome message rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "W", 1); assert (rc == 0); assert (sub); rc = zmq_connect (sub, "inproc://soname"); assert (rc == 0); char buffer[2]; // Receive the welcome subscription rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'W'); // Receive the welcome message rc = zmq_recv (sub, buffer, 1, 0); assert (rc == 1); assert (buffer[0] == 'W'); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_rebind_ipc.cpp0000664000372000037200000000463513255253220020753 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static const char *SOCKET_ADDR = "ipc:///tmp/test_rebind_ipc"; int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb0 = zmq_socket (ctx, ZMQ_PUSH); assert (sb0); void *sb1 = zmq_socket (ctx, ZMQ_PUSH); assert (sb1); int rc = zmq_bind (sb0, SOCKET_ADDR); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PULL); assert (sc); rc = zmq_connect (sc, SOCKET_ADDR); assert (rc == 0); rc = zmq_send (sb0, "42", 2, 0); assert (rc == 2); char buffer[2]; rc = zmq_recv (sc, buffer, 2, 0); assert (rc == 2); rc = zmq_close (sb0); assert (rc == 0); rc = zmq_bind (sb1, SOCKET_ADDR); assert (rc == 0); rc = zmq_send (sb1, "42", 2, 0); assert (rc == 2); rc = zmq_recv (sc, buffer, 2, 0); assert (rc == 2); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb1); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_pub_invert_matching.cpp0000664000372000037200000001063413255253220022700 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_PUB); assert (pub); int rc = zmq_bind (pub, "inproc://soname"); assert (rc == 0); // Create two subscribers void *sub1 = zmq_socket (ctx, ZMQ_SUB); assert (sub1); rc = zmq_connect (sub1, "inproc://soname"); assert (rc == 0); void *sub2 = zmq_socket (ctx, ZMQ_SUB); assert (sub2); rc = zmq_connect (sub2, "inproc://soname"); assert (rc == 0); // Subscribe pub1 to one prefix // and pub2 to another prefix. const char PREFIX1[] = "prefix1"; const char PREFIX2[] = "p2"; rc = zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, PREFIX1, sizeof (PREFIX1)); assert (rc == 0); rc = zmq_setsockopt (sub2, ZMQ_SUBSCRIBE, PREFIX2, sizeof (PREFIX2)); assert (rc == 0); // Send a message with the first prefix rc = zmq_send_const (pub, PREFIX1, sizeof (PREFIX1), 0); assert (rc == sizeof (PREFIX1)); // sub1 should receive it, but not sub2 rc = zmq_recv (sub1, NULL, 0, ZMQ_DONTWAIT); assert (rc == sizeof (PREFIX1)); rc = zmq_recv (sub2, NULL, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Send a message with the second prefix rc = zmq_send_const (pub, PREFIX2, sizeof (PREFIX2), 0); assert (rc == sizeof (PREFIX2)); // sub2 should receive it, but not sub1 rc = zmq_recv (sub2, NULL, 0, ZMQ_DONTWAIT); assert (rc == sizeof (PREFIX2)); rc = zmq_recv (sub1, NULL, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Now invert the matching int invert = 1; rc = zmq_setsockopt (pub, ZMQ_INVERT_MATCHING, &invert, sizeof (invert)); assert (rc == 0); // ... on both sides, otherwise the SUB socket will filter the messages out rc = zmq_setsockopt (sub1, ZMQ_INVERT_MATCHING, &invert, sizeof (invert)); rc = zmq_setsockopt (sub2, ZMQ_INVERT_MATCHING, &invert, sizeof (invert)); assert (rc == 0); // Send a message with the first prefix rc = zmq_send_const (pub, PREFIX1, sizeof (PREFIX1), 0); assert (rc == sizeof (PREFIX1)); // sub2 should receive it, but not sub1 rc = zmq_recv (sub2, NULL, 0, ZMQ_DONTWAIT); assert (rc == sizeof (PREFIX1)); rc = zmq_recv (sub1, NULL, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Send a message with the second prefix rc = zmq_send_const (pub, PREFIX2, sizeof (PREFIX2), 0); assert (rc == sizeof (PREFIX2)); // sub1 should receive it, but not sub2 rc = zmq_recv (sub1, NULL, 0, ZMQ_DONTWAIT); assert (rc == sizeof (PREFIX2)); rc = zmq_recv (sub2, NULL, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub1); assert (rc == 0); rc = zmq_close (sub2); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_bind_after_connect_tcp.cpp0000664000372000037200000000441213255253220023322 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_x () { void *sb = test_context_socket (ZMQ_DEALER); void *sc = test_context_socket (ZMQ_DEALER); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, ENDPOINT_3)); send_string_expect_success (sc, "foobar", 0); send_string_expect_success (sc, "baz", 0); send_string_expect_success (sc, "buzz", 0); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, ENDPOINT_3)); recv_string_expect_success (sb, "foobar", 0); recv_string_expect_success (sb, "baz", 0); recv_string_expect_success (sb, "buzz", 0); test_context_socket_close (sc); test_context_socket_close (sb); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_x); return UNITY_END (); } zeromq-4.2.5/tests/test_unbind_wildcard.cpp0000664000372000037200000001322713255253220022002 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); int ipv6 = is_ipv6_available (); /* Address wildcard, IPv6 disabled */ void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); int rc = zmq_bind (sb, "tcp://*:*"); assert (rc == 0); char bindEndpoint[256]; char connectEndpoint[256]; size_t endpoint_len = sizeof (bindEndpoint); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, bindEndpoint, &endpoint_len); assert (rc == 0); // Apparently Windows can't connect to 0.0.0.0. A better fix would be welcome. #ifdef ZMQ_HAVE_WINDOWS sprintf (connectEndpoint, "tcp://127.0.0.1:%s", strrchr (bindEndpoint, ':') + 1); #else strcpy (connectEndpoint, bindEndpoint); #endif rc = zmq_connect (sc, connectEndpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_disconnect (sc, connectEndpoint); assert (rc == 0); rc = zmq_unbind (sb, bindEndpoint); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); /* Address wildcard, IPv6 enabled */ sb = zmq_socket (ctx, ZMQ_REP); assert (sb); sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_setsockopt (sb, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sc, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_bind (sb, "tcp://*:*"); assert (rc == 0); endpoint_len = sizeof (bindEndpoint); memset (bindEndpoint, 0, endpoint_len); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, bindEndpoint, &endpoint_len); assert (rc == 0); #ifdef ZMQ_HAVE_WINDOWS if (ipv6) sprintf (connectEndpoint, "tcp://[::1]:%s", strrchr (bindEndpoint, ':') + 1); else sprintf (connectEndpoint, "tcp://127.0.0.1:%s", strrchr (bindEndpoint, ':') + 1); #else strcpy (connectEndpoint, bindEndpoint); #endif rc = zmq_connect (sc, connectEndpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_disconnect (sc, connectEndpoint); assert (rc == 0); rc = zmq_unbind (sb, bindEndpoint); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); /* Port wildcard, IPv4 address, IPv6 disabled */ sb = zmq_socket (ctx, ZMQ_REP); assert (sb); sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_bind (sb, "tcp://127.0.0.1:*"); assert (rc == 0); char endpoint[256]; endpoint_len = sizeof (endpoint); memset (endpoint, 0, endpoint_len); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len); assert (rc == 0); rc = zmq_connect (sc, endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_disconnect (sc, endpoint); assert (rc == 0); rc = zmq_unbind (sb, endpoint); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); /* Port wildcard, IPv4 address, IPv6 enabled */ sb = zmq_socket (ctx, ZMQ_REP); assert (sb); sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_setsockopt (sb, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sc, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_bind (sb, "tcp://127.0.0.1:*"); assert (rc == 0); endpoint_len = sizeof (endpoint); memset (endpoint, 0, endpoint_len); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len); assert (rc == 0); rc = zmq_connect (sc, endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_disconnect (sc, endpoint); assert (rc == 0); rc = zmq_unbind (sb, endpoint); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); if (ipv6) { /* Port wildcard, IPv6 address, IPv6 enabled */ sb = zmq_socket (ctx, ZMQ_REP); assert (sb); sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_setsockopt (sb, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sc, ZMQ_IPV6, &ipv6, sizeof (int)); assert (rc == 0); rc = zmq_bind (sb, "tcp://[::1]:*"); assert (rc == 0); endpoint_len = sizeof (endpoint); memset (endpoint, 0, endpoint_len); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &endpoint_len); assert (rc == 0); rc = zmq_connect (sc, endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_disconnect (sc, endpoint); assert (rc == 0); rc = zmq_unbind (sb, endpoint); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); } rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_pair_tcp.cpp0000664000372000037200000000513213255253220020447 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" typedef void (*extra_func_t) (void *socket); #ifdef ZMQ_BUILD_DRAFT void set_sockopt_fastpath (void *socket) { int value = 1; int rc = zmq_setsockopt (socket, ZMQ_LOOPBACK_FASTPATH, &value, sizeof value); assert (rc == 0); } #endif void test_pair_tcp (extra_func_t extra_func = NULL) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); if (extra_func) extra_func (sb); int rc = zmq_bind (sb, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); if (extra_func) extra_func (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_pair_tcp (); #ifdef ZMQ_BUILD_DRAFT test_pair_tcp (set_sockopt_fastpath); #endif return 0; } zeromq-4.2.5/tests/test_radio_dish.cpp0000664000372000037200000001536013255253220020757 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void msg_send_expect_success (void *s_, const char *group_, const char *body_) { zmq_msg_t msg; const size_t len = strlen (body_); TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_init_size (&msg, len)); memcpy (zmq_msg_data (&msg), body_, len); TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_set_group (&msg, group_)); int rc = zmq_msg_send (&msg, s_, 0); TEST_ASSERT_EQUAL_INT ((int) len, rc); // TODO isn't the msg closed by zmq_msg_send? zmq_msg_close (&msg); } void msg_recv_cmp (void *s_, const char *group_, const char *body_) { zmq_msg_t msg; const size_t len = strlen (body_); TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_init (&msg)); int recv_rc = TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_recv (&msg, s_, 0)); TEST_ASSERT_EQUAL_INT (len, recv_rc); TEST_ASSERT_EQUAL_STRING (group_, zmq_msg_group (&msg)); TEST_ASSERT_EQUAL_STRING_LEN (body_, zmq_msg_data (&msg), len); zmq_msg_close (&msg); } void test_leave_unjoined_fails () { void *dish = test_context_socket (ZMQ_DISH); // Leaving a group which we didn't join TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_leave (dish, "Movies")); test_context_socket_close (dish); } void test_join_too_long_fails () { void *dish = test_context_socket (ZMQ_DISH); // Joining too long group char too_long_group[ZMQ_GROUP_MAX_LENGTH + 2]; for (int index = 0; index < ZMQ_GROUP_MAX_LENGTH + 2; index++) too_long_group[index] = 'A'; too_long_group[ZMQ_GROUP_MAX_LENGTH + 1] = '\0'; TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_join (dish, too_long_group)); test_context_socket_close (dish); } void test_join_twice_fails () { void *dish = test_context_socket (ZMQ_DISH); TEST_ASSERT_SUCCESS_ERRNO (zmq_join (dish, "Movies")); // Duplicate Joining TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_join (dish, "Movies")); test_context_socket_close (dish); } void test_radio_dish_tcp_poll () { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *radio = test_context_socket (ZMQ_RADIO); bind_loopback_ipv4 (radio, my_endpoint, len); void *dish = test_context_socket (ZMQ_DISH); // Joining TEST_ASSERT_SUCCESS_ERRNO (zmq_join (dish, "Movies")); // Connecting TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dish, my_endpoint)); msleep (SETTLE_TIME); // This is not going to be sent as dish only subscribe to "Movies" msg_send_expect_success (radio, "TV", "Friends"); // This is going to be sent to the dish msg_send_expect_success (radio, "Movies", "Godfather"); // Check the correct message arrived msg_recv_cmp (dish, "Movies", "Godfather"); // Join group during connection optvallen TEST_ASSERT_SUCCESS_ERRNO (zmq_join (dish, "TV")); zmq_sleep (1); // This should arrive now as we joined the group msg_send_expect_success (radio, "TV", "Friends"); // Check the correct message arrived msg_recv_cmp (dish, "TV", "Friends"); // Leaving group TEST_ASSERT_SUCCESS_ERRNO (zmq_leave (dish, "TV")); zmq_sleep (1); // This is not going to be sent as dish only subscribe to "Movies" msg_send_expect_success (radio, "TV", "Friends"); // This is going to be sent to the dish msg_send_expect_success (radio, "Movies", "Godfather"); // test zmq_poll with dish zmq_pollitem_t items[] = { {radio, 0, ZMQ_POLLIN, 0}, // read publications {dish, 0, ZMQ_POLLIN, 0}, // read subscriptions }; int rc = zmq_poll (items, 2, 2000); TEST_ASSERT_EQUAL_INT (1, rc); TEST_ASSERT_EQUAL_INT (ZMQ_POLLIN, items[1].revents); // Check the correct message arrived msg_recv_cmp (dish, "Movies", "Godfather"); test_context_socket_close (dish); test_context_socket_close (radio); } void test_dish_connect_fails () { void *dish = test_context_socket (ZMQ_DISH); // Connecting dish should fail TEST_ASSERT_FAILURE_ERRNO (ENOCOMPATPROTO, zmq_connect (dish, "udp://127.0.0.1:5556")); test_context_socket_close (dish); } void test_radio_bind_fails () { void *radio = test_context_socket (ZMQ_RADIO); // Connecting dish should fail // Bind radio should fail TEST_ASSERT_FAILURE_ERRNO (ENOCOMPATPROTO, zmq_bind (radio, "udp://*:5556")); test_context_socket_close (radio); } void test_radio_dish_udp () { void *radio = test_context_socket (ZMQ_RADIO); void *dish = test_context_socket (ZMQ_DISH); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (dish, "udp://*:5556")); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (radio, "udp://127.0.0.1:5556")); msleep (SETTLE_TIME); TEST_ASSERT_SUCCESS_ERRNO (zmq_join (dish, "TV")); msg_send_expect_success (radio, "TV", "Friends"); msg_recv_cmp (dish, "TV", "Friends"); test_context_socket_close (dish); test_context_socket_close (radio); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_leave_unjoined_fails); RUN_TEST (test_join_too_long_fails); RUN_TEST (test_join_twice_fails); RUN_TEST (test_radio_bind_fails); RUN_TEST (test_dish_connect_fails); RUN_TEST (test_radio_dish_tcp_poll); RUN_TEST (test_radio_dish_udp); return UNITY_END (); } zeromq-4.2.5/tests/test_xpub_manual.cpp0000664000372000037200000004305213255253220021164 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int test_basic () { void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_XPUB); assert (pub); int manual = 1; int rc = zmq_setsockopt (pub, ZMQ_XPUB_MANUAL, &manual, 4); assert (rc == 0); rc = zmq_bind (pub, "inproc://soname"); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_XSUB); assert (sub); rc = zmq_connect (sub, "inproc://soname"); assert (rc == 0); // Subscribe for A char subscription[2] = {1, 'A'}; rc = zmq_send_const (sub, subscription, 2, 0); assert (rc == 2); char buffer[2]; // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe socket for B instead rc = zmq_setsockopt (pub, ZMQ_SUBSCRIBE, "B", 1); assert (rc == 0); // Sending A message and B Message rc = zmq_send_const (pub, "A", 1, 0); assert (rc == 1); rc = zmq_send_const (pub, "B", 1, 0); assert (rc == 1); rc = zmq_recv (sub, buffer, 1, ZMQ_DONTWAIT); assert (rc == 1); assert (buffer[0] == 'B'); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } int test_unsubscribe_manual () { void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_XPUB); assert (pub); int rc = zmq_bind (pub, "inproc://soname"); assert (rc == 0); // set pub socket options int manual = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_MANUAL, &manual, 4); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_XSUB); assert (sub); rc = zmq_connect (sub, "inproc://soname"); assert (rc == 0); // Subscribe for A char subscription1[2] = {1, 'A'}; rc = zmq_send_const (sub, subscription1, 2, 0); assert (rc == 2); // Subscribe for B char subscription2[2] = {1, 'B'}; rc = zmq_send_const (sub, subscription2, 2, 0); assert (rc == 2); char buffer[3]; // Receive subscription "A" from subscriber rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe socket for XA instead rc = zmq_setsockopt (pub, ZMQ_SUBSCRIBE, "XA", 2); assert (rc == 0); // Receive subscription "B" from subscriber rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'B'); // Subscribe socket for XB instead rc = zmq_setsockopt (pub, ZMQ_SUBSCRIBE, "XB", 2); assert (rc == 0); // Unsubscribe from A char unsubscription1[2] = {0, 'A'}; rc = zmq_send_const (sub, unsubscription1, 2, 0); assert (rc == 2); // Receive unsubscription "A" from subscriber rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // Unsubscribe socket from XA instead rc = zmq_setsockopt (pub, ZMQ_UNSUBSCRIBE, "XA", 2); assert (rc == 0); // Sending messages XA, XB rc = zmq_send_const (pub, "XA", 2, 0); assert (rc == 2); rc = zmq_send_const (pub, "XB", 2, 0); assert (rc == 2); // Subscriber should receive XB only rc = zmq_recv (sub, buffer, 2, ZMQ_DONTWAIT); assert (rc == 2); assert (buffer[0] == 'X'); assert (buffer[1] == 'B'); // Close subscriber rc = zmq_close (sub); assert (rc == 0); // Receive unsubscription "B" rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 0); assert (buffer[1] == 'B'); // Unsubscribe socket from XB instead rc = zmq_setsockopt (pub, ZMQ_UNSUBSCRIBE, "XB", 2); assert (rc == 0); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } int test_xpub_proxy_unsubscribe_on_disconnect (void) { const char *topic = "1"; const char *payload = "X"; size_t len = MAX_SOCKET_STRING; char my_endpoint_backend[MAX_SOCKET_STRING]; char my_endpoint_frontend[MAX_SOCKET_STRING]; int manual = 1; void *ctx = zmq_ctx_new (); assert (ctx); // proxy frontend void *xsub_proxy = zmq_socket (ctx, ZMQ_XSUB); assert (xsub_proxy); assert (zmq_bind (xsub_proxy, "tcp://127.0.0.1:*") == 0); int rc = zmq_getsockopt (xsub_proxy, ZMQ_LAST_ENDPOINT, my_endpoint_frontend, &len); assert (rc == 0); // proxy backend void *xpub_proxy = zmq_socket (ctx, ZMQ_XPUB); assert (xpub_proxy); assert (zmq_setsockopt (xpub_proxy, ZMQ_XPUB_MANUAL, &manual, 4) == 0); assert (zmq_bind (xpub_proxy, "tcp://127.0.0.1:*") == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (xpub_proxy, ZMQ_LAST_ENDPOINT, my_endpoint_backend, &len); assert (rc == 0); // publisher void *pub = zmq_socket (ctx, ZMQ_PUB); assert (zmq_connect (pub, my_endpoint_frontend) == 0); // first subscriber subscribes void *sub1 = zmq_socket (ctx, ZMQ_SUB); assert (sub1); assert (zmq_connect (sub1, my_endpoint_backend) == 0); assert (zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, topic, 1) == 0); // wait msleep (SETTLE_TIME); // proxy reroutes and confirms subscriptions char sub_buff[2]; assert (zmq_recv (xpub_proxy, sub_buff, 2, ZMQ_DONTWAIT) == 2); assert (sub_buff[0] == 1); assert (sub_buff[1] == *topic); assert (zmq_setsockopt (xpub_proxy, ZMQ_SUBSCRIBE, topic, 1) == 0); assert (zmq_send (xsub_proxy, sub_buff, 2, 0) == 2); // second subscriber subscribes void *sub2 = zmq_socket (ctx, ZMQ_SUB); assert (sub2); assert (zmq_connect (sub2, my_endpoint_backend) == 0); assert (zmq_setsockopt (sub2, ZMQ_SUBSCRIBE, topic, 1) == 0); // wait msleep (SETTLE_TIME); // proxy reroutes assert (zmq_recv (xpub_proxy, sub_buff, 2, ZMQ_DONTWAIT) == 2); assert (sub_buff[0] == 1); assert (sub_buff[1] == *topic); assert (zmq_setsockopt (xpub_proxy, ZMQ_SUBSCRIBE, topic, 1) == 0); assert (zmq_send (xsub_proxy, sub_buff, 2, 0) == 2); // wait msleep (SETTLE_TIME); // let publisher send a msg assert (zmq_send (pub, topic, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (pub, payload, 1, 0) == 1); // wait msleep (SETTLE_TIME); // proxy reroutes data messages to subscribers char topic_buff[1]; char data_buff[1]; assert (zmq_recv (xsub_proxy, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic); assert (zmq_recv (xsub_proxy, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); assert (zmq_send (xpub_proxy, topic_buff, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (xpub_proxy, data_buff, 1, 0) == 1); // wait msleep (SETTLE_TIME); // each subscriber should now get a message assert (zmq_recv (sub2, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic); assert (zmq_recv (sub2, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); assert (zmq_recv (sub1, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic); assert (zmq_recv (sub1, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); // Disconnect both subscribers assert (zmq_close (sub1) == 0); assert (zmq_close (sub2) == 0); // wait msleep (SETTLE_TIME); // unsubscribe messages are passed from proxy to publisher assert (zmq_recv (xpub_proxy, sub_buff, 2, 0) == 2); assert (sub_buff[0] == 0); assert (sub_buff[1] == *topic); assert (zmq_setsockopt (xpub_proxy, ZMQ_UNSUBSCRIBE, topic, 1) == 0); assert (zmq_send (xsub_proxy, sub_buff, 2, 0) == 2); // should receive another unsubscribe msg assert (zmq_recv (xpub_proxy, sub_buff, 2, 0) == 2 && "Should receive the second unsubscribe message."); assert (sub_buff[0] == 0); assert (sub_buff[1] == *topic); assert (zmq_setsockopt (xpub_proxy, ZMQ_UNSUBSCRIBE, topic, 1) == 0); assert (zmq_send (xsub_proxy, sub_buff, 2, 0) == 2); // wait msleep (SETTLE_TIME); // let publisher send a msg assert (zmq_send (pub, topic, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (pub, payload, 1, 0) == 1); // wait msleep (SETTLE_TIME); // nothing should come to the proxy assert (zmq_recv (xsub_proxy, topic_buff, 1, ZMQ_DONTWAIT) == -1); assert (errno == EAGAIN); assert (zmq_close (pub) == 0); assert (zmq_close (xpub_proxy) == 0); assert (zmq_close (xsub_proxy) == 0); assert (zmq_ctx_term (ctx) == 0); return 0; } int test_missing_subscriptions (void) { const char *topic1 = "1"; const char *topic2 = "2"; const char *payload = "X"; size_t len = MAX_SOCKET_STRING; char my_endpoint_backend[MAX_SOCKET_STRING]; char my_endpoint_frontend[MAX_SOCKET_STRING]; int manual = 1; void *ctx = zmq_ctx_new (); assert (ctx); // proxy frontend void *xsub_proxy = zmq_socket (ctx, ZMQ_XSUB); assert (xsub_proxy); assert (zmq_bind (xsub_proxy, "tcp://127.0.0.1:*") == 0); int rc = zmq_getsockopt (xsub_proxy, ZMQ_LAST_ENDPOINT, my_endpoint_frontend, &len); assert (rc == 0); // proxy backend void *xpub_proxy = zmq_socket (ctx, ZMQ_XPUB); assert (xpub_proxy); assert (zmq_setsockopt (xpub_proxy, ZMQ_XPUB_MANUAL, &manual, 4) == 0); assert (zmq_bind (xpub_proxy, "tcp://127.0.0.1:*") == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (xpub_proxy, ZMQ_LAST_ENDPOINT, my_endpoint_backend, &len); assert (rc == 0); // publisher void *pub = zmq_socket (ctx, ZMQ_PUB); assert (zmq_connect (pub, my_endpoint_frontend) == 0); // Here's the problem: because subscribers subscribe in quick succession, // the proxy is unable to confirm the first subscription before receiving // the second. This causes the first subscription to get lost. // first subscriber void *sub1 = zmq_socket (ctx, ZMQ_SUB); assert (sub1); assert (zmq_connect (sub1, my_endpoint_backend) == 0); assert (zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, topic1, 1) == 0); // second subscriber void *sub2 = zmq_socket (ctx, ZMQ_SUB); assert (sub2); assert (zmq_connect (sub2, my_endpoint_backend) == 0); assert (zmq_setsockopt (sub2, ZMQ_SUBSCRIBE, topic2, 1) == 0); // wait msleep (SETTLE_TIME); // proxy now reroutes and confirms subscriptions char buffer[2]; assert (zmq_recv (xpub_proxy, buffer, 2, ZMQ_DONTWAIT) == 2); assert (buffer[0] == 1); assert (buffer[1] == *topic1); assert (zmq_setsockopt (xpub_proxy, ZMQ_SUBSCRIBE, topic1, 1) == 0); assert (zmq_send (xsub_proxy, buffer, 2, 0) == 2); assert (zmq_recv (xpub_proxy, buffer, 2, ZMQ_DONTWAIT) == 2); assert (buffer[0] == 1); assert (buffer[1] == *topic2); assert (zmq_setsockopt (xpub_proxy, ZMQ_SUBSCRIBE, topic2, 1) == 0); assert (zmq_send (xsub_proxy, buffer, 2, 0) == 2); // wait msleep (SETTLE_TIME); // let publisher send 2 msgs, each with its own topic assert (zmq_send (pub, topic1, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (pub, payload, 1, 0) == 1); assert (zmq_send (pub, topic2, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (pub, payload, 1, 0) == 1); // wait msleep (SETTLE_TIME); // proxy reroutes data messages to subscribers char topic_buff[1]; char data_buff[1]; assert (zmq_recv (xsub_proxy, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic1); assert (zmq_recv (xsub_proxy, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); assert (zmq_send (xpub_proxy, topic_buff, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (xpub_proxy, data_buff, 1, 0) == 1); assert (zmq_recv (xsub_proxy, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic2); assert (zmq_recv (xsub_proxy, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); assert (zmq_send (xpub_proxy, topic_buff, 1, ZMQ_SNDMORE) == 1); assert (zmq_send (xpub_proxy, data_buff, 1, 0) == 1); // wait msleep (SETTLE_TIME); // each subscriber should now get a message assert (zmq_recv (sub2, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic2); assert (zmq_recv (sub2, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); assert (zmq_recv (sub1, topic_buff, 1, ZMQ_DONTWAIT) == 1); assert (topic_buff[0] == *topic1); assert (zmq_recv (sub1, data_buff, 1, ZMQ_DONTWAIT) == 1); assert (data_buff[0] == *payload); // Clean up assert (zmq_close (sub1) == 0); assert (zmq_close (sub2) == 0); assert (zmq_close (pub) == 0); assert (zmq_close (xpub_proxy) == 0); assert (zmq_close (xsub_proxy) == 0); assert (zmq_ctx_term (ctx) == 0); return 0; } int test_unsubscribe_cleanup (void) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_XPUB); assert (pub); int manual = 1; int rc = zmq_setsockopt (pub, ZMQ_XPUB_MANUAL, &manual, 4); assert (rc == 0); rc = zmq_bind (pub, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (pub, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_XSUB); assert (sub); rc = zmq_connect (sub, my_endpoint); assert (rc == 0); // Subscribe for A char subscription[2] = {1, 'A'}; rc = zmq_send_const (sub, subscription, 2, 0); assert (rc == 2); char buffer[2]; // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'A'); rc = zmq_setsockopt (pub, ZMQ_SUBSCRIBE, "XA", 2); assert (rc == 0); // send 2 messages rc = zmq_send_const (pub, "XA", 2, 0); assert (rc == 2); rc = zmq_send_const (pub, "XB", 2, 0); assert (rc == 2); // receive the single message rc = zmq_recv (sub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 'X'); assert (buffer[1] == 'A'); // should be nothing left in the queue rc = zmq_recv (sub, buffer, 2, ZMQ_DONTWAIT); assert (rc == -1); // close the socket rc = zmq_close (sub); assert (rc == 0); // closing the socket will result in an unsubscribe event rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // this doesn't really do anything // there is no last_pipe set it will just fail silently rc = zmq_setsockopt (pub, ZMQ_UNSUBSCRIBE, "XA", 2); assert (rc == 0); // reconnect sub = zmq_socket (ctx, ZMQ_XSUB); rc = zmq_connect (sub, my_endpoint); assert (rc == 0); // send a subscription for B subscription[0] = 1; subscription[1] = 'B'; rc = zmq_send (sub, subscription, 2, 0); assert (rc == 2); // receive the subscription, overwrite it to XB rc = zmq_recv (pub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 1); assert (buffer[1] == 'B'); rc = zmq_setsockopt (pub, ZMQ_SUBSCRIBE, "XB", 2); assert (rc == 0); // send 2 messages rc = zmq_send_const (pub, "XA", 2, 0); assert (rc == 2); rc = zmq_send_const (pub, "XB", 2, 0); assert (rc == 2); // receive the single message rc = zmq_recv (sub, buffer, 2, 0); assert (rc == 2); assert (buffer[0] == 'X'); assert (buffer[1] == 'B'); // this assertion will fail // should be nothing left in the queue rc = zmq_recv (sub, buffer, 2, ZMQ_DONTWAIT); assert (rc == -1); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } int main (void) { setup_test_environment (); test_basic (); test_unsubscribe_manual (); test_xpub_proxy_unsubscribe_on_disconnect (); test_missing_subscriptions (); test_unsubscribe_cleanup (); return 0; } zeromq-4.2.5/tests/test_srcfd.cpp0000664000372000037200000000706113255253220017752 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #define MSG_SIZE 20 #ifdef _WIN32 #include #include #else #include #include #include #endif int main (void) { int rc; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; setup_test_environment (); // Create the infrastructure void *ctx = zmq_ctx_new (); assert (ctx); void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_bind (rep, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (rep, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (req, my_endpoint); assert (rc == 0); char tmp[MSG_SIZE]; memset (tmp, 0, MSG_SIZE); zmq_send (req, tmp, MSG_SIZE, 0); zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); zmq_recvmsg (rep, &msg, 0); assert (zmq_msg_size (&msg) == MSG_SIZE); // get the messages source file descriptor int srcFd = zmq_msg_get (&msg, ZMQ_SRCFD); assert (srcFd >= 0); rc = zmq_msg_close (&msg); assert (rc == 0); // get the remote endpoint struct sockaddr_storage ss; #ifdef ZMQ_HAVE_HPUX int addrlen = sizeof ss; #else socklen_t addrlen = sizeof ss; #endif rc = getpeername (srcFd, (struct sockaddr *) &ss, &addrlen); assert (rc == 0); char host[NI_MAXHOST]; rc = getnameinfo ((struct sockaddr *) &ss, addrlen, host, sizeof host, NULL, 0, NI_NUMERICHOST); assert (rc == 0); // assert it is localhost which connected assert (strcmp (host, "127.0.0.1") == 0); rc = zmq_close (rep); assert (rc == 0); rc = zmq_close (req); assert (rc == 0); // sleep a bit for the socket to be freed msleep (SETTLE_TIME); // getting name from closed socket will fail rc = getpeername (srcFd, (struct sockaddr *) &ss, &addrlen); #ifdef ZMQ_HAVE_WINDOWS assert (rc == SOCKET_ERROR); assert (WSAGetLastError () == WSAENOTSOCK); #else assert (rc == -1); assert (errno == EBADF); #endif rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_router_mandatory_hwm.cpp0000664000372000037200000001136013255253220023117 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // DEBUG shouldn't be defined in sources as it will cause a redefined symbol // error when it is defined in the build configuration. It appears that the // intent here is to semi-permanently disable DEBUG tracing statements, so the // implementation is changed to accomodate that intent. //#define DEBUG 0 #define TRACE_ENABLED 0 int main (void) { int rc; if (TRACE_ENABLED) fprintf (stderr, "Staring router mandatory HWM test ...\n"); setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); // Configure router socket to mandatory routing and set HWM and linger int mandatory = 1; rc = zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory)); assert (rc == 0); int sndhwm = 1; rc = zmq_setsockopt (router, ZMQ_SNDHWM, &sndhwm, sizeof (sndhwm)); assert (rc == 0); int linger = 1; rc = zmq_setsockopt (router, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_bind (router, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Create dealer called "X" and connect it to our router, configure HWM void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_setsockopt (dealer, ZMQ_ROUTING_ID, "X", 1); assert (rc == 0); int rcvhwm = 1; rc = zmq_setsockopt (dealer, ZMQ_RCVHWM, &rcvhwm, sizeof (rcvhwm)); assert (rc == 0); rc = zmq_connect (dealer, my_endpoint); assert (rc == 0); // Get message from dealer to know when connection is ready char buffer[255]; rc = zmq_send (dealer, "Hello", 5, 0); assert (rc == 5); rc = zmq_recv (router, buffer, 255, 0); assert (rc == 1); assert (buffer[0] == 'X'); int i; const int BUF_SIZE = 65536; char buf[BUF_SIZE]; memset (buf, 0, BUF_SIZE); // Send first batch of messages for (i = 0; i < 100000; ++i) { if (TRACE_ENABLED) fprintf (stderr, "Sending message %d ...\n", i); rc = zmq_send (router, "X", 1, ZMQ_DONTWAIT | ZMQ_SNDMORE); if (rc == -1 && zmq_errno () == EAGAIN) break; assert (rc == 1); rc = zmq_send (router, buf, BUF_SIZE, ZMQ_DONTWAIT); assert (rc == BUF_SIZE); } // This should fail after one message but kernel buffering could // skew results assert (i < 10); msleep (1000); // Send second batch of messages for (; i < 100000; ++i) { if (TRACE_ENABLED) fprintf (stderr, "Sending message %d (part 2) ...\n", i); rc = zmq_send (router, "X", 1, ZMQ_DONTWAIT | ZMQ_SNDMORE); if (rc == -1 && zmq_errno () == EAGAIN) break; assert (rc == 1); rc = zmq_send (router, buf, BUF_SIZE, ZMQ_DONTWAIT); assert (rc == BUF_SIZE); } // This should fail after two messages but kernel buffering could // skew results assert (i < 20); if (TRACE_ENABLED) fprintf (stderr, "Done sending messages.\n"); rc = zmq_close (router); assert (rc == 0); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_zmq_poll_fd.cpp0000664000372000037200000000572513255253220021164 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include int main (void) { struct addrinfo *addr, hint; hint.ai_flags = AI_NUMERICHOST; hint.ai_family = AF_INET; hint.ai_socktype = SOCK_DGRAM; hint.ai_protocol = IPPROTO_UDP; hint.ai_addrlen = 0; hint.ai_canonname = NULL; hint.ai_addr = NULL; hint.ai_next = NULL; int rc = getaddrinfo ("127.0.0.1", "6650", &hint, &addr); assert (rc == 0); int recv_socket = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); assert (recv_socket != -1); int flag = 1; rc = setsockopt (recv_socket, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof (int)); assert (rc == 0); rc = bind (recv_socket, addr->ai_addr, addr->ai_addrlen); assert (rc == 0); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); rc = zmq_bind (sb, "tcp://127.0.0.1:*"); assert (rc == 0); zmq_pollitem_t pollitems[] = { {sb, 0, ZMQ_POLLIN, 0}, {NULL, recv_socket, ZMQ_POLLIN, 0}, }; int send_socket = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); assert (send_socket != -1); char buf[10]; memset (buf, 1, 10); rc = sendto (send_socket, buf, 10, 0, addr->ai_addr, addr->ai_addrlen); assert (rc >= 0); assert (zmq_poll (pollitems, 2, 1) == 1); assert ((pollitems[0].revents & ZMQ_POLLIN) == 0); assert (pollitems[1].revents & ZMQ_POLLIN); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); close (send_socket); close (recv_socket); freeaddrinfo (addr); return 0; } zeromq-4.2.5/tests/test_unbind_inproc.cpp0000664000372000037200000000225013255253220021475 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); rc = zmq_unbind (sb, "inproc://a"); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_getsockopt_memset.cpp0000664000372000037200000000421713255253220022405 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { int64_t more; size_t more_size = sizeof (more); setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PUB); assert (sb); int rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_SUB); assert (sc); rc = zmq_connect (sc, "inproc://a"); assert (rc == 0); memset (&more, 0xFF, sizeof (int64_t)); zmq_getsockopt (sc, ZMQ_RCVMORE, &more, &more_size); assert (more_size == sizeof (int)); assert (more == 0); // Cleanup rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_setsockopt.cpp0000664000372000037200000001021713255253220021044 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" void test_setsockopt_tcp_recv_buffer (void) { int rc; void *ctx = zmq_ctx_new (); void *socket = zmq_socket (ctx, ZMQ_PUSH); int val = 0; size_t placeholder = sizeof (val); rc = zmq_getsockopt (socket, ZMQ_RCVBUF, &val, &placeholder); assert (rc == 0); assert (val == -1); val = 16384; rc = zmq_setsockopt (socket, ZMQ_RCVBUF, &val, sizeof (val)); assert (rc == 0); assert (val == 16384); rc = zmq_getsockopt (socket, ZMQ_RCVBUF, &val, &placeholder); assert (rc == 0); assert (val == 16384); zmq_close (socket); zmq_ctx_term (ctx); } void test_setsockopt_tcp_send_buffer (void) { int rc; void *ctx = zmq_ctx_new (); void *socket = zmq_socket (ctx, ZMQ_PUSH); int val = 0; size_t placeholder = sizeof (val); rc = zmq_getsockopt (socket, ZMQ_SNDBUF, &val, &placeholder); assert (rc == 0); assert (val == -1); val = 16384; rc = zmq_setsockopt (socket, ZMQ_SNDBUF, &val, sizeof (val)); assert (rc == 0); assert (val == 16384); rc = zmq_getsockopt (socket, ZMQ_SNDBUF, &val, &placeholder); assert (rc == 0); assert (val == 16384); zmq_close (socket); zmq_ctx_term (ctx); } void test_setsockopt_use_fd () { int rc; void *ctx = zmq_ctx_new (); void *socket = zmq_socket (ctx, ZMQ_PUSH); int val = 0; size_t placeholder = sizeof (val); rc = zmq_getsockopt (socket, ZMQ_USE_FD, &val, &placeholder); assert (rc == 0); assert (val == -1); val = 3; rc = zmq_setsockopt (socket, ZMQ_USE_FD, &val, sizeof (val)); assert (rc == 0); assert (val == 3); rc = zmq_getsockopt (socket, ZMQ_USE_FD, &val, &placeholder); assert (rc == 0); assert (val == 3); zmq_close (socket); zmq_ctx_term (ctx); } #define BOUNDDEVBUFSZ 16 void test_setsockopt_bindtodevice () { void *ctx = zmq_ctx_new (); void *socket = zmq_socket (ctx, ZMQ_PUSH); #ifdef ZMQ_BINDTODEVICE int rc; char devname[BOUNDDEVBUFSZ]; size_t buflen = BOUNDDEVBUFSZ; rc = zmq_getsockopt (socket, ZMQ_BINDTODEVICE, devname, &buflen); assert (rc == 0); assert (devname[0] == '\0'); assert (buflen == 1); sprintf (devname, "testdev"); buflen = strlen (devname); rc = zmq_setsockopt (socket, ZMQ_BINDTODEVICE, devname, buflen); assert (rc == 0); buflen = BOUNDDEVBUFSZ; memset (devname, 0, buflen); rc = zmq_getsockopt (socket, ZMQ_BINDTODEVICE, devname, &buflen); assert (rc == 0); assert (!strncmp ("testdev", devname, buflen)); #endif zmq_close (socket); zmq_ctx_term (ctx); } int main (void) { test_setsockopt_tcp_recv_buffer (); test_setsockopt_tcp_send_buffer (); test_setsockopt_use_fd (); test_setsockopt_bindtodevice (); } zeromq-4.2.5/tests/test_issue_566.cpp0000664000372000037200000000753213255253220020404 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // Issue 566 describes a problem in libzmq v4.0.0 where a dealer to router // connection would fail randomly. The test works when the two sockets are // on the same context, and failed when they were on separate contexts. // Fixed by https://github.com/zeromq/libzmq/commit/be25cf. int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx1 = zmq_ctx_new (); assert (ctx1); void *ctx2 = zmq_ctx_new (); assert (ctx2); void *router = zmq_socket (ctx1, ZMQ_ROUTER); int on = 1; int rc = zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &on, sizeof (on)); assert (rc == 0); rc = zmq_bind (router, "tcp://127.0.0.1:*"); assert (rc != -1); rc = zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Repeat often enough to be sure this works as it should for (int cycle = 0; cycle < 100; cycle++) { // Create dealer with unique explicit routing id // We assume the router learns this out-of-band void *dealer = zmq_socket (ctx2, ZMQ_DEALER); char routing_id[10]; sprintf (routing_id, "%09d", cycle); rc = zmq_setsockopt (dealer, ZMQ_ROUTING_ID, routing_id, 10); assert (rc == 0); int rcvtimeo = 1000; rc = zmq_setsockopt (dealer, ZMQ_RCVTIMEO, &rcvtimeo, sizeof (int)); assert (rc == 0); rc = zmq_connect (dealer, my_endpoint); assert (rc == 0); // Router will try to send to dealer, at short intervals. // It typically takes 2-5 msec for the connection to establish // on a loopback interface, but we'll allow up to one second // before failing the test (e.g. for running on a debugger or // a very slow system). for (int attempt = 0; attempt < 500; attempt++) { zmq_poll (0, 0, 2); rc = zmq_send (router, routing_id, 10, ZMQ_SNDMORE); if (rc == -1 && errno == EHOSTUNREACH) continue; assert (rc == 10); rc = zmq_send (router, "HELLO", 5, 0); assert (rc == 5); break; } uint8_t buffer[5]; rc = zmq_recv (dealer, buffer, 5, 0); assert (rc == 5); assert (memcmp (buffer, "HELLO", 5) == 0); close_zero_linger (dealer); } zmq_close (router); zmq_ctx_destroy (ctx1); zmq_ctx_destroy (ctx2); return 0; } zeromq-4.2.5/tests/test_stream_timeout.cpp0000664000372000037200000001760313255253220021715 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. static int get_monitor_event (void *monitor, int *value, char **address) { // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interruped, presumably assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); if (value) *value = *(uint32_t *) (data + 2); // Second frame in message contains event address zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interruped, presumably assert (!zmq_msg_more (&msg)); if (address) { uint8_t *data = (uint8_t *) zmq_msg_data (&msg); size_t size = zmq_msg_size (&msg); *address = (char *) malloc (size + 1); memcpy (*address, data, size); *address[size] = 0; } return event; } static void test_stream_handshake_timeout_accept (void) { int rc; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); // We use this socket in raw mode, to make a connection and send nothing void *stream = zmq_socket (ctx, ZMQ_STREAM); assert (stream); int zero = 0; rc = zmq_setsockopt (stream, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); // We'll be using this socket to test TCP stream handshake timeout void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_setsockopt (dealer, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); int val, tenth = 100; size_t vsize = sizeof (val); // check for the expected default handshake timeout value - 30 sec rc = zmq_getsockopt (dealer, ZMQ_HANDSHAKE_IVL, &val, &vsize); assert (rc == 0); assert (vsize == sizeof (val)); assert (val == 30000); // make handshake timeout faster - 1/10 sec rc = zmq_setsockopt (dealer, ZMQ_HANDSHAKE_IVL, &tenth, sizeof (tenth)); assert (rc == 0); vsize = sizeof (val); // make sure zmq_setsockopt changed the value rc = zmq_getsockopt (dealer, ZMQ_HANDSHAKE_IVL, &val, &vsize); assert (rc == 0); assert (vsize == sizeof (val)); assert (val == tenth); // Create and connect a socket for collecting monitor events on dealer void *dealer_mon = zmq_socket (ctx, ZMQ_PAIR); assert (dealer_mon); rc = zmq_socket_monitor (dealer, "inproc://monitor-dealer", ZMQ_EVENT_CONNECTED | ZMQ_EVENT_DISCONNECTED | ZMQ_EVENT_ACCEPTED); assert (rc == 0); // Connect to the inproc endpoint so we'll get events rc = zmq_connect (dealer_mon, "inproc://monitor-dealer"); assert (rc == 0); // bind dealer socket to accept connection from non-sending stream socket rc = zmq_bind (dealer, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (dealer, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (stream, my_endpoint); assert (rc == 0); // we should get ZMQ_EVENT_ACCEPTED and then ZMQ_EVENT_DISCONNECTED int event = get_monitor_event (dealer_mon, NULL, NULL); assert (event == ZMQ_EVENT_ACCEPTED); event = get_monitor_event (dealer_mon, NULL, NULL); assert (event == ZMQ_EVENT_DISCONNECTED); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_close (dealer_mon); assert (rc == 0); rc = zmq_close (stream); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } static void test_stream_handshake_timeout_connect (void) { int rc; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); // We use this socket in raw mode, to accept a connection and send nothing void *stream = zmq_socket (ctx, ZMQ_STREAM); assert (stream); int zero = 0; rc = zmq_setsockopt (stream, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); rc = zmq_bind (stream, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (stream, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // We'll be using this socket to test TCP stream handshake timeout void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_setsockopt (dealer, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); int val, tenth = 100; size_t vsize = sizeof (val); // check for the expected default handshake timeout value - 30 sec rc = zmq_getsockopt (dealer, ZMQ_HANDSHAKE_IVL, &val, &vsize); assert (rc == 0); assert (vsize == sizeof (val)); assert (val == 30000); // make handshake timeout faster - 1/10 sec rc = zmq_setsockopt (dealer, ZMQ_HANDSHAKE_IVL, &tenth, sizeof (tenth)); assert (rc == 0); vsize = sizeof (val); // make sure zmq_setsockopt changed the value rc = zmq_getsockopt (dealer, ZMQ_HANDSHAKE_IVL, &val, &vsize); assert (rc == 0); assert (vsize == sizeof (val)); assert (val == tenth); // Create and connect a socket for collecting monitor events on dealer void *dealer_mon = zmq_socket (ctx, ZMQ_PAIR); assert (dealer_mon); rc = zmq_socket_monitor (dealer, "inproc://monitor-dealer", ZMQ_EVENT_CONNECTED | ZMQ_EVENT_DISCONNECTED | ZMQ_EVENT_ACCEPTED); assert (rc == 0); // Connect to the inproc endpoint so we'll get events rc = zmq_connect (dealer_mon, "inproc://monitor-dealer"); assert (rc == 0); // connect dealer socket to non-sending stream socket rc = zmq_connect (dealer, my_endpoint); assert (rc == 0); // we should get ZMQ_EVENT_CONNECTED and then ZMQ_EVENT_DISCONNECTED int event = get_monitor_event (dealer_mon, NULL, NULL); assert (event == ZMQ_EVENT_CONNECTED); event = get_monitor_event (dealer_mon, NULL, NULL); assert (event == ZMQ_EVENT_DISCONNECTED); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_close (dealer_mon); assert (rc == 0); rc = zmq_close (stream); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_stream_handshake_timeout_accept (); test_stream_handshake_timeout_connect (); } zeromq-4.2.5/tests/test_ipc_wildcard.cpp0000664000372000037200000000411313255253220021270 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); int rc = zmq_bind (sb, "ipc://*"); assert (rc == 0); char endpoint[200]; size_t size = sizeof (endpoint); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &size); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_metadata.cpp0000664000372000037200000001064413255253220020432 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static void zap_handler (void *handler) { uint8_t metadata[] = {5, 'H', 'e', 'l', 'l', 'o', 0, 0, 0, 5, 'W', 'o', 'r', 'l', 'd'}; // Process ZAP requests forever while (true) { char *version = s_recv (handler); if (!version) break; // Terminating char *sequence = s_recv (handler); char *domain = s_recv (handler); char *address = s_recv (handler); char *routing_id = s_recv (handler); char *mechanism = s_recv (handler); assert (streq (version, "1.0")); assert (streq (mechanism, "NULL")); s_sendmore (handler, version); s_sendmore (handler, sequence); if (streq (domain, "DOMAIN")) { s_sendmore (handler, "200"); s_sendmore (handler, "OK"); s_sendmore (handler, "anonymous"); zmq_send (handler, metadata, sizeof (metadata), 0); } else { s_sendmore (handler, "400"); s_sendmore (handler, "BAD DOMAIN"); s_sendmore (handler, ""); s_send (handler, ""); } free (version); free (sequence); free (domain); free (address); free (routing_id); free (mechanism); } close_zero_linger (handler); } int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // Spawn ZAP handler // We create and bind ZAP socket in main thread to avoid case // where child thread does not start up fast enough. void *handler = zmq_socket (ctx, ZMQ_REP); assert (handler); int rc = zmq_bind (handler, "inproc://zeromq.zap.01"); assert (rc == 0); void *zap_thread = zmq_threadstart (&zap_handler, handler); void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "DOMAIN", 6); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); s_send (client, "This is a message"); zmq_msg_t msg; zmq_msg_init (&msg); rc = zmq_msg_recv (&msg, server, 0); assert (rc != -1); assert (streq (zmq_msg_gets (&msg, "Hello"), "World")); assert (streq (zmq_msg_gets (&msg, "Socket-Type"), "DEALER")); assert (streq (zmq_msg_gets (&msg, "User-Id"), "anonymous")); assert (streq (zmq_msg_gets (&msg, "Peer-Address"), "127.0.0.1")); assert (zmq_msg_gets (&msg, "No Such") == NULL); assert (zmq_errno () == EINVAL); zmq_msg_close (&msg); close_zero_linger (client); close_zero_linger (server); // Shutdown rc = zmq_ctx_term (ctx); assert (rc == 0); // Wait until ZAP handler terminates zmq_threadclose (zap_thread); return 0; } zeromq-4.2.5/tests/testutil_unity.hpp0000664000372000037200000001631513255253220020726 0ustar00travistravis00000000000000#pragma once /* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "../include/zmq.h" #include #include #include #if defined(_MSC_VER) && _MSC_VER <= 1800 #define snprintf _snprintf #endif int test_assert_success_message_errno_helper (int rc, const char *msg, const char *expr) { if (rc == -1) { char buffer[512]; buffer[sizeof (buffer) - 1] = 0; // to ensure defined behavior with VC++ <= 2013 snprintf (buffer, sizeof (buffer) - 1, "%s failed%s%s%s, errno = %i (%s)", expr, msg ? " (additional info: " : "", msg ? msg : "", msg ? ")" : "", zmq_errno (), zmq_strerror (zmq_errno ())); TEST_FAIL_MESSAGE (buffer); } return rc; } #define TEST_ASSERT_SUCCESS_MESSAGE_ERRNO(expr, msg) \ test_assert_success_message_errno_helper (expr, msg, #expr) #define TEST_ASSERT_SUCCESS_ERRNO(expr) \ test_assert_success_message_errno_helper (expr, NULL, #expr) #define TEST_ASSERT_FAILURE_ERRNO(error_code, expr) \ { \ int rc = (expr); \ TEST_ASSERT_EQUAL_INT (-1, rc); \ TEST_ASSERT_EQUAL_INT (error_code, errno); \ } void send_string_expect_success (void *socket, const char *str, int flags) { const size_t len = str ? strlen (str) : 0; const int rc = zmq_send (socket, str, len, flags); TEST_ASSERT_EQUAL_INT ((int) len, rc); } void recv_string_expect_success (void *socket, const char *str, int flags) { const size_t len = str ? strlen (str) : 0; char buffer[255]; TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (sizeof (buffer), len, "recv_string_expect_success cannot be " "used for strings longer than 255 " "characters"); const int rc = TEST_ASSERT_SUCCESS_ERRNO (zmq_recv (socket, buffer, sizeof (buffer), 0)); TEST_ASSERT_EQUAL_INT ((int) len, rc); if (str) TEST_ASSERT_EQUAL_STRING_LEN (str, buffer, len); } // do not call from tests directly, use setup_test_context, get_test_context and teardown_test_context only void *internal_manage_test_context (bool init, bool clear) { static void *test_context = NULL; if (clear) { TEST_ASSERT_NOT_NULL (test_context); TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_term (test_context)); test_context = NULL; } else { if (init) { TEST_ASSERT_NULL (test_context); test_context = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (test_context); } } return test_context; } #define MAX_TEST_SOCKETS 128 void internal_manage_test_sockets (void *socket, bool add) { static void *test_sockets[MAX_TEST_SOCKETS]; static size_t test_socket_count = 0; if (!socket) { assert (!add); // force-close all sockets if (test_socket_count) { for (size_t i = 0; i < test_socket_count; ++i) { close_zero_linger (test_sockets[i]); } fprintf (stderr, "WARNING: Forced closure of %i sockets, this is an " "implementation error unless the test case failed\n", (int) test_socket_count); test_socket_count = 0; } } else { if (add) { ++test_socket_count; TEST_ASSERT_LESS_THAN_MESSAGE (MAX_TEST_SOCKETS, test_socket_count, "MAX_TEST_SOCKETS must be " "increased, or you cannot use the " "test context"); test_sockets[test_socket_count - 1] = socket; } else { bool found = false; for (size_t i = 0; i < test_socket_count; ++i) { if (test_sockets[i] == socket) { found = true; } if (found) { if (i < test_socket_count) test_sockets[i] = test_sockets[i + 1]; } } TEST_ASSERT_TRUE (found); --test_socket_count; } } } void setup_test_context () { internal_manage_test_context (true, false); } void *get_test_context () { return internal_manage_test_context (false, false); } void teardown_test_context () { // this condition allows an explicit call to teardown_test_context from a // test. if this is never used, it should probably be removed, to detect // misuses if (get_test_context ()) { internal_manage_test_sockets (NULL, false); internal_manage_test_context (false, true); } } void *test_context_socket (int type) { void *const socket = zmq_socket (get_test_context (), type); TEST_ASSERT_NOT_NULL (socket); internal_manage_test_sockets (socket, true); return socket; } void *test_context_socket_close (void *socket) { TEST_ASSERT_SUCCESS_ERRNO (zmq_close (socket)); internal_manage_test_sockets (socket, false); return socket; } void bind_loopback (void *socket, int ipv6, char *my_endpoint, size_t len) { if (ipv6 && !is_ipv6_available ()) { TEST_IGNORE_MESSAGE ("ipv6 is not available"); } TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (socket, ZMQ_IPV6, &ipv6, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO ( zmq_bind (socket, ipv6 ? "tcp://[::1]:*" : "tcp://127.0.0.1:*")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); } void bind_loopback_ipv4 (void *socket, char *my_endpoint, size_t len) { bind_loopback (socket, false, my_endpoint, len); } zeromq-4.2.5/tests/test_xpub_verbose.cpp0000664000372000037200000003666213255253220021365 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include void setUp () { } void tearDown () { } void test_xpub_verbose_one_sub () { int rc; char buffer[2]; void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *pub = zmq_socket (ctx, ZMQ_XPUB); TEST_ASSERT_NOT_NULL (pub); rc = zmq_bind (pub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); void *sub = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub); rc = zmq_connect (sub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe for A rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe socket for B instead rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "B", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'B'); // Subscribe again for A again rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time it is duplicated, so it will be filtered out rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); int verbose = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_VERBOSE, &verbose, sizeof (int)); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe socket for A again rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time with VERBOSE the duplicated sub will be received rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Sending A message and B Message rc = zmq_send_const (pub, "A", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_send_const (pub, "B", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_recv (sub, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); rc = zmq_recv (sub, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'B'); // Clean up. rc = zmq_close (pub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_ctx_term (ctx); TEST_ASSERT_EQUAL_INT (0, rc); } void test_xpub_verbose_two_subs () { int rc; char buffer[2]; void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *pub = zmq_socket (ctx, ZMQ_XPUB); TEST_ASSERT_NOT_NULL (pub); rc = zmq_bind (pub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); void *sub0 = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub0); rc = zmq_connect (sub0, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); void *sub1 = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub1); rc = zmq_connect (sub1, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe for A on the first socket rc = zmq_setsockopt (sub0, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe for A on the second socket rc = zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time it is duplicated, so it will be filtered out rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Subscribe socket for B instead rc = zmq_setsockopt (sub0, ZMQ_SUBSCRIBE, "B", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'B'); int verbose = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_VERBOSE, &verbose, sizeof (int)); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe socket for A again rc = zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time with VERBOSE the duplicated sub will be received rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Sending A message and B Message rc = zmq_send_const (pub, "A", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_send_const (pub, "B", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_recv (sub0, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); rc = zmq_recv (sub1, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); rc = zmq_recv (sub0, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'B'); // Clean up. rc = zmq_close (pub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub0); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub1); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_ctx_term (ctx); TEST_ASSERT_EQUAL_INT (0, rc); } void test_xpub_verboser_one_sub () { int rc; char buffer[3]; void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_XPUB); TEST_ASSERT_NOT_NULL (pub); rc = zmq_bind (pub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub); rc = zmq_connect (sub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); // Unsubscribe for A, does not exist yet rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Does not exist, so it will be filtered out by XSUB rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Subscribe for A rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe again for A again, XSUB will increase refcount rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time it is duplicated, so it will be filtered out by XPUB rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Unsubscribe for A, this time it exists in XPUB rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // XSUB refcounts and will not actually send unsub to PUB until the number // of unsubs match the earlier subs rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive unsubscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // XSUB only sends the last and final unsub, so XPUB will only receive 1 rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Unsubscribe for A, does not exist anymore rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Does not exist, so it will be filtered out by XSUB rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); int verbose = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_VERBOSER, &verbose, sizeof (int)); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe socket for A again rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber, did not exist anymore rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Sending A message to make sure everything still works rc = zmq_send_const (pub, "A", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_recv (sub, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); // Unsubscribe for A, this time it exists rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive unsubscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // Unsubscribe for A again, it does not exist anymore so XSUB will filter rc = zmq_setsockopt (sub, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // XSUB only sends unsub if it matched it in its trie, IOW: it will only // send it if it existed in the first place even with XPUB_VERBBOSER rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Clean up. rc = zmq_close (pub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_ctx_term (ctx); TEST_ASSERT_EQUAL_INT (0, rc); } void test_xpub_verboser_two_subs () { int rc; char buffer[3]; void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *pub = zmq_socket (ctx, ZMQ_XPUB); TEST_ASSERT_NOT_NULL (pub); rc = zmq_bind (pub, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); void *sub0 = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub0); rc = zmq_connect (sub0, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); void *sub1 = zmq_socket (ctx, ZMQ_SUB); TEST_ASSERT_NOT_NULL (sub1); rc = zmq_connect (sub1, "inproc://soname"); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe for A rc = zmq_setsockopt (sub0, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Subscribe again for A on the other socket rc = zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // This time it is duplicated, so it will be filtered out by XPUB rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Unsubscribe for A, this time it exists in XPUB rc = zmq_setsockopt (sub0, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // sub1 is still subscribed, so no notification rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Unsubscribe the second socket to trigger the notification rc = zmq_setsockopt (sub1, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive unsubscriptions since all sockets are gone rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // Make really sure there is only one notification rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); int verbose = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_VERBOSER, &verbose, sizeof (int)); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe socket for A again rc = zmq_setsockopt (sub0, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Subscribe socket for A again rc = zmq_setsockopt (sub1, ZMQ_SUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive subscriptions from subscriber, did not exist anymore rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // VERBOSER is set, so subs from both sockets are received rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 1); assert (buffer[1] == 'A'); // Sending A message to make sure everything still works rc = zmq_send_const (pub, "A", 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_recv (sub0, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); rc = zmq_recv (sub1, buffer, 1, 0); TEST_ASSERT_EQUAL_INT (1, rc); assert (buffer[0] == 'A'); // Unsubscribe for A rc = zmq_setsockopt (sub1, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive unsubscriptions from first subscriber due to VERBOSER rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // Unsubscribe for A again from the other socket rc = zmq_setsockopt (sub0, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Receive unsubscriptions from first subscriber due to VERBOSER rc = zmq_recv (pub, buffer, 2, 0); TEST_ASSERT_EQUAL_INT (2, rc); assert (buffer[0] == 0); assert (buffer[1] == 'A'); // Unsubscribe again to make sure it gets filtered now rc = zmq_setsockopt (sub1, ZMQ_UNSUBSCRIBE, "A", 1); TEST_ASSERT_EQUAL_INT (0, rc); // Unmatched, so XSUB filters even with VERBOSER rc = zmq_recv (pub, buffer, 1, ZMQ_DONTWAIT); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); // Clean up. rc = zmq_close (pub); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub0); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sub1); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_ctx_term (ctx); TEST_ASSERT_EQUAL_INT (0, rc); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_xpub_verbose_one_sub); RUN_TEST (test_xpub_verbose_two_subs); RUN_TEST (test_xpub_verboser_one_sub); RUN_TEST (test_xpub_verboser_two_subs); return 0; } zeromq-4.2.5/tests/test_reqrep_vmci.cpp0000664000372000037200000000420113255253220021156 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include #include #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); std::stringstream s; s << "vmci://" << VMCISock_GetLocalCID () << ":" << 5560; std::string endpoint = s.str (); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, endpoint.c_str ()); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, endpoint.c_str ()); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_reqrep_tipc.cpp0000664000372000037200000000414013255253220021161 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } fprintf (stderr, "test_reqrep_tipc running...\n"); void *ctx = zmq_init (1); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); int rc = zmq_bind (sb, "tipc://{5560,0,0}"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, "tipc://{5560,0}@0.0.0"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_shutdown_stress.cpp0000664000372000037200000000567513255253220022140 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #define THREAD_COUNT 100 struct thread_data { void *ctx; char endpoint[MAX_SOCKET_STRING]; }; extern "C" { static void worker (void *data) { int rc; void *socket; struct thread_data *tdata = (struct thread_data *) data; socket = zmq_socket (tdata->ctx, ZMQ_SUB); assert (socket); rc = zmq_connect (socket, tdata->endpoint); assert (rc == 0); // Start closing the socket while the connecting process is underway. rc = zmq_close (socket); assert (rc == 0); } } int main (void) { setup_test_environment (); void *socket; int i; int j; int rc; void *threads[THREAD_COUNT]; for (j = 0; j != 10; j++) { // Check the shutdown with many parallel I/O threads. struct thread_data tdata; tdata.ctx = zmq_ctx_new (); assert (tdata.ctx); zmq_ctx_set (tdata.ctx, ZMQ_IO_THREADS, 7); socket = zmq_socket (tdata.ctx, ZMQ_PUB); assert (socket); rc = zmq_bind (socket, "tcp://127.0.0.1:*"); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (socket, ZMQ_LAST_ENDPOINT, tdata.endpoint, &len); assert (rc == 0); for (i = 0; i != THREAD_COUNT; i++) { threads[i] = zmq_threadstart (&worker, &tdata); } for (i = 0; i != THREAD_COUNT; i++) { zmq_threadclose (threads[i]); } rc = zmq_close (socket); assert (rc == 0); rc = zmq_ctx_term (tdata.ctx); assert (rc == 0); } return 0; } zeromq-4.2.5/tests/test_spec_req.cpp0000664000372000037200000001777613255253220020470 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *bind_address = 0; char connect_address[MAX_SOCKET_STRING]; void test_round_robin_out (void *ctx) { void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); int rc = zmq_bind (req, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (req, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *rep[services]; for (size_t peer = 0; peer < services; peer++) { rep[peer] = zmq_socket (ctx, ZMQ_REP); assert (rep[peer]); int timeout = 250; rc = zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (rep[peer], connect_address); assert (rc == 0); } // We have to give the connects time to finish otherwise the requests // will not properly round-robin. We could alternatively connect the // REQ sockets to the REP sockets. msleep (SETTLE_TIME); // Send our peer-replies, and expect every REP it used once in order for (size_t peer = 0; peer < services; peer++) { s_send_seq (req, "ABC", SEQ_END); s_recv_seq (rep[peer], "ABC", SEQ_END); s_send_seq (rep[peer], "DEF", SEQ_END); s_recv_seq (req, "DEF", SEQ_END); } close_zero_linger (req); for (size_t peer = 0; peer < services; peer++) close_zero_linger (rep[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_req_only_listens_to_current_peer (void *ctx) { void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); int rc = zmq_setsockopt (req, ZMQ_ROUTING_ID, "A", 2); assert (rc == 0); rc = zmq_bind (req, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (req, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 3; void *router[services]; for (size_t i = 0; i < services; ++i) { router[i] = zmq_socket (ctx, ZMQ_ROUTER); assert (router[i]); int timeout = 250; rc = zmq_setsockopt (router[i], ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); assert (rc == 0); int enabled = 1; rc = zmq_setsockopt (router[i], ZMQ_ROUTER_MANDATORY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_connect (router[i], connect_address); assert (rc == 0); } // Wait for connects to finish. msleep (SETTLE_TIME); for (size_t i = 0; i < services; ++i) { // There still is a race condition when a stale peer's message // arrives at the REQ just after a request was sent to that peer. // To avoid that happening in the test, sleep for a bit. rc = zmq_poll (0, 0, 10); assert (rc == 0); s_send_seq (req, "ABC", SEQ_END); // Receive on router i s_recv_seq (router[i], "A", 0, "ABC", SEQ_END); // Send back replies on all routers for (size_t j = 0; j < services; ++j) { const char *replies[] = {"WRONG", "GOOD"}; const char *reply = replies[i == j ? 1 : 0]; s_send_seq (router[j], "A", 0, reply, SEQ_END); } // Receive only the good reply s_recv_seq (req, "GOOD", SEQ_END); } close_zero_linger (req); for (size_t i = 0; i < services; ++i) close_zero_linger (router[i]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_req_message_format (void *ctx) { void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); int rc = zmq_bind (req, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (req, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); rc = zmq_connect (router, connect_address); assert (rc == 0); // Send a multi-part request. s_send_seq (req, "ABC", "DEF", SEQ_END); zmq_msg_t msg; zmq_msg_init (&msg); // Receive peer routing id rc = zmq_msg_recv (&msg, router, 0); assert (rc != -1); assert (zmq_msg_size (&msg) > 0); zmq_msg_t peer_id_msg; zmq_msg_init (&peer_id_msg); zmq_msg_copy (&peer_id_msg, &msg); int more = 0; size_t more_size = sizeof (more); rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); assert (more); // Receive the rest. s_recv_seq (router, 0, "ABC", "DEF", SEQ_END); // Send back a single-part reply. rc = zmq_msg_send (&peer_id_msg, router, ZMQ_SNDMORE); assert (rc != -1); s_send_seq (router, 0, "GHI", SEQ_END); // Receive reply. s_recv_seq (req, "GHI", SEQ_END); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_msg_close (&peer_id_msg); assert (rc == 0); close_zero_linger (req); close_zero_linger (router); // Wait for disconnects. msleep (SETTLE_TIME); } void test_block_on_send_no_peers (void *ctx) { void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); int timeout = 250; int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); assert (rc == 0); rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_send (sc, 0, 0, 0); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_close (sc); assert (rc == 0); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); const char *binds[] = {"inproc://a", "tcp://127.0.0.1:*"}; for (int transport = 0; transport < 2; transport++) { bind_address = binds[transport]; // SHALL route outgoing messages to connected peers using a round-robin // strategy. test_round_robin_out (ctx); // The request and reply messages SHALL have this format on the wire: // * A delimiter, consisting of an empty frame, added by the REQ socket. // * One or more data frames, comprising the message visible to the // application. test_req_message_format (ctx); // SHALL block on sending, or return a suitable error, when it has no // connected peers. test_block_on_send_no_peers (ctx); // SHALL accept an incoming message only from the last peer that it sent a // request to. // SHALL discard silently any messages received from other peers. // PH: this test is still failing; disabled for now to allow build to // complete. // test_req_only_listens_to_current_peer (ctx); } int rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_sub_forward_tipc.cpp0000664000372000037200000000655413255253220022213 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } fprintf (stderr, "test_sub_forward running...\n"); void *ctx = zmq_init (1); assert (ctx); // First, create an intermediate device. void *xpub = zmq_socket (ctx, ZMQ_XPUB); assert (xpub); int rc = zmq_bind (xpub, "tipc://{5560,0,0}"); assert (rc == 0); void *xsub = zmq_socket (ctx, ZMQ_XSUB); assert (xsub); rc = zmq_bind (xsub, "tipc://{5561,0,0}"); assert (rc == 0); // Create a publisher. void *pub = zmq_socket (ctx, ZMQ_PUB); assert (pub); rc = zmq_connect (pub, "tipc://{5561,0}@0.0.0"); assert (rc == 0); // Create a subscriber. void *sub = zmq_socket (ctx, ZMQ_SUB); assert (sub); rc = zmq_connect (sub, "tipc://{5560,0}@0.0.0"); assert (rc == 0); // Subscribe for all messages. rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); // Pass the subscription upstream through the device. char buff[32]; rc = zmq_recv (xpub, buff, sizeof (buff), 0); assert (rc >= 0); rc = zmq_send (xsub, buff, rc, 0); assert (rc >= 0); // Wait a bit till the subscription gets to the publisher. msleep (SETTLE_TIME); // Send an empty message. rc = zmq_send (pub, NULL, 0, 0); assert (rc == 0); // Pass the message downstream through the device. rc = zmq_recv (xsub, buff, sizeof (buff), 0); assert (rc >= 0); rc = zmq_send (xpub, buff, rc, 0); assert (rc >= 0); // Receive the message in the subscriber. rc = zmq_recv (sub, buff, sizeof (buff), 0); assert (rc == 0); // Clean up. rc = zmq_close (xpub); assert (rc == 0); rc = zmq_close (xsub); assert (rc == 0); rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_inproc_connect.cpp0000664000372000037200000003263013255253220021654 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static void pusher (void *ctx) { // Connect first void *connectSocket = zmq_socket (ctx, ZMQ_PAIR); assert (connectSocket); int rc = zmq_connect (connectSocket, "inproc://sink"); assert (rc == 0); // Queue up some data rc = zmq_send_const (connectSocket, "foobar", 6, 0); assert (rc == 6); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); } static void simult_conn (void *payload) { // Pull out arguments - context followed by endpoint string void *ctx = (void *) ((void **) payload)[0]; char *endpt = (char *) ((void **) payload)[1]; // Connect void *connectSocket = zmq_socket (ctx, ZMQ_SUB); assert (connectSocket); int rc = zmq_connect (connectSocket, endpt); assert (rc == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); } static void simult_bind (void *payload) { // Pull out arguments - context followed by endpoint string void *ctx = (void *) ((void **) payload)[0]; char *endpt = (char *) ((void **) payload)[1]; // Bind void *bindSocket = zmq_socket (ctx, ZMQ_PUB); assert (bindSocket); int rc = zmq_bind (bindSocket, endpt); assert (rc == 0); // Cleanup rc = zmq_close (bindSocket); assert (rc == 0); } void test_bind_before_connect () { void *ctx = zmq_ctx_new (); assert (ctx); // Bind first void *bindSocket = zmq_socket (ctx, ZMQ_PAIR); assert (bindSocket); int rc = zmq_bind (bindSocket, "inproc://bbc"); assert (rc == 0); // Now connect void *connectSocket = zmq_socket (ctx, ZMQ_PAIR); assert (connectSocket); rc = zmq_connect (connectSocket, "inproc://bbc"); assert (rc == 0); // Queue up some data rc = zmq_send_const (connectSocket, "foobar", 6, 0); assert (rc == 6); // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_close (bindSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_connect_before_bind () { void *ctx = zmq_ctx_new (); assert (ctx); // Connect first void *connectSocket = zmq_socket (ctx, ZMQ_PAIR); assert (connectSocket); int rc = zmq_connect (connectSocket, "inproc://cbb"); assert (rc == 0); // Queue up some data rc = zmq_send_const (connectSocket, "foobar", 6, 0); assert (rc == 6); // Now bind void *bindSocket = zmq_socket (ctx, ZMQ_PAIR); assert (bindSocket); rc = zmq_bind (bindSocket, "inproc://cbb"); assert (rc == 0); // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_close (bindSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_connect_before_bind_pub_sub () { void *ctx = zmq_ctx_new (); assert (ctx); // Connect first void *connectSocket = zmq_socket (ctx, ZMQ_PUB); assert (connectSocket); int rc = zmq_connect (connectSocket, "inproc://cbbps"); assert (rc == 0); // Queue up some data, this will be dropped rc = zmq_send_const (connectSocket, "before", 6, 0); assert (rc == 6); // Now bind void *bindSocket = zmq_socket (ctx, ZMQ_SUB); assert (bindSocket); rc = zmq_setsockopt (bindSocket, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); rc = zmq_bind (bindSocket, "inproc://cbbps"); assert (rc == 0); // Wait for pub-sub connection to happen msleep (SETTLE_TIME); // Queue up some data, this not will be dropped rc = zmq_send_const (connectSocket, "after", 6, 0); assert (rc == 6); // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("after", data, 5) == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_close (bindSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_connect_before_bind_ctx_term () { void *ctx = zmq_ctx_new (); assert (ctx); for (int i = 0; i < 20; ++i) { // Connect first void *connectSocket = zmq_socket (ctx, ZMQ_ROUTER); assert (connectSocket); char ep[20]; sprintf (ep, "inproc://cbbrr%d", i); int rc = zmq_connect (connectSocket, ep); assert (rc == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); } int rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_multiple_connects () { const unsigned int no_of_connects = 10; void *ctx = zmq_ctx_new (); assert (ctx); int rc; void *connectSocket[no_of_connects]; // Connect first for (unsigned int i = 0; i < no_of_connects; ++i) { connectSocket[i] = zmq_socket (ctx, ZMQ_PUSH); assert (connectSocket[i]); rc = zmq_connect (connectSocket[i], "inproc://multiple"); assert (rc == 0); // Queue up some data rc = zmq_send_const (connectSocket[i], "foobar", 6, 0); assert (rc == 6); } // Now bind void *bindSocket = zmq_socket (ctx, ZMQ_PULL); assert (bindSocket); rc = zmq_bind (bindSocket, "inproc://multiple"); assert (rc == 0); for (unsigned int i = 0; i < no_of_connects; ++i) { // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); } // Cleanup for (unsigned int i = 0; i < no_of_connects; ++i) { rc = zmq_close (connectSocket[i]); assert (rc == 0); } rc = zmq_close (bindSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_multiple_threads () { const unsigned int no_of_threads = 30; void *ctx = zmq_ctx_new (); assert (ctx); int rc; void *threads[no_of_threads]; // Connect first for (unsigned int i = 0; i < no_of_threads; ++i) { threads[i] = zmq_threadstart (&pusher, ctx); } // Now bind void *bindSocket = zmq_socket (ctx, ZMQ_PULL); assert (bindSocket); rc = zmq_bind (bindSocket, "inproc://sink"); assert (rc == 0); for (unsigned int i = 0; i < no_of_threads; ++i) { // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); } // Cleanup for (unsigned int i = 0; i < no_of_threads; ++i) { zmq_threadclose (threads[i]); } rc = zmq_close (bindSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_simultaneous_connect_bind_threads () { const unsigned int no_of_times = 50; void *ctx = zmq_ctx_new (); assert (ctx); void *threads[no_of_times * 2]; void *thr_args[no_of_times][2]; char endpts[no_of_times][20]; // Set up thread arguments: context followed by endpoint string for (unsigned int i = 0; i < no_of_times; ++i) { thr_args[i][0] = (void *) ctx; thr_args[i][1] = (void *) endpts[i]; sprintf (endpts[i], "inproc://foo_%d", i); } // Spawn all threads as simultaneously as possible for (unsigned int i = 0; i < no_of_times; ++i) { threads[i * 2 + 0] = zmq_threadstart (&simult_conn, (void *) thr_args[i]); threads[i * 2 + 1] = zmq_threadstart (&simult_bind, (void *) thr_args[i]); } // Close all threads for (unsigned int i = 0; i < no_of_times; ++i) { zmq_threadclose (threads[i * 2 + 0]); zmq_threadclose (threads[i * 2 + 1]); } int rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_routing_id () { // Create the infrastructure void *ctx = zmq_ctx_new (); assert (ctx); void *sc = zmq_socket (ctx, ZMQ_DEALER); assert (sc); int rc = zmq_connect (sc, "inproc://routing_id"); assert (rc == 0); void *sb = zmq_socket (ctx, ZMQ_ROUTER); assert (sb); rc = zmq_bind (sb, "inproc://routing_id"); assert (rc == 0); // Send 2-part message. rc = zmq_send (sc, "A", 1, ZMQ_SNDMORE); assert (rc == 1); rc = zmq_send (sc, "B", 1, 0); assert (rc == 1); // Routing id comes first. zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, sb, 0); assert (rc >= 0); int more = zmq_msg_more (&msg); assert (more == 1); // Then the first part of the message body. rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); more = zmq_msg_more (&msg); assert (more == 1); // And finally, the second part of the message body. rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); more = zmq_msg_more (&msg); assert (more == 0); // Deallocate the infrastructure. rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_connect_only () { void *ctx = zmq_ctx_new (); assert (ctx); void *connectSocket = zmq_socket (ctx, ZMQ_PUSH); assert (connectSocket); int rc = zmq_connect (connectSocket, "inproc://a"); assert (rc == 0); rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_unbind () { void *ctx = zmq_ctx_new (); assert (ctx); // Bind and unbind socket 1 void *bindSocket1 = zmq_socket (ctx, ZMQ_PAIR); assert (bindSocket1); int rc = zmq_bind (bindSocket1, "inproc://unbind"); assert (rc == 0); zmq_unbind (bindSocket1, "inproc://unbind"); assert (rc == 0); // Bind socket 2 void *bindSocket2 = zmq_socket (ctx, ZMQ_PAIR); assert (bindSocket2); rc = zmq_bind (bindSocket2, "inproc://unbind"); assert (rc == 0); // Now connect void *connectSocket = zmq_socket (ctx, ZMQ_PAIR); assert (connectSocket); rc = zmq_connect (connectSocket, "inproc://unbind"); assert (rc == 0); // Queue up some data rc = zmq_send_const (connectSocket, "foobar", 6, 0); assert (rc == 6); // Read pending message zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, bindSocket2, 0); assert (rc == 6); void *data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_close (bindSocket1); assert (rc == 0); rc = zmq_close (bindSocket2); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_shutdown_during_pend () { void *ctx = zmq_ctx_new (); assert (ctx); // Connect first void *connectSocket = zmq_socket (ctx, ZMQ_PAIR); assert (connectSocket); int rc = zmq_connect (connectSocket, "inproc://cbb"); assert (rc == 0); zmq_ctx_shutdown (ctx); // Cleanup rc = zmq_close (connectSocket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_bind_before_connect (); test_connect_before_bind (); test_connect_before_bind_pub_sub (); test_connect_before_bind_ctx_term (); test_multiple_connects (); test_multiple_threads (); test_simultaneous_connect_bind_threads (); test_routing_id (); test_connect_only (); test_unbind (); test_shutdown_during_pend (); return 0; } zeromq-4.2.5/tests/test_address_tipc.cpp0000664000372000037200000001005613255253220021313 0ustar00travistravis00000000000000/* Copyright (c) 2007-2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include void setUp () { } void tearDown () { } void test_tipc_port_name_and_domain () { void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); // test Port Name addressing void *sb = zmq_socket (ctx, ZMQ_REP); TEST_ASSERT_NOT_NULL (sb); int rc = zmq_bind (sb, "tipc://{5560,0,0}"); TEST_ASSERT_EQUAL_INT (0, rc); void *sc = zmq_socket (ctx, ZMQ_REQ); TEST_ASSERT_NOT_NULL (sc); rc = zmq_connect (sc, "tipc://{5560,0}@0.0.0"); TEST_ASSERT_EQUAL_INT (0, rc); bounce (sb, sc); rc = zmq_close (sc); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sb); TEST_ASSERT_EQUAL_INT (0, rc); zmq_ctx_term (ctx); } void test_tipc_port_identity () { char endpoint[256]; size_t size = 256; unsigned int z, c, n, ref; void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); TEST_ASSERT_NOT_NULL (sb); void *sc = zmq_socket (ctx, ZMQ_REQ); TEST_ASSERT_NOT_NULL (sc); // Test binding to random Port Identity int rc = zmq_bind (sb, "tipc://<*>"); TEST_ASSERT_EQUAL_INT (0, rc); // Test resolving assigned address, should return a properly formatted string rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, &endpoint[0], &size); TEST_ASSERT_EQUAL_INT (0, rc); rc = sscanf (&endpoint[0], "tipc://<%u.%u.%u:%u>", &z, &c, &n, &ref); TEST_ASSERT_EQUAL_INT (4, rc); rc = zmq_connect (sc, endpoint); TEST_ASSERT_EQUAL_INT (0, rc); bounce (sb, sc); rc = zmq_close (sc); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (sb); TEST_ASSERT_EQUAL_INT (0, rc); zmq_ctx_term (ctx); } void test_tipc_bad_addresses () { void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); // Test Port Name addressing void *sb = zmq_socket (ctx, ZMQ_REP); TEST_ASSERT_NOT_NULL (sb); // Test binding to a fixed address, should fail int rc = zmq_bind (sb, "tipc://<1.2.3:123123>"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EINVAL, errno); // Test connecting to random identity, should fail rc = zmq_connect (sb, "tipc://<*>"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EINVAL, errno); // Clean up rc = zmq_close (sb); TEST_ASSERT_EQUAL_INT (0, rc); zmq_ctx_term (ctx); } int main () { setup_test_environment (); if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } UNITY_BEGIN (); RUN_TEST (test_tipc_port_name_and_domain); RUN_TEST (test_tipc_port_identity); RUN_TEST (test_tipc_bad_addresses); return UNITY_END (); } zeromq-4.2.5/tests/test_thread_safe.cpp0000664000372000037200000000716513255253220021123 0ustar00travistravis00000000000000/*: Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } // Client threads loop on send/recv until told to exit void client_thread (void *client) { for (int count = 0; count < 15000; count++) { send_string_expect_success (client, "0", 0); } send_string_expect_success (client, "1", 0); } void test_thread_safe () { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *server = test_context_socket (ZMQ_SERVER); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (server, "tcp://127.0.0.1:*")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); void *client = test_context_socket (ZMQ_CLIENT); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (client, my_endpoint)); void *t1 = zmq_threadstart (client_thread, client); void *t2 = zmq_threadstart (client_thread, client); char data; int threads_completed = 0; while (threads_completed < 2) { TEST_ASSERT_SUCCESS_ERRNO (zmq_recv (server, &data, 1, 0)); if (data == '1') threads_completed++; // Thread ended } zmq_threadclose (t1); zmq_threadclose (t2); test_context_socket_close (server); test_context_socket_close (client); } void test_getsockopt_thread_safe (void *const socket) { int thread_safe; size_t size = sizeof (int); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (socket, ZMQ_THREAD_SAFE, &thread_safe, &size)); TEST_ASSERT_EQUAL_INT (1, thread_safe); } void test_client_getsockopt_thread_safe () { void *client = test_context_socket (ZMQ_CLIENT); test_getsockopt_thread_safe (client); test_context_socket_close (client); } void test_server_getsockopt_thread_safe () { void *server = test_context_socket (ZMQ_SERVER); test_getsockopt_thread_safe (server); test_context_socket_close (server); } int main (void) { setup_test_environment (); // TODO this file could be merged with test_client_server UNITY_BEGIN (); RUN_TEST (test_client_getsockopt_thread_safe); RUN_TEST (test_server_getsockopt_thread_safe); RUN_TEST (test_thread_safe); return UNITY_END (); } zeromq-4.2.5/tests/test_msg_ffn.cpp0000664000372000037200000001102013255253220020256 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" void ffn (void *data, void *hint) { // Signal that ffn has been called by writing "freed" to hint (void) data; // Suppress 'unused' warnings at compile time memcpy (hint, (void *) "freed", 5); } int main (void) { setup_test_environment (); // Create the infrastructure void *ctx = zmq_ctx_new (); assert (ctx); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); int rc = zmq_bind (router, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_connect (dealer, my_endpoint); assert (rc == 0); // Test that creating and closing a message triggers ffn zmq_msg_t msg; char hint[5]; char data[255]; memset (data, 0, 255); memcpy (data, (void *) "data", 4); memcpy (hint, (void *) "hint", 4); rc = zmq_msg_init_data (&msg, (void *) data, 255, ffn, (void *) hint); assert (rc == 0); rc = zmq_msg_close (&msg); assert (rc == 0); msleep (SETTLE_TIME); assert (memcmp (hint, "freed", 5) == 0); memcpy (hint, (void *) "hint", 4); // Making and closing a copy triggers ffn zmq_msg_t msg2; zmq_msg_init (&msg2); rc = zmq_msg_init_data (&msg, (void *) data, 255, ffn, (void *) hint); assert (rc == 0); rc = zmq_msg_copy (&msg2, &msg); assert (rc == 0); rc = zmq_msg_close (&msg2); assert (rc == 0); rc = zmq_msg_close (&msg); assert (rc == 0); msleep (SETTLE_TIME); assert (memcmp (hint, "freed", 5) == 0); memcpy (hint, (void *) "hint", 4); // Test that sending a message triggers ffn rc = zmq_msg_init_data (&msg, (void *) data, 255, ffn, (void *) hint); assert (rc == 0); zmq_msg_send (&msg, dealer, 0); char buf[255]; rc = zmq_recv (router, buf, 255, 0); assert (rc > -1); rc = zmq_recv (router, buf, 255, 0); assert (rc == 255); assert (memcmp (data, buf, 4) == 0); msleep (SETTLE_TIME); assert (memcmp (hint, "freed", 5) == 0); memcpy (hint, (void *) "hint", 4); rc = zmq_msg_close (&msg); assert (rc == 0); // Sending a copy of a message triggers ffn rc = zmq_msg_init (&msg2); assert (rc == 0); rc = zmq_msg_init_data (&msg, (void *) data, 255, ffn, (void *) hint); assert (rc == 0); rc = zmq_msg_copy (&msg2, &msg); assert (rc == 0); zmq_msg_send (&msg, dealer, 0); rc = zmq_recv (router, buf, 255, 0); assert (rc > -1); rc = zmq_recv (router, buf, 255, 0); assert (rc == 255); assert (memcmp (data, buf, 4) == 0); rc = zmq_msg_close (&msg2); assert (rc == 0); rc = zmq_msg_close (&msg); assert (rc == 0); msleep (SETTLE_TIME); assert (memcmp (hint, "freed", 5) == 0); memcpy (hint, (void *) "hint", 4); // Deallocate the infrastructure. rc = zmq_close (router); assert (rc == 0); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_pair_inproc.cpp0000664000372000037200000000477313255253220021165 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); int rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, "inproc://a"); assert (rc == 0); bounce (sb, sc); // Test zmq_send_const rc = zmq_send_const (sb, "foo", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send_const (sb, "foobar", 6, 0); assert (rc == 6); zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, sc, 0); assert (rc == 3); assert (zmq_msg_size (&msg) == 3); void *data = zmq_msg_data (&msg); assert (memcmp ("foo", data, 3) == 0); rc = zmq_msg_recv (&msg, sc, 0); assert (rc == 6); data = zmq_msg_data (&msg); assert (memcmp ("foobar", data, 6) == 0); // Cleanup rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_router_mandatory.cpp0000664000372000037200000002162013255253220022244 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } #ifdef ZMQ_BUILD_DRAFT_API bool send_msg_to_peer_if_ready (void *router, const char *peer_routing_id) { int rc = TEST_ASSERT_SUCCESS_MESSAGE_ERRNO ( zmq_socket_get_peer_state (router, peer_routing_id, 1), peer_routing_id); if (rc & ZMQ_POLLOUT) { send_string_expect_success (router, peer_routing_id, ZMQ_SNDMORE | ZMQ_DONTWAIT); send_string_expect_success (router, "Hello", ZMQ_DONTWAIT); return true; } return false; } #endif void test_get_peer_state () { #ifdef ZMQ_BUILD_DRAFT_API void *router = test_context_socket (ZMQ_ROUTER); int mandatory = 1; TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory))); const char *my_endpoint = "inproc://test_get_peer_state"; TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (router, my_endpoint)); void *dealer1 = test_context_socket (ZMQ_DEALER); void *dealer2 = test_context_socket (ZMQ_DEALER); // Lower HWMs to allow doing the test with fewer messages const int hwm = 100; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (router, ZMQ_SNDHWM, &hwm, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer1, ZMQ_RCVHWM, &hwm, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer2, ZMQ_RCVHWM, &hwm, sizeof (int))); const char *dealer1_routing_id = "X"; const char *dealer2_routing_id = "Y"; // Name dealer1 "X" and connect it to our router TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer1, ZMQ_ROUTING_ID, dealer1_routing_id, 1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer1, my_endpoint)); // Name dealer2 "Y" and connect it to our router TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer2, ZMQ_ROUTING_ID, dealer2_routing_id, 1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer2, my_endpoint)); // Get message from both dealers to know when connection is ready send_string_expect_success (dealer1, "Hello", 0); recv_string_expect_success (router, dealer1_routing_id, 0); recv_string_expect_success (router, "Hello", 0); send_string_expect_success (dealer2, "Hello", 0); recv_string_expect_success (router, dealer2_routing_id, 0); recv_string_expect_success (router, "Hello", 0); void *poller = zmq_poller_new (); TEST_ASSERT_NOT_NULL (poller); // Poll on router and dealer1, but not on dealer2 TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add (poller, router, NULL, ZMQ_POLLOUT)); TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add (poller, dealer1, NULL, ZMQ_POLLIN)); const unsigned int count = 10000; const unsigned int event_size = 2; bool dealer2_blocked = false; unsigned int dealer1_sent = 0, dealer2_sent = 0, dealer1_received = 0; zmq_poller_event_t events[event_size]; for (unsigned int iteration = 0; iteration < count; ++iteration) { TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_wait_all (poller, events, event_size, -1)); for (unsigned int event_no = 0; event_no < event_size; ++event_no) { const zmq_poller_event_t ¤t_event = events[event_no]; if (current_event.socket == router && current_event.events & ZMQ_POLLOUT) { if (send_msg_to_peer_if_ready (router, dealer1_routing_id)) ++dealer1_sent; if (send_msg_to_peer_if_ready (router, dealer2_routing_id)) ++dealer2_sent; else dealer2_blocked = true; } if (current_event.socket == dealer1 && current_event.events & ZMQ_POLLIN) { recv_string_expect_success (dealer1, "Hello", ZMQ_DONTWAIT); int more; size_t more_size = sizeof (more); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (dealer1, ZMQ_RCVMORE, &more, &more_size)); TEST_ASSERT_FALSE (more); ++dealer1_received; } // never read from dealer2, so its pipe becomes full eventually } } printf ("dealer1_sent = %u, dealer2_sent = %u, dealer1_received = %u\n", dealer1_sent, dealer2_sent, dealer1_received); TEST_ASSERT_TRUE (dealer2_blocked); zmq_poller_destroy (&poller); test_context_socket_close (router); test_context_socket_close (dealer1); test_context_socket_close (dealer2); #endif } void test_get_peer_state_corner_cases () { #ifdef ZMQ_BUILD_DRAFT_API const char peer_routing_id[] = "foo"; // call get_peer_state with NULL socket int rc = zmq_socket_get_peer_state (NULL, peer_routing_id, strlen (peer_routing_id)); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); void *dealer = test_context_socket (ZMQ_DEALER); void *router = test_context_socket (ZMQ_ROUTER); // call get_peer_state with a non-ROUTER socket rc = zmq_socket_get_peer_state (dealer, peer_routing_id, strlen (peer_routing_id)); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSUP, errno); // call get_peer_state for an unknown routing id rc = zmq_socket_get_peer_state (router, peer_routing_id, strlen (peer_routing_id)); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EHOSTUNREACH, errno); test_context_socket_close (router); test_context_socket_close (dealer); #endif } void test_basic () { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *router = test_context_socket (ZMQ_ROUTER); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (router, "tcp://127.0.0.1:*")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); // Send a message to an unknown peer with the default setting // This will not report any error send_string_expect_success (router, "UNKNOWN", ZMQ_SNDMORE); send_string_expect_success (router, "DATA", 0); // Send a message to an unknown peer with mandatory routing // This will fail int mandatory = 1; TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (router, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory))); int rc = zmq_send (router, "UNKNOWN", 7, ZMQ_SNDMORE); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EHOSTUNREACH, errno); // Create dealer called "X" and connect it to our router void *dealer = test_context_socket (ZMQ_DEALER); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (dealer, ZMQ_ROUTING_ID, "X", 1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer, my_endpoint)); // Get message from dealer to know when connection is ready send_string_expect_success (dealer, "Hello", 0); recv_string_expect_success (router, "X", 0); // Send a message to connected dealer now // It should work send_string_expect_success (router, "X", ZMQ_SNDMORE); send_string_expect_success (router, "Hello", 0); test_context_socket_close (router); test_context_socket_close (dealer); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_basic); RUN_TEST (test_get_peer_state); RUN_TEST (test_get_peer_state_corner_cases); return UNITY_END (); } zeromq-4.2.5/tests/test_many_sockets.cpp0000664000372000037200000000621213255253220021345 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include #include #include #include void test_system_max () { // Keep allocating sockets until we run out of system resources const int no_of_sockets = 2 * 65536; void *ctx = zmq_ctx_new (); zmq_ctx_set (ctx, ZMQ_MAX_SOCKETS, no_of_sockets); std::vector sockets; while (true) { void *socket = zmq_socket (ctx, ZMQ_PAIR); if (!socket) break; sockets.push_back (socket); } assert ((int) sockets.size () <= no_of_sockets); // System is out of resources, further calls to zmq_socket should return NULL for (unsigned int i = 0; i < 10; ++i) { void *socket = zmq_socket (ctx, ZMQ_PAIR); assert (socket == NULL); } // Clean up. for (unsigned int i = 0; i < sockets.size (); ++i) zmq_close (sockets[i]); zmq_ctx_destroy (ctx); } void test_zmq_default_max () { // Keep allocating sockets until we hit the default limit void *ctx = zmq_ctx_new (); std::vector sockets; while (true) { void *socket = zmq_socket (ctx, ZMQ_PAIR); if (!socket) break; sockets.push_back (socket); } // We may stop sooner if system has fewer available sockets assert (sockets.size () <= ZMQ_MAX_SOCKETS_DFLT); // Further calls to zmq_socket should return NULL for (unsigned int i = 0; i < 10; ++i) { void *socket = zmq_socket (ctx, ZMQ_PAIR); assert (socket == NULL); } // Clean up for (unsigned int i = 0; i < sockets.size (); ++i) zmq_close (sockets[i]); zmq_ctx_destroy (ctx); } int main (void) { setup_test_environment (); test_system_max (); test_zmq_default_max (); return 0; } zeromq-4.2.5/tests/test_proxy_single_socket.cpp0000664000372000037200000000726113255253220022745 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // This is our server task. // It runs a proxy with a single REP socket as both frontend and backend. void server_task (void *ctx) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); int rc = zmq_bind (rep, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (rep, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_REQ); assert (control); rc = zmq_connect (control, "inproc://control"); assert (rc == 0); rc = s_send (control, my_endpoint); assert (rc > 0); // Use rep as both frontend and backend rc = zmq_proxy_steerable (rep, rep, NULL, control); assert (rc == 0); rc = zmq_close (rep); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); } // The main thread simply starts several clients and a server, and then // waits for the server to finish. int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *server_thread = zmq_threadstart (&server_task, ctx); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_REP); assert (control); int rc = zmq_bind (control, "inproc://control"); assert (rc == 0); char *my_endpoint = s_recv (control); assert (my_endpoint); // client socket pings proxy over tcp void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_connect (req, my_endpoint); assert (rc == 0); char buf[255]; rc = zmq_send (req, "msg1", 4, 0); assert (rc == 4); rc = zmq_recv (req, buf, 255, 0); assert (rc == 4); assert (memcmp (buf, "msg1", 4) == 0); rc = zmq_send (req, "msg22", 5, 0); assert (rc == 5); rc = zmq_recv (req, buf, 255, 0); assert (rc == 5); assert (memcmp (buf, "msg22", 5) == 0); rc = zmq_send (control, "TERMINATE", 9, 0); assert (rc == 9); rc = zmq_close (control); assert (rc == 0); rc = zmq_close (req); assert (rc == 0); free (my_endpoint); zmq_threadclose (server_thread); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_ctx_destroy.cpp0000664000372000037200000000705413255253220021222 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { } void tearDown () { } static void receiver (void *socket) { char buffer[16]; int rc = zmq_recv (socket, &buffer, sizeof (buffer), 0); assert (rc == -1); } void test_ctx_destroy () { // Set up our context and sockets void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *socket = zmq_socket (ctx, ZMQ_PULL); TEST_ASSERT_NOT_NULL (socket); // Close the socket TEST_ASSERT_SUCCESS_ERRNO (zmq_close (socket)); // Destroy the context TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_destroy (ctx)); } void test_ctx_shutdown () { // Set up our context and sockets void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); void *socket = zmq_socket (ctx, ZMQ_PULL); TEST_ASSERT_NOT_NULL (socket); // Spawn a thread to receive on socket void *receiver_thread = zmq_threadstart (&receiver, socket); // Wait for thread to start up and block msleep (SETTLE_TIME); // Shutdown context, if we used destroy here we would deadlock. TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_shutdown (ctx)); // Wait for thread to finish zmq_threadclose (receiver_thread); // Close the socket. TEST_ASSERT_SUCCESS_ERRNO (zmq_close (socket)); // Destory the context, will now not hang as we have closed the socket. TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_destroy (ctx)); } void test_zmq_ctx_term_null_fails () { int rc = zmq_ctx_term (NULL); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EFAULT, errno); } void test_zmq_term_null_fails () { int rc = zmq_term (NULL); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EFAULT, errno); } void test_zmq_ctx_shutdown_null_fails () { int rc = zmq_ctx_shutdown (NULL); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EFAULT, errno); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_ctx_destroy); RUN_TEST (test_ctx_shutdown); RUN_TEST (test_zmq_ctx_term_null_fails); RUN_TEST (test_zmq_term_null_fails); RUN_TEST (test_zmq_ctx_shutdown_null_fails); return UNITY_END (); } zeromq-4.2.5/tests/test_socket_null.cpp0000664000372000037200000001065713255253220021200 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include void setUp () { } void tearDown () { } // tests all socket-related functions with a NULL socket argument void test_zmq_socket_null_context () { void *s = zmq_socket (NULL, ZMQ_PAIR); TEST_ASSERT_NULL (s); TEST_ASSERT_EQUAL_INT (EFAULT, errno); // TODO use EINVAL instead? } void test_zmq_close_null_socket () { int rc = zmq_close (NULL); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_setsockopt_null_socket () { int hwm = 100; size_t hwm_size = sizeof hwm; int rc = zmq_setsockopt (NULL, ZMQ_SNDHWM, &hwm, hwm_size); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_getsockopt_null_socket () { int hwm; size_t hwm_size = sizeof hwm; int rc = zmq_getsockopt (NULL, ZMQ_SNDHWM, &hwm, &hwm_size); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_socket_monitor_null_socket () { int rc = zmq_socket_monitor (NULL, "inproc://monitor", ZMQ_EVENT_ALL); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } #ifdef ZMQ_BUILD_DRAFT_API void test_zmq_join_null_socket () { int rc = zmq_join (NULL, "group"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_leave_null_socket () { int rc = zmq_leave (NULL, "group"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } #endif void test_zmq_bind_null_socket () { int rc = zmq_bind (NULL, "inproc://socket"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_connect_null_socket () { int rc = zmq_connect (NULL, "inproc://socket"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_unbind_null_socket () { int rc = zmq_unbind (NULL, "inproc://socket"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } void test_zmq_disconnect_null_socket () { int rc = zmq_disconnect (NULL, "inproc://socket"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (ENOTSOCK, errno); // TODO use EINVAL instead? } int main (void) { UNITY_BEGIN (); RUN_TEST (test_zmq_socket_null_context); RUN_TEST (test_zmq_close_null_socket); RUN_TEST (test_zmq_setsockopt_null_socket); RUN_TEST (test_zmq_getsockopt_null_socket); RUN_TEST (test_zmq_socket_monitor_null_socket); RUN_TEST (test_zmq_bind_null_socket); RUN_TEST (test_zmq_connect_null_socket); RUN_TEST (test_zmq_unbind_null_socket); RUN_TEST (test_zmq_disconnect_null_socket); #ifdef ZMQ_BUILD_DRAFT_API RUN_TEST (test_zmq_join_null_socket); RUN_TEST (test_zmq_leave_null_socket); #endif return UNITY_END (); } zeromq-4.2.5/tests/test_security_zap.cpp0000664000372000037200000003675713255253220021410 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil_security.hpp" static void zap_handler_wrong_version (void *ctx) { zap_handler_generic (ctx, zap_wrong_version); } static void zap_handler_wrong_request_id (void *ctx) { zap_handler_generic (ctx, zap_wrong_request_id); } static void zap_handler_wrong_status_invalid (void *ctx) { zap_handler_generic (ctx, zap_status_invalid); } static void zap_handler_wrong_status_temporary_failure (void *ctx) { zap_handler_generic (ctx, zap_status_temporary_failure); } static void zap_handler_wrong_status_internal_error (void *ctx) { zap_handler_generic (ctx, zap_status_internal_error); } static void zap_handler_too_many_parts (void *ctx) { zap_handler_generic (ctx, zap_too_many_parts); } static void zap_handler_disconnect (void *ctx) { zap_handler_generic (ctx, zap_disconnect); } static void zap_handler_do_not_recv (void *ctx) { zap_handler_generic (ctx, zap_do_not_recv); } static void zap_handler_do_not_send (void *ctx) { zap_handler_generic (ctx, zap_do_not_send); } int expect_new_client_bounce_fail_and_count_monitor_events ( void *ctx, char *my_endpoint, void *server, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon, void *server_mon, int expected_server_event, int expected_server_value, int expected_client_event = 0, int expected_client_value = 0) { expect_new_client_bounce_fail ( ctx, my_endpoint, server, socket_config_, socket_config_data_, client_mon, expected_client_event, expected_client_value); int events_received = 0; #ifdef ZMQ_BUILD_DRAFT_API events_received = expect_monitor_event_multiple ( server_mon, expected_server_event, expected_server_value); #endif return events_received; } void test_zap_unsuccessful (void *ctx, char *my_endpoint, void *server, void *server_mon, int expected_server_event, int expected_server_value, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon = NULL, int expected_client_event = 0, int expected_client_value = 0) { int server_events_received = expect_new_client_bounce_fail_and_count_monitor_events ( ctx, my_endpoint, server, socket_config_, socket_config_data_, client_mon, server_mon, expected_server_event, expected_server_value, expected_client_event, expected_client_value); // there may be more than one ZAP request due to repeated attempts by the // client (actually only in case if ZAP status code 300) assert (server_events_received == 0 || 1 <= zmq_atomic_counter_value (zap_requests_handled)); } void test_zap_unsuccessful_no_handler (void *ctx, char *my_endpoint, void *server, void *server_mon, int expected_event, int expected_err, socket_config_fn socket_config_, void *socket_config_data_, void **client_mon = NULL) { int events_received = expect_new_client_bounce_fail_and_count_monitor_events ( ctx, my_endpoint, server, socket_config_, socket_config_data_, client_mon, server_mon, expected_event, expected_err); #ifdef ZMQ_BUILD_DRAFT_API // there may be more than one ZAP request due to repeated attempts by the // client assert (events_received > 0); #else LIBZMQ_UNUSED (events_received); #endif } void test_zap_protocol_error (void *ctx, char *my_endpoint, void *server, void *server_mon, socket_config_fn socket_config_, void *socket_config_data_, int expected_error) { test_zap_unsuccessful (ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL, expected_error, #else 0, 0, #endif socket_config_, socket_config_data_); } void test_zap_unsuccessful_status_300 (void *ctx, char *my_endpoint, void *server, void *server_mon, socket_config_fn client_socket_config_, void *client_socket_config_data_) { void *client_mon; test_zap_unsuccessful (ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, 300, #else 0, 0, #endif client_socket_config_, client_socket_config_data_, &client_mon); #ifdef ZMQ_BUILD_DRAFT_API // we can use a 0 timeout here, since the client socket is already closed assert_no_more_monitor_events_with_timeout (client_mon, 0); int rc = zmq_close (client_mon); assert (rc == 0); #endif } void test_zap_unsuccessful_status_500 (void *ctx, char *my_endpoint, void *server, void *server_mon, socket_config_fn client_socket_config_, void *client_socket_config_data_) { test_zap_unsuccessful (ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, 500, #else 0, 0, #endif client_socket_config_, client_socket_config_data_, NULL, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_AUTH, 500 #else 0, 0 #endif ); } void test_zap_errors (socket_config_fn server_socket_config_, void *server_socket_config_data_, socket_config_fn client_socket_config_, void *client_socket_config_data_) { void *ctx; void *handler; void *zap_thread; void *server; void *server_mon; char my_endpoint[MAX_SOCKET_STRING]; // Invalid ZAP protocol tests // wrong version fprintf (stderr, "test_zap_protocol_error wrong_version\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_wrong_version, server_socket_config_, server_socket_config_data_); test_zap_protocol_error (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION #else 0 #endif ); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // wrong request id fprintf (stderr, "test_zap_protocol_error wrong_request_id\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_wrong_request_id, server_socket_config_, server_socket_config_data_); test_zap_protocol_error (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID #else 0 #endif ); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // status invalid (not a 3-digit number) fprintf (stderr, "test_zap_protocol_error wrong_status_invalid\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_wrong_status_invalid, server_socket_config_, server_socket_config_data_); test_zap_protocol_error (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE #else 0 #endif ); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // too many parts fprintf (stderr, "test_zap_protocol_error too_many_parts\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_too_many_parts, server_socket_config_, server_socket_config_data_); test_zap_protocol_error (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY #else 0 #endif ); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // ZAP non-standard cases // TODO make these observable on the client side as well (they are // transmitted as an ERROR message) // status 300 temporary failure fprintf (stderr, "test_zap_unsuccessful status 300\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_wrong_status_temporary_failure, server_socket_config_, server_socket_config_data_); test_zap_unsuccessful_status_300 (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // status 500 internal error fprintf (stderr, "test_zap_unsuccessful status 500\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_wrong_status_internal_error, server_socket_config_); test_zap_unsuccessful_status_500 (ctx, my_endpoint, server, server_mon, client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); #ifdef ZMQ_ZAP_ENFORCE_DOMAIN // no ZAP handler int enforce = 1; fprintf (stderr, "test_zap_unsuccessful no ZAP handler started\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, NULL, server_socket_config_, server_socket_config_data_ ? server_socket_config_data_ : &enforce); test_zap_unsuccessful_no_handler ( ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL, EFAULT, #else 0, 0, #endif client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); #endif // ZAP handler disconnecting on first message fprintf (stderr, "test_zap_unsuccessful ZAP handler disconnects\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_disconnect, server_socket_config_); test_zap_unsuccessful_no_handler ( ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL, EPIPE, #else 0, 0, #endif client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler, true); // ZAP handler does not read request fprintf (stderr, "test_zap_unsuccessful ZAP handler does not read request\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_do_not_recv, server_socket_config_); test_zap_unsuccessful_no_handler ( ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL, EPIPE, #else 0, 0, #endif client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); // ZAP handler does not send reply fprintf (stderr, "test_zap_unsuccessful ZAP handler does not write reply\n"); setup_context_and_server_side ( &ctx, &handler, &zap_thread, &server, &server_mon, my_endpoint, &zap_handler_do_not_send, server_socket_config_); test_zap_unsuccessful_no_handler ( ctx, my_endpoint, server, server_mon, #ifdef ZMQ_BUILD_DRAFT_API ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL, EPIPE, #else 0, 0, #endif client_socket_config_, client_socket_config_data_); shutdown_context_and_server_side (ctx, zap_thread, server, server_mon, handler); } int main (void) { setup_test_environment (); fprintf (stderr, "NULL mechanism\n"); test_zap_errors (&socket_config_null_server, NULL, &socket_config_null_client, NULL); fprintf (stderr, "PLAIN mechanism\n"); test_zap_errors (&socket_config_plain_server, NULL, &socket_config_plain_client, NULL); if (zmq_has ("curve")) { fprintf (stderr, "CURVE mechanism\n"); setup_testutil_security_curve (); curve_client_data_t curve_client_data = { valid_server_public, valid_client_public, valid_client_secret}; test_zap_errors (&socket_config_curve_server, valid_server_secret, &socket_config_curve_client, &curve_client_data); } } zeromq-4.2.5/tests/test_diffserv.cpp0000664000372000037200000000535313255253220020463 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { int rc; int tos = 0x28; int o_tos; size_t tos_size = sizeof (tos); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); rc = zmq_setsockopt (sb, ZMQ_TOS, &tos, tos_size); assert (rc == 0); rc = zmq_bind (sb, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_getsockopt (sb, ZMQ_TOS, &o_tos, &tos_size); assert (rc == 0); assert (o_tos == tos); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); tos = 0x58; rc = zmq_setsockopt (sc, ZMQ_TOS, &tos, tos_size); assert (rc == 0); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); rc = zmq_getsockopt (sc, ZMQ_TOS, &o_tos, &tos_size); assert (rc == 0); assert (o_tos == tos); // Wireshark can be used to verify that the server socket is // using DSCP 0x28 in packets to the client while the client // is using 0x58 in packets to the server. bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_proxy.cpp0000664000372000037200000004311713255253220020034 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // Asynchronous client-to-server (DEALER to ROUTER) - pure libzmq // // While this example runs in a single process, that is to make // it easier to start and stop the example. Each task may have its own // context and conceptually acts as a separate process. To have this // behaviour, it is necessary to replace the inproc transport of the // control socket by a tcp transport. // This is our client task // It connects to the server, and then sends a request once per second // It collects responses as they arrive, and it prints them out. We will // run several client tasks in parallel, each with a different random ID. #define CONTENT_SIZE 13 #define CONTENT_SIZE_MAX 32 #define ROUTING_ID_SIZE 10 #define ROUTING_ID_SIZE_MAX 32 #define QT_WORKERS 5 #define QT_CLIENTS 3 #define is_verbose 0 struct thread_data { void *ctx; int id; }; typedef struct { uint64_t msg_in; uint64_t bytes_in; uint64_t msg_out; uint64_t bytes_out; } zmq_socket_stats_t; typedef struct { zmq_socket_stats_t frontend; zmq_socket_stats_t backend; } zmq_proxy_stats_t; void *g_clients_pkts_out = NULL; void *g_workers_pkts_out = NULL; static void client_task (void *db) { struct thread_data *databag = (struct thread_data *) db; // Endpoint socket gets random port to avoid test failing when port in use void *endpoint = zmq_socket (databag->ctx, ZMQ_PAIR); assert (endpoint); int linger = 0; int rc = zmq_setsockopt (endpoint, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); char endpoint_source[256]; sprintf (endpoint_source, "inproc://endpoint%d", databag->id); rc = zmq_connect (endpoint, endpoint_source); assert (rc == 0); char *my_endpoint = s_recv (endpoint); assert (my_endpoint); void *client = zmq_socket (databag->ctx, ZMQ_DEALER); assert (client); // Control socket receives terminate command from main over inproc void *control = zmq_socket (databag->ctx, ZMQ_SUB); assert (control); rc = zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); rc = zmq_setsockopt (control, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_connect (control, "inproc://control"); assert (rc == 0); char content[CONTENT_SIZE_MAX]; // Set random routing id to make tracing easier char routing_id[ROUTING_ID_SIZE]; sprintf (routing_id, "%04X-%04X", rand () % 0xFFFF, rand () % 0xFFFF); rc = zmq_setsockopt (client, ZMQ_ROUTING_ID, routing_id, ROUTING_ID_SIZE); // includes '\0' as an helper for printf assert (rc == 0); linger = 0; rc = zmq_setsockopt (client, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); zmq_pollitem_t items[] = {{client, 0, ZMQ_POLLIN, 0}, {control, 0, ZMQ_POLLIN, 0}}; int request_nbr = 0; bool run = true; bool keep_sending = true; while (run) { // Tick once per 200 ms, pulling in arriving messages int centitick; for (centitick = 0; centitick < 20; centitick++) { zmq_poll (items, 2, 10); if (items[0].revents & ZMQ_POLLIN) { int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_recv (client, content, CONTENT_SIZE_MAX, 0); assert (rc == CONTENT_SIZE); if (is_verbose) printf ( "client receive - routing_id = %s content = %s\n", routing_id, content); // Check that message is still the same assert (memcmp (content, "request #", 9) == 0); rc = zmq_getsockopt (client, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); } if (items[1].revents & ZMQ_POLLIN) { rc = zmq_recv (control, content, CONTENT_SIZE_MAX, 0); if (rc > 0) { content[rc] = 0; // NULL-terminate the command string if (is_verbose) printf ( "client receive - routing_id = %s command = %s\n", routing_id, content); if (memcmp (content, "TERMINATE", 9) == 0) { run = false; break; } if (memcmp (content, "STOP", 4) == 0) { keep_sending = false; break; } } } } if (keep_sending) { sprintf (content, "request #%03d", ++request_nbr); // CONTENT_SIZE if (is_verbose) printf ("client send - routing_id = %s request #%03d\n", routing_id, request_nbr); zmq_atomic_counter_inc (g_clients_pkts_out); rc = zmq_send (client, content, CONTENT_SIZE, 0); assert (rc == CONTENT_SIZE); } } rc = zmq_close (client); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); rc = zmq_close (endpoint); assert (rc == 0); free (my_endpoint); } // This is our server task. // It uses the multithreaded server model to deal requests out to a pool // of workers and route replies back to clients. One worker can handle // one request at a time but one client can talk to multiple workers at // once. static void server_worker (void *ctx); void server_task (void *ctx) { // Frontend socket talks to clients over TCP size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *frontend = zmq_socket (ctx, ZMQ_ROUTER); assert (frontend); int linger = 0; int rc = zmq_setsockopt (frontend, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_bind (frontend, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (frontend, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Backend socket talks to workers over inproc void *backend = zmq_socket (ctx, ZMQ_DEALER); assert (backend); rc = zmq_setsockopt (backend, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_bind (backend, "inproc://backend"); assert (rc == 0); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_REP); assert (control); rc = zmq_setsockopt (control, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_connect (control, "inproc://control_proxy"); assert (rc == 0); // Launch pool of worker threads, precise number is not critical int thread_nbr; void *threads[5]; for (thread_nbr = 0; thread_nbr < QT_WORKERS; thread_nbr++) threads[thread_nbr] = zmq_threadstart (&server_worker, ctx); // Endpoint socket sends random port to avoid test failing when port in use void *endpoint_receivers[QT_CLIENTS]; char endpoint_source[256]; for (int i = 0; i < QT_CLIENTS; ++i) { endpoint_receivers[i] = zmq_socket (ctx, ZMQ_PAIR); assert (endpoint_receivers[i]); rc = zmq_setsockopt (endpoint_receivers[i], ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); sprintf (endpoint_source, "inproc://endpoint%d", i); rc = zmq_bind (endpoint_receivers[i], endpoint_source); assert (rc == 0); } for (int i = 0; i < QT_CLIENTS; ++i) { rc = s_send (endpoint_receivers[i], my_endpoint); assert (rc > 0); } // Connect backend to frontend via a proxy rc = zmq_proxy_steerable (frontend, backend, NULL, control); assert (rc == 0); for (thread_nbr = 0; thread_nbr < QT_WORKERS; thread_nbr++) zmq_threadclose (threads[thread_nbr]); rc = zmq_close (frontend); assert (rc == 0); rc = zmq_close (backend); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); for (int i = 0; i < QT_CLIENTS; ++i) { rc = zmq_close (endpoint_receivers[i]); assert (rc == 0); } } // Each worker task works on one request at a time and sends a random number // of replies back, with random delays between replies: // The comments in the first column, if suppressed, makes it a poller version static void server_worker (void *ctx) { void *worker = zmq_socket (ctx, ZMQ_DEALER); assert (worker); int linger = 0; int rc = zmq_setsockopt (worker, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_connect (worker, "inproc://backend"); assert (rc == 0); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_SUB); assert (control); rc = zmq_setsockopt (control, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); rc = zmq_setsockopt (control, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_connect (control, "inproc://control"); assert (rc == 0); char content[CONTENT_SIZE_MAX]; // bigger than what we need to check that char routing_id[ROUTING_ID_SIZE_MAX]; // the size received is the size sent bool run = true; bool keep_sending = true; while (run) { rc = zmq_recv (control, content, CONTENT_SIZE_MAX, ZMQ_DONTWAIT); // usually, rc == -1 (no message) if (rc > 0) { content[rc] = 0; // NULL-terminate the command string if (is_verbose) printf ("server_worker receives command = %s\n", content); if (memcmp (content, "TERMINATE", 9) == 0) run = false; if (memcmp (content, "STOP", 4) == 0) keep_sending = false; } // The DEALER socket gives us the reply envelope and message // if we don't poll, we have to use ZMQ_DONTWAIT, if we poll, we can block-receive with 0 rc = zmq_recv (worker, routing_id, ROUTING_ID_SIZE_MAX, ZMQ_DONTWAIT); if (rc == ROUTING_ID_SIZE) { rc = zmq_recv (worker, content, CONTENT_SIZE_MAX, 0); assert (rc == CONTENT_SIZE); if (is_verbose) printf ("server receive - routing_id = %s content = %s\n", routing_id, content); // Send 0..4 replies back if (keep_sending) { int reply, replies = rand () % 5; for (reply = 0; reply < replies; reply++) { // Sleep for some fraction of a second msleep (rand () % 10 + 1); // Send message from server to client if (is_verbose) printf ("server send - routing_id = %s reply\n", routing_id); zmq_atomic_counter_inc (g_workers_pkts_out); rc = zmq_send (worker, routing_id, ROUTING_ID_SIZE, ZMQ_SNDMORE); assert (rc == ROUTING_ID_SIZE); rc = zmq_send (worker, content, CONTENT_SIZE, 0); assert (rc == CONTENT_SIZE); } } } } rc = zmq_close (worker); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); } uint64_t recv_stat (void *sock, bool last) { uint64_t res; zmq_msg_t stats_msg; int rc = zmq_msg_init (&stats_msg); assert (rc == 0); rc = zmq_recvmsg (sock, &stats_msg, 0); assert (rc == sizeof (uint64_t)); memcpy (&res, zmq_msg_data (&stats_msg), zmq_msg_size (&stats_msg)); rc = zmq_msg_close (&stats_msg); assert (rc == 0); int more; size_t moresz = sizeof more; rc = zmq_getsockopt (sock, ZMQ_RCVMORE, &more, &moresz); assert (rc == 0); assert ((last && !more) || (!last && more)); return res; } // Utility function to interrogate the proxy: void check_proxy_stats (void *control_proxy) { zmq_proxy_stats_t total_stats; int rc; rc = zmq_send (control_proxy, "STATISTICS", 10, 0); assert (rc == 10); // first frame of the reply contains FRONTEND stats: total_stats.frontend.msg_in = recv_stat (control_proxy, false); total_stats.frontend.bytes_in = recv_stat (control_proxy, false); total_stats.frontend.msg_out = recv_stat (control_proxy, false); total_stats.frontend.bytes_out = recv_stat (control_proxy, false); // second frame of the reply contains BACKEND stats: total_stats.backend.msg_in = recv_stat (control_proxy, false); total_stats.backend.bytes_in = recv_stat (control_proxy, false); total_stats.backend.msg_out = recv_stat (control_proxy, false); total_stats.backend.bytes_out = recv_stat (control_proxy, true); // check stats if (is_verbose) { printf ( "frontend: pkts_in=%lu bytes_in=%lu pkts_out=%lu bytes_out=%lu\n", (unsigned long int) total_stats.frontend.msg_in, (unsigned long int) total_stats.frontend.bytes_in, (unsigned long int) total_stats.frontend.msg_out, (unsigned long int) total_stats.frontend.bytes_out); printf ( "backend: pkts_in=%lu bytes_in=%lu pkts_out=%lu bytes_out=%lu\n", (unsigned long int) total_stats.backend.msg_in, (unsigned long int) total_stats.backend.bytes_in, (unsigned long int) total_stats.backend.msg_out, (unsigned long int) total_stats.backend.bytes_out); printf ("clients sent out %d requests\n", zmq_atomic_counter_value (g_clients_pkts_out)); printf ("workers sent out %d replies\n", zmq_atomic_counter_value (g_workers_pkts_out)); } assert (total_stats.frontend.msg_in == (unsigned) zmq_atomic_counter_value (g_clients_pkts_out)); assert (total_stats.frontend.msg_out == (unsigned) zmq_atomic_counter_value (g_workers_pkts_out)); assert (total_stats.backend.msg_in == (unsigned) zmq_atomic_counter_value (g_workers_pkts_out)); assert (total_stats.backend.msg_out == (unsigned) zmq_atomic_counter_value (g_clients_pkts_out)); } // The main thread simply starts several clients and a server, and then // waits for the server to finish. int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); g_clients_pkts_out = zmq_atomic_counter_new (); g_workers_pkts_out = zmq_atomic_counter_new (); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_PUB); assert (control); int linger = 0; int rc = zmq_setsockopt (control, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_bind (control, "inproc://control"); assert (rc == 0); // Control socket receives terminate command from main over inproc void *control_proxy = zmq_socket (ctx, ZMQ_REQ); assert (control_proxy); rc = zmq_setsockopt (control_proxy, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0); rc = zmq_bind (control_proxy, "inproc://control_proxy"); assert (rc == 0); void *threads[QT_CLIENTS + 1]; struct thread_data databags[QT_CLIENTS + 1]; for (int i = 0; i < QT_CLIENTS; i++) { databags[i].ctx = ctx; databags[i].id = i; threads[i] = zmq_threadstart (&client_task, &databags[i]); } threads[QT_CLIENTS] = zmq_threadstart (&server_task, ctx); msleep (500); // Run for 500 ms then quit if (is_verbose) printf ("stopping all clients and server workers\n"); rc = zmq_send (control, "STOP", 4, 0); assert (rc == 4); msleep (500); // Wait for all clients and workers to STOP #ifdef ZMQ_BUILD_DRAFT_API if (is_verbose) printf ("retrieving stats from the proxy\n"); check_proxy_stats (control_proxy); #endif if (is_verbose) printf ("shutting down all clients and server workers\n"); rc = zmq_send (control, "TERMINATE", 9, 0); assert (rc == 9); if (is_verbose) printf ("shutting down the proxy\n"); rc = zmq_send (control_proxy, "TERMINATE", 9, 0); assert (rc == 9); rc = zmq_close (control); assert (rc == 0); rc = zmq_close (control_proxy); assert (rc == 0); for (int i = 0; i < QT_CLIENTS + 1; i++) zmq_threadclose (threads[i]); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/testutil.hpp0000664000372000037200000003062113255253220017472 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __TESTUTIL_HPP_INCLUDED__ #define __TESTUTIL_HPP_INCLUDED__ #if defined ZMQ_CUSTOM_PLATFORM_HPP #include "platform.hpp" #else #include "../src/platform.hpp" #endif #include "../include/zmq.h" #include "../src/stdint.hpp" // This defines the settle time used in tests; raise this if we // get test failures on slower systems due to binds/connects not // settled. Tested to work reliably at 1 msec on a fast PC. #define SETTLE_TIME 300 // In msec // Commonly used buffer size for ZMQ_LAST_ENDPOINT #define MAX_SOCKET_STRING sizeof ("tcp://[::ffff:127.127.127.127]:65536") // We need to test codepaths with non-random bind ports. List them here to // keep them unique, to allow parallel test runs. #define ENDPOINT_0 "tcp://127.0.0.1:5555" #define ENDPOINT_1 "tcp://127.0.0.1:5556" #define ENDPOINT_2 "tcp://127.0.0.1:5557" #define ENDPOINT_3 "tcp://127.0.0.1:5558" #define ENDPOINT_4 "udp://127.0.0.1:5559" #define ENDPOINT_5 "udp://127.0.0.1:5560" #undef NDEBUG #include #include #include #include #include #if defined _WIN32 #include "../src/windows.hpp" #if defined _MSC_VER #include #pragma warning(disable : 4996) // iphlpapi is needed for if_nametoindex (not on Windows XP) #if !defined ZMQ_HAVE_WINDOWS_TARGET_XP #pragma comment(lib, "iphlpapi") #endif #endif #else #include #include #include #include #include #include #include #include #if defined(ZMQ_HAVE_AIX) #include #include #endif #endif #define LIBZMQ_UNUSED(object) (void) object // Bounce a message from client to server and back // For REQ/REP or DEALER/DEALER pairs only void bounce (void *server, void *client) { const char *content = "12345678ABCDEFGH12345678abcdefgh"; // Send message from client to server int rc = zmq_send (client, content, 32, ZMQ_SNDMORE); assert (rc == 32); rc = zmq_send (client, content, 32, 0); assert (rc == 32); // Receive message at server side char buffer[32]; rc = zmq_recv (server, buffer, 32, 0); assert (rc == 32); // Check that message is still the same assert (memcmp (buffer, content, 32) == 0); int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (server, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (server, buffer, 32, 0); assert (rc == 32); // Check that message is still the same assert (memcmp (buffer, content, 32) == 0); rc = zmq_getsockopt (server, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); // Send two parts back to client rc = zmq_send (server, buffer, 32, ZMQ_SNDMORE); assert (rc == 32); rc = zmq_send (server, buffer, 32, 0); assert (rc == 32); // Receive the two parts at the client side rc = zmq_recv (client, buffer, 32, 0); assert (rc == 32); // Check that message is still the same assert (memcmp (buffer, content, 32) == 0); rc = zmq_getsockopt (client, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (client, buffer, 32, 0); assert (rc == 32); // Check that message is still the same assert (memcmp (buffer, content, 32) == 0); rc = zmq_getsockopt (client, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); } // Same as bounce, but expect messages to never arrive // for security or subscriber reasons. void expect_bounce_fail (void *server, void *client) { const char *content = "12345678ABCDEFGH12345678abcdefgh"; char buffer[32]; int timeout = 250; // Send message from client to server int rc = zmq_setsockopt (client, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_send (client, content, 32, ZMQ_SNDMORE); assert ((rc == 32) || ((rc == -1) && (errno == EAGAIN))); rc = zmq_send (client, content, 32, 0); assert ((rc == 32) || ((rc == -1) && (errno == EAGAIN))); // Receive message at server side (should not succeed) rc = zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_recv (server, buffer, 32, 0); assert (rc == -1); assert (zmq_errno () == EAGAIN); // Send message from server to client to test other direction // If connection failed, send may block, without a timeout rc = zmq_setsockopt (server, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_send (server, content, 32, ZMQ_SNDMORE); assert (rc == 32 || (rc == -1 && zmq_errno () == EAGAIN)); rc = zmq_send (server, content, 32, 0); assert (rc == 32 || (rc == -1 && zmq_errno () == EAGAIN)); // Receive message at client side (should not succeed) rc = zmq_setsockopt (client, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_recv (client, buffer, 32, 0); assert (rc == -1); assert (zmq_errno () == EAGAIN); } // Receive 0MQ string from socket and convert into C string // Caller must free returned string. Returns NULL if the context // is being terminated. char *s_recv (void *socket) { char buffer[256]; int size = zmq_recv (socket, buffer, 255, 0); if (size == -1) return NULL; if (size > 255) size = 255; buffer[size] = 0; return strdup (buffer); } // Convert C string to 0MQ string and send to socket int s_send (void *socket, const char *string) { int size = zmq_send (socket, string, strlen (string), 0); return size; } // Sends string as 0MQ string, as multipart non-terminal int s_sendmore (void *socket, const char *string) { int size = zmq_send (socket, string, strlen (string), ZMQ_SNDMORE); return size; } #define streq(s1, s2) (!strcmp ((s1), (s2))) #define strneq(s1, s2) (strcmp ((s1), (s2))) const char *SEQ_END = (const char *) 1; // Sends a message composed of frames that are C strings or null frames. // The list must be terminated by SEQ_END. // Example: s_send_seq (req, "ABC", 0, "DEF", SEQ_END); void s_send_seq (void *socket, ...) { va_list ap; va_start (ap, socket); const char *data = va_arg (ap, const char *); while (true) { const char *prev = data; data = va_arg (ap, const char *); bool end = data == SEQ_END; if (!prev) { int rc = zmq_send (socket, 0, 0, end ? 0 : ZMQ_SNDMORE); assert (rc != -1); } else { int rc = zmq_send (socket, prev, strlen (prev) + 1, end ? 0 : ZMQ_SNDMORE); assert (rc != -1); } if (end) break; } va_end (ap); } // Receives message a number of frames long and checks that the frames have // the given data which can be either C strings or 0 for a null frame. // The list must be terminated by SEQ_END. // Example: s_recv_seq (rep, "ABC", 0, "DEF", SEQ_END); void s_recv_seq (void *socket, ...) { zmq_msg_t msg; zmq_msg_init (&msg); int more; size_t more_size = sizeof (more); va_list ap; va_start (ap, socket); const char *data = va_arg (ap, const char *); while (true) { int rc = zmq_msg_recv (&msg, socket, 0); assert (rc != -1); if (!data) assert (zmq_msg_size (&msg) == 0); else assert (strcmp (data, (const char *) zmq_msg_data (&msg)) == 0); data = va_arg (ap, const char *); bool end = data == SEQ_END; rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); assert (!more == end); if (end) break; } va_end (ap); zmq_msg_close (&msg); } // Sets a zero linger period on a socket and closes it. void close_zero_linger (void *socket) { int linger = 0; int rc = zmq_setsockopt (socket, ZMQ_LINGER, &linger, sizeof (linger)); assert (rc == 0 || errno == ETERM); rc = zmq_close (socket); assert (rc == 0); } void setup_test_environment (void) { #if defined _WIN32 #if defined _MSC_VER _set_abort_behavior (0, _WRITE_ABORT_MSG); _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_FILE); _CrtSetReportFile (_CRT_ASSERT, _CRTDBG_FILE_STDERR); #endif #else #if defined ZMQ_HAVE_CYGWIN // abort test after 121 seconds alarm (121); #else #if !defined ZMQ_DISABLE_TEST_TIMEOUT // abort test after 60 seconds alarm (60); #endif #endif #endif #if defined __MVS__ // z/OS UNIX System Services: Ignore SIGPIPE during test runs, as a // workaround for no SO_NOGSIGPIPE socket option. signal (SIGPIPE, SIG_IGN); #endif } // Provide portable millisecond sleep // http://www.cplusplus.com/forum/unices/60161/ // http://en.cppreference.com/w/cpp/thread/sleep_for void msleep (int milliseconds) { #ifdef ZMQ_HAVE_WINDOWS Sleep (milliseconds); #else usleep (static_cast (milliseconds) * 1000); #endif } // check if IPv6 is available (0/false if not, 1/true if it is) // only way to reliably check is to actually open a socket and try to bind it int is_ipv6_available (void) { #if defined(ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600) return 0; #else int rc, ipv6 = 1; struct sockaddr_in6 test_addr; memset (&test_addr, 0, sizeof (test_addr)); test_addr.sin6_family = AF_INET6; inet_pton (AF_INET6, "::1", &(test_addr.sin6_addr)); #ifdef ZMQ_HAVE_WINDOWS SOCKET fd = socket (AF_INET6, SOCK_STREAM, IPPROTO_IP); if (fd == INVALID_SOCKET) ipv6 = 0; else { setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (const char *) &ipv6, sizeof (int)); rc = setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, (const char *) &ipv6, sizeof (int)); if (rc == SOCKET_ERROR) ipv6 = 0; else { rc = bind (fd, (struct sockaddr *) &test_addr, sizeof (test_addr)); if (rc == SOCKET_ERROR) ipv6 = 0; } closesocket (fd); } #else int fd = socket (AF_INET6, SOCK_STREAM, IPPROTO_IP); if (fd == -1) ipv6 = 0; else { setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, &ipv6, sizeof (int)); rc = setsockopt (fd, IPPROTO_IPV6, IPV6_V6ONLY, &ipv6, sizeof (int)); if (rc != 0) ipv6 = 0; else { rc = bind (fd, (struct sockaddr *) &test_addr, sizeof (test_addr)); if (rc != 0) ipv6 = 0; } close (fd); } #endif return ipv6; #endif // _WIN32_WINNT < 0x0600 } // check if tipc is available (0/false if not, 1/true if it is) // only way to reliably check is to actually open a socket and try to bind it // as it depends on a non-default kernel module to be already loaded int is_tipc_available (void) { #ifndef ZMQ_HAVE_TIPC return 0; #else int tipc = 0; void *ctx = zmq_init (1); assert (ctx); void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); tipc = zmq_bind (rep, "tipc://{5560,0,0}"); zmq_close (rep); zmq_ctx_term (ctx); return tipc == 0; #endif // ZMQ_HAVE_TIPC } #if defined(ZMQ_HAVE_WINDOWS) int close (int fd) { return closesocket (fd); } #endif #endif zeromq-4.2.5/tests/test_bind_src_address.cpp0000664000372000037200000000407113255253220022137 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_x () { void *sock = test_context_socket (ZMQ_PUB); TEST_ASSERT_SUCCESS_ERRNO ( zmq_connect (sock, "tcp://127.0.0.1:0;localhost:1234")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_connect (sock, "tcp://localhost:5555;localhost:1235")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_connect (sock, "tcp://lo:5555;localhost:1235")); test_context_socket_close (sock); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_x); return UNITY_END (); } zeromq-4.2.5/tests/test_reqrep_device.cpp0000664000372000037200000001154513255253220021470 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char endpoint1[MAX_SOCKET_STRING]; char endpoint2[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // Create a req/rep device. void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); int rc = zmq_bind (dealer, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (dealer, ZMQ_LAST_ENDPOINT, endpoint1, &len); assert (rc == 0); void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); rc = zmq_bind (router, "tcp://127.0.0.1:*"); assert (rc == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, endpoint2, &len); assert (rc == 0); // Create a worker. void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); rc = zmq_connect (rep, endpoint1); assert (rc == 0); // Create a client. void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_connect (req, endpoint2); assert (rc == 0); // Send a request. rc = zmq_send (req, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (req, "DEF", 3, 0); assert (rc == 3); // Pass the request through the device. for (int i = 0; i != 4; i++) { zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, router, 0); assert (rc >= 0); int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (router, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); rc = zmq_msg_send (&msg, dealer, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } // Receive the request. char buff[3]; rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "ABC", 3) == 0); int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "DEF", 3) == 0); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); // Send the reply. rc = zmq_send (rep, "GHI", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (rep, "JKL", 3, 0); assert (rc == 3); // Pass the reply through the device. for (int i = 0; i != 4; i++) { zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, dealer, 0); assert (rc >= 0); int rcvmore; rc = zmq_getsockopt (dealer, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); rc = zmq_msg_send (&msg, router, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } // Receive the reply. rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "GHI", 3) == 0); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "JKL", 3) == 0); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); // Clean up. rc = zmq_close (req); assert (rc == 0); rc = zmq_close (rep); assert (rc == 0); rc = zmq_close (router); assert (rc == 0); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_spec_router.cpp0000664000372000037200000001434313255253220021204 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *bind_address = 0; char connect_address[MAX_SOCKET_STRING]; void test_fair_queue_in (void *ctx) { void *receiver = zmq_socket (ctx, ZMQ_ROUTER); assert (receiver); int timeout = 250; int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_bind (receiver, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (receiver, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *senders[services]; for (size_t peer = 0; peer < services; ++peer) { senders[peer] = zmq_socket (ctx, ZMQ_DEALER); assert (senders[peer]); rc = zmq_setsockopt (senders[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); char *str = strdup ("A"); str[0] += peer; rc = zmq_setsockopt (senders[peer], ZMQ_ROUTING_ID, str, 2); assert (rc == 0); free (str); rc = zmq_connect (senders[peer], connect_address); assert (rc == 0); } msleep (SETTLE_TIME); zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); s_send_seq (senders[0], "M", SEQ_END); s_recv_seq (receiver, "A", "M", SEQ_END); s_send_seq (senders[0], "M", SEQ_END); s_recv_seq (receiver, "A", "M", SEQ_END); int sum = 0; // send N requests for (size_t peer = 0; peer < services; ++peer) { s_send_seq (senders[peer], "M", SEQ_END); sum += 'A' + peer; } assert (sum == services * 'A' + services * (services - 1) / 2); // handle N requests for (size_t peer = 0; peer < services; ++peer) { rc = zmq_msg_recv (&msg, receiver, 0); assert (rc == 2); const char *id = (const char *) zmq_msg_data (&msg); sum -= id[0]; s_recv_seq (receiver, "M", SEQ_END); } assert (sum == 0); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (receiver); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (senders[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_destroy_queue_on_disconnect (void *ctx) { void *A = zmq_socket (ctx, ZMQ_ROUTER); assert (A); int enabled = 1; int rc = zmq_setsockopt (A, ZMQ_ROUTER_MANDATORY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_bind (A, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (A, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); void *B = zmq_socket (ctx, ZMQ_DEALER); assert (B); rc = zmq_setsockopt (B, ZMQ_ROUTING_ID, "B", 2); assert (rc == 0); rc = zmq_connect (B, connect_address); assert (rc == 0); // Wait for connection. msleep (SETTLE_TIME); // Send a message in both directions s_send_seq (A, "B", "ABC", SEQ_END); s_send_seq (B, "DEF", SEQ_END); rc = zmq_disconnect (B, connect_address); assert (rc == 0); // Disconnect may take time and need command processing. zmq_pollitem_t poller[2] = {{A, 0, 0, 0}, {B, 0, 0, 0}}; rc = zmq_poll (poller, 2, 100); assert (rc == 0); rc = zmq_poll (poller, 2, 100); assert (rc == 0); // No messages should be available, sending should fail. zmq_msg_t msg; zmq_msg_init (&msg); rc = zmq_send (A, "B", 2, ZMQ_SNDMORE | ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EHOSTUNREACH); rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // After a reconnect of B, the messages should still be gone rc = zmq_connect (B, connect_address); assert (rc == 0); rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (A); close_zero_linger (B); // Wait for disconnects. msleep (SETTLE_TIME); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); const char *binds[] = {"inproc://a", "tcp://127.0.0.1:*"}; for (int transport = 0; transport < 2; ++transport) { bind_address = binds[transport]; // SHALL receive incoming messages from its peers using a fair-queuing // strategy. test_fair_queue_in (ctx); // SHALL create a double queue when a peer connects to it. If this peer // disconnects, the ROUTER socket SHALL destroy its double queue and SHALL // discard any messages it contains. // *** Test disabled until libzmq does this properly *** // test_destroy_queue_on_disconnect (ctx); } int rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_last_endpoint.cpp0000664000372000037200000000443413255253220021515 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } static void do_bind_and_verify (void *s, const char *endpoint) { int rc = zmq_bind (s, endpoint); assert (rc == 0); char reported[255]; size_t size = 255; rc = zmq_getsockopt (s, ZMQ_LAST_ENDPOINT, reported, &size); assert (rc == 0 && strcmp (reported, endpoint) == 0); } void test_last_endpoint () { void *sb = test_context_socket (ZMQ_ROUTER); int val = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sb, ZMQ_LINGER, &val, sizeof (val))); do_bind_and_verify (sb, ENDPOINT_1); do_bind_and_verify (sb, ENDPOINT_2); test_context_socket_close (sb); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_last_endpoint); return UNITY_END (); } zeromq-4.2.5/tests/test_reconnect_ivl.cpp0000664000372000037200000000674513255253220021513 0ustar00travistravis00000000000000/* Copyright (c) 2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_reconnect_ivl_against_pair_socket (const char *my_endpoint, void *sb) { void *sc = test_context_socket (ZMQ_PAIR); int interval = -1; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sc, ZMQ_RECONNECT_IVL, &interval, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint)); bounce (sb, sc); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb, my_endpoint)); expect_bounce_fail (sb, sc); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, my_endpoint)); expect_bounce_fail (sb, sc); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint)); bounce (sb, sc); test_context_socket_close (sc); } #ifndef ZMQ_HAVE_WINDOWS void test_reconnect_ivl_ipc (void) { const char *ipc_endpoint = "ipc:///tmp/test_reconnect_ivl"; void *sb = test_context_socket (ZMQ_PAIR); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, ipc_endpoint)); test_reconnect_ivl_against_pair_socket (ipc_endpoint, sb); test_context_socket_close (sb); } #endif void test_reconnect_ivl_tcp (const char *address) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *sb = test_context_socket (ZMQ_PAIR); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (sb, address)); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); test_reconnect_ivl_against_pair_socket (my_endpoint, sb); test_context_socket_close (sb); } void test_reconnect_ivl_tcp_ipv4 () { test_reconnect_ivl_tcp ("tcp://127.0.0.1:*"); } void test_reconnect_ivl_tcp_ipv6 () { if (is_ipv6_available ()) { zmq_ctx_set (get_test_context (), ZMQ_IPV6, 1); test_reconnect_ivl_tcp ("tcp://[::1]:*"); } } int main (void) { setup_test_environment (); UNITY_BEGIN (); #ifndef ZMQ_HAVE_WINDOWS RUN_TEST (test_reconnect_ivl_ipc); #endif RUN_TEST (test_reconnect_ivl_tcp_ipv4); RUN_TEST (test_reconnect_ivl_tcp_ipv6); return UNITY_END (); } zeromq-4.2.5/tests/test_fork.cpp0000664000372000037200000000645013255253220017613 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *address = "tcp://127.0.0.1:*"; char connect_address[MAX_SOCKET_STRING]; #define NUM_MESSAGES 5 int main (void) { #if !defined(ZMQ_HAVE_WINDOWS) setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); // Create and bind pull socket to receive messages void *pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); int rc = zmq_bind (pull, address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); int pid = fork (); if (pid == 0) { // Child process // Immediately close parent sockets and context zmq_close (pull); zmq_ctx_term (ctx); // Create new context, socket, connect and send some messages void *child_ctx = zmq_ctx_new (); assert (child_ctx); void *push = zmq_socket (child_ctx, ZMQ_PUSH); assert (push); rc = zmq_connect (push, connect_address); assert (rc == 0); int count; for (count = 0; count < NUM_MESSAGES; count++) zmq_send (push, "Hello", 5, 0); zmq_close (push); zmq_ctx_destroy (child_ctx); exit (0); } else { // Parent process int count; for (count = 0; count < NUM_MESSAGES; count++) { char buffer[5]; int num_bytes = zmq_recv (pull, buffer, 5, 0); assert (num_bytes == 5); } int child_status; while (true) { rc = waitpid (pid, &child_status, 0); if (rc == -1 && errno == EINTR) continue; assert (rc > 0); // Verify the status code of the child was zero assert (WEXITSTATUS (child_status) == 0); break; } zmq_close (pull); zmq_ctx_term (ctx); exit (0); } #endif return 0; } zeromq-4.2.5/tests/test_term_endpoint.cpp0000664000372000037200000001547713255253220021532 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include "testutil.hpp" /* Use the worst case filename size for the buffer (+1 for trailing NUL) */ #define BUF_SIZE (FILENAME_MAX + 1) int main (void) { setup_test_environment (); int rc; char buf[BUF_SIZE]; size_t buf_size; const char *ep_wc_tcp = "tcp://127.0.0.1:*"; #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS const char *ep_wc_ipc = "ipc://*"; #endif #if defined ZMQ_HAVE_VMCI const char *ep_wc_vmci = "vmci://*:*"; #endif // Create infrastructure. void *ctx = zmq_ctx_new (); assert (ctx); void *push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_bind (push, ep_wc_tcp); assert (rc == 0); buf_size = sizeof (buf); rc = zmq_getsockopt (push, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); void *pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); rc = zmq_connect (pull, buf); assert (rc == 0); // Pass one message through to ensure the connection is established rc = zmq_send (push, "ABC", 3, 0); assert (rc == 3); rc = zmq_recv (pull, buf, sizeof (buf), 0); assert (rc == 3); // Unbind the listening endpoint buf_size = sizeof (buf); rc = zmq_getsockopt (push, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); rc = zmq_unbind (push, buf); assert (rc == 0); // Allow unbind to settle msleep (SETTLE_TIME); // Check that sending would block (there's no outbound connection) rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT); assert (rc == -1 && zmq_errno () == EAGAIN); // Clean up rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Create infrastructure ctx = zmq_ctx_new (); assert (ctx); pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); rc = zmq_bind (pull, ep_wc_tcp); assert (rc == 0); buf_size = sizeof (buf); rc = zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_connect (push, buf); assert (rc == 0); // Pass one message through to ensure the connection is established. rc = zmq_send (push, "ABC", 3, 0); assert (rc == 3); rc = zmq_recv (pull, buf, sizeof (buf), 0); assert (rc == 3); // Disconnect the bound endpoint buf_size = sizeof (buf); rc = zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); rc = zmq_disconnect (push, buf); assert (rc == 0); // Allow disconnect to settle msleep (SETTLE_TIME); // Check that sending would block (there's no inbound connections). rc = zmq_send (push, "ABC", 3, ZMQ_DONTWAIT); assert (rc == -1 && zmq_errno () == EAGAIN); // Clean up. rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Create infrastructure (wild-card binding) ctx = zmq_ctx_new (); assert (ctx); push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_bind (push, ep_wc_tcp); assert (rc == 0); pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS rc = zmq_bind (pull, ep_wc_ipc); assert (rc == 0); #endif #if defined ZMQ_HAVE_VMCI void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_bind (req, ep_wc_vmci); assert (rc == 0); #endif // Unbind sockets binded by wild-card address buf_size = sizeof (buf); rc = zmq_getsockopt (push, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); rc = zmq_unbind (push, buf); assert (rc == 0); #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS buf_size = sizeof (buf); rc = zmq_getsockopt (pull, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); rc = zmq_unbind (pull, buf); assert (rc == 0); #endif #if defined ZMQ_HAVE_VMCI buf_size = sizeof (buf); rc = zmq_getsockopt (req, ZMQ_LAST_ENDPOINT, buf, &buf_size); assert (rc == 0); rc = zmq_unbind (req, buf); assert (rc == 0); #endif // Clean up. rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Create infrastructure (wild-card binding) ctx = zmq_ctx_new (); assert (ctx); push = zmq_socket (ctx, ZMQ_PUSH); assert (push); rc = zmq_bind (push, ep_wc_tcp); assert (rc == 0); pull = zmq_socket (ctx, ZMQ_PULL); assert (pull); #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS rc = zmq_bind (pull, ep_wc_ipc); assert (rc == 0); #endif #if defined ZMQ_HAVE_VMCI req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_bind (req, ep_wc_vmci); assert (rc == 0); #endif // Sockets binded by wild-card address can't be unbinded by wild-card address rc = zmq_unbind (push, ep_wc_tcp); assert (rc == -1 && zmq_errno () == ENOENT); #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS rc = zmq_unbind (pull, ep_wc_ipc); assert (rc == -1 && zmq_errno () == ENOENT); #endif #if defined ZMQ_HAVE_VMCI rc = zmq_unbind (req, ep_wc_vmci); assert (rc == -1 && zmq_errno () == ENOENT); #endif // Clean up. rc = zmq_close (pull); assert (rc == 0); rc = zmq_close (push); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_spec_dealer.cpp0000664000372000037200000001677313255253220021131 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" const char *bind_address = 0; char connect_address[MAX_SOCKET_STRING]; void test_round_robin_out (void *ctx) { void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); int rc = zmq_bind (dealer, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (dealer, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *rep[services]; for (size_t peer = 0; peer < services; ++peer) { rep[peer] = zmq_socket (ctx, ZMQ_REP); assert (rep[peer]); int timeout = 250; rc = zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (rep[peer], connect_address); assert (rc == 0); } // Wait for connections. msleep (SETTLE_TIME); // Send all requests for (size_t i = 0; i < services; ++i) s_send_seq (dealer, 0, "ABC", SEQ_END); // Expect every REP got one message zmq_msg_t msg; zmq_msg_init (&msg); for (size_t peer = 0; peer < services; ++peer) s_recv_seq (rep[peer], "ABC", SEQ_END); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (dealer); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (rep[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_fair_queue_in (void *ctx) { void *receiver = zmq_socket (ctx, ZMQ_DEALER); assert (receiver); int timeout = 250; int rc = zmq_setsockopt (receiver, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_bind (receiver, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (receiver, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); const size_t services = 5; void *senders[services]; for (size_t peer = 0; peer < services; ++peer) { senders[peer] = zmq_socket (ctx, ZMQ_DEALER); assert (senders[peer]); rc = zmq_setsockopt (senders[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (senders[peer], connect_address); assert (rc == 0); } zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); s_send_seq (senders[0], "A", SEQ_END); s_recv_seq (receiver, "A", SEQ_END); s_send_seq (senders[0], "A", SEQ_END); s_recv_seq (receiver, "A", SEQ_END); // send our requests for (size_t peer = 0; peer < services; ++peer) s_send_seq (senders[peer], "B", SEQ_END); // Wait for data. msleep (SETTLE_TIME); // handle the requests for (size_t peer = 0; peer < services; ++peer) s_recv_seq (receiver, "B", SEQ_END); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (receiver); for (size_t peer = 0; peer < services; ++peer) close_zero_linger (senders[peer]); // Wait for disconnects. msleep (SETTLE_TIME); } void test_destroy_queue_on_disconnect (void *ctx) { void *A = zmq_socket (ctx, ZMQ_DEALER); assert (A); int rc = zmq_bind (A, bind_address); assert (rc == 0); size_t len = MAX_SOCKET_STRING; rc = zmq_getsockopt (A, ZMQ_LAST_ENDPOINT, connect_address, &len); assert (rc == 0); void *B = zmq_socket (ctx, ZMQ_DEALER); assert (B); rc = zmq_connect (B, connect_address); assert (rc == 0); // Send a message in both directions s_send_seq (A, "ABC", SEQ_END); s_send_seq (B, "DEF", SEQ_END); rc = zmq_disconnect (B, connect_address); assert (rc == 0); // Disconnect may take time and need command processing. zmq_pollitem_t poller[2] = {{A, 0, 0, 0}, {B, 0, 0, 0}}; rc = zmq_poll (poller, 2, 100); assert (rc == 0); rc = zmq_poll (poller, 2, 100); assert (rc == 0); // No messages should be available, sending should fail. zmq_msg_t msg; zmq_msg_init (&msg); rc = zmq_send (A, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); // After a reconnect of B, the messages should still be gone rc = zmq_connect (B, connect_address); assert (rc == 0); rc = zmq_msg_recv (&msg, A, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_recv (&msg, B, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_msg_close (&msg); assert (rc == 0); close_zero_linger (A); close_zero_linger (B); // Wait for disconnects. msleep (SETTLE_TIME); } void test_block_on_send_no_peers (void *ctx) { void *sc = zmq_socket (ctx, ZMQ_DEALER); assert (sc); int timeout = 250; int rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (timeout)); assert (rc == 0); rc = zmq_send (sc, 0, 0, ZMQ_DONTWAIT); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_send (sc, 0, 0, 0); assert (rc == -1); assert (errno == EAGAIN); rc = zmq_close (sc); assert (rc == 0); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); const char *binds[] = {"inproc://a", "tcp://127.0.0.1:*"}; for (int transports = 0; transports < 2; ++transports) { bind_address = binds[transports]; // SHALL route outgoing messages to available peers using a round-robin // strategy. test_round_robin_out (ctx); // SHALL receive incoming messages from its peers using a fair-queuing // strategy. test_fair_queue_in (ctx); // SHALL block on sending, or return a suitable error, when it has no connected peers. test_block_on_send_no_peers (ctx); // SHALL create a double queue when a peer connects to it. If this peer // disconnects, the DEALER socket SHALL destroy its double queue and SHALL // discard any messages it contains. // *** Test disabled until libzmq does this properly *** // test_destroy_queue_on_disconnect (ctx); } int rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_use_fd_ipc.cpp0000664000372000037200000001217313255253220020751 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if !defined(ZMQ_HAVE_WINDOWS) #include #include void pre_allocate_sock (void *zmq_socket, const char *path) { struct sockaddr_un addr; addr.sun_family = AF_UNIX; strcpy (addr.sun_path, path); unlink (path); int s_pre = socket (AF_UNIX, SOCK_STREAM, 0); assert (s_pre != -1); int rc = bind (s_pre, (struct sockaddr *) &addr, sizeof (struct sockaddr_un)); assert (rc == 0); rc = listen (s_pre, SOMAXCONN); assert (rc == 0); rc = zmq_setsockopt (zmq_socket, ZMQ_USE_FD, &s_pre, sizeof (s_pre)); assert (rc == 0); } void test_req_rep () { void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); pre_allocate_sock (sb, "/tmp/test_use_fd_ipc"); int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); } void test_pair () { void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); pre_allocate_sock (sb, "/tmp/test_use_fd_ipc"); int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); } void test_client_server () { #if defined(ZMQ_SERVER) && defined(ZMQ_CLIENT) void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_SERVER); assert (sb); pre_allocate_sock (sb, "/tmp/test_use_fd_ipc"); int rc = zmq_bind (sb, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_CLIENT); assert (sc); rc = zmq_connect (sc, "ipc:///tmp/test_use_fd_ipc"); assert (rc == 0); zmq_msg_t msg; rc = zmq_msg_init_size (&msg, 1); assert (rc == 0); char *data = (char *) zmq_msg_data (&msg); data[0] = 1; rc = zmq_msg_send (&msg, sc, ZMQ_SNDMORE); assert (rc == -1); rc = zmq_msg_send (&msg, sc, 0); assert (rc == 1); rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); uint32_t routing_id = zmq_msg_routing_id (&msg); assert (routing_id != 0); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_msg_init_size (&msg, 1); assert (rc == 0); data = (char *) zmq_msg_data (&msg); data[0] = 2; rc = zmq_msg_set_routing_id (&msg, routing_id); assert (rc == 0); rc = zmq_msg_send (&msg, sb, ZMQ_SNDMORE); assert (rc == -1); rc = zmq_msg_send (&msg, sb, 0); assert (rc == 1); rc = zmq_msg_recv (&msg, sc, 0); assert (rc == 1); routing_id = zmq_msg_routing_id (&msg); assert (routing_id == 0); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); rc = unlink ("/tmp/test_use_fd_ipc"); assert (rc == 0); #endif } int main (void) { setup_test_environment (); test_req_rep (); test_pair (); test_client_server (); return 0; } #else int main (void) { return 0; } #endif zeromq-4.2.5/tests/test_timers.cpp0000664000372000037200000001620513255253220020154 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #define __STDC_LIMIT_MACROS // to define SIZE_MAX with older compilers #include "testutil.hpp" void handler (int timer_id, void *arg) { (void) timer_id; // Stop 'unused' compiler warnings *((bool *) arg) = true; } int sleep_and_execute (void *timers_) { int timeout = zmq_timers_timeout (timers_); // Sleep methods are inaccurate, so we sleep in a loop until time arrived while (timeout > 0) { msleep (timeout); timeout = zmq_timers_timeout (timers_); } return zmq_timers_execute (timers_); } void test_null_timer_pointers () { void *timers = NULL; int rc = zmq_timers_destroy (&timers); assert (rc == -1 && errno == EFAULT); // TODO this currently triggers an access violation #if 0 rc = zmq_timers_destroy (NULL); assert (rc == -1 && errno == EFAULT); #endif const size_t dummy_interval = 100; const int dummy_timer_id = 1; rc = zmq_timers_add (timers, dummy_interval, &handler, NULL); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_add (&timers, dummy_interval, &handler, NULL); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_cancel (timers, dummy_timer_id); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_cancel (&timers, dummy_timer_id); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_set_interval (timers, dummy_timer_id, dummy_interval); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_set_interval (&timers, dummy_timer_id, dummy_interval); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_reset (timers, dummy_timer_id); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_reset (&timers, dummy_timer_id); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_timeout (timers); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_timeout (&timers); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_execute (timers); assert (rc == -1 && errno == EFAULT); rc = zmq_timers_execute (&timers); assert (rc == -1 && errno == EFAULT); } void test_corner_cases () { void *timers = zmq_timers_new (); assert (timers); const size_t dummy_interval = SIZE_MAX; const int dummy_timer_id = 1; // attempt to cancel non-existent timer int rc = zmq_timers_cancel (timers, dummy_timer_id); assert (rc == -1 && errno == EINVAL); // attempt to set interval of non-existent timer rc = zmq_timers_set_interval (timers, dummy_timer_id, dummy_interval); assert (rc == -1 && errno == EINVAL); // attempt to reset non-existent timer rc = zmq_timers_reset (timers, dummy_timer_id); assert (rc == -1 && errno == EINVAL); // attempt to add NULL handler rc = zmq_timers_add (timers, dummy_interval, NULL, NULL); assert (rc == -1 && errno == EFAULT); int timer_id = zmq_timers_add (timers, dummy_interval, handler, NULL); assert (timer_id != -1); // attempt to cancel timer twice // TODO should this case really be an error? canceling twice could be allowed rc = zmq_timers_cancel (timers, timer_id); assert (rc == 0); rc = zmq_timers_cancel (timers, timer_id); assert (rc == -1 && errno == EINVAL); // timeout without any timers active rc = zmq_timers_timeout (timers); assert (rc == -1); rc = zmq_timers_destroy (&timers); assert (rc == 0); } int main (void) { setup_test_environment (); void *timers = zmq_timers_new (); assert (timers); bool timer_invoked = false; const unsigned long full_timeout = 100; void *const stopwatch = zmq_stopwatch_start (); int timer_id = zmq_timers_add (timers, full_timeout, handler, &timer_invoked); assert (timer_id); // Timer should not have been invoked yet int rc = zmq_timers_execute (timers); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API if (zmq_stopwatch_intermediate (stopwatch) < full_timeout) { assert (!timer_invoked); } #endif // Wait half the time and check again long timeout = zmq_timers_timeout (timers); assert (rc != -1); msleep (timeout / 2); rc = zmq_timers_execute (timers); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API if (zmq_stopwatch_intermediate (stopwatch) < full_timeout) { assert (!timer_invoked); } #endif // Wait until the end rc = sleep_and_execute (timers); assert (rc == 0); assert (timer_invoked); timer_invoked = false; // Wait half the time and check again timeout = zmq_timers_timeout (timers); assert (rc != -1); msleep (timeout / 2); rc = zmq_timers_execute (timers); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API if (zmq_stopwatch_intermediate (stopwatch) < 2 * full_timeout) { assert (!timer_invoked); } #endif // Reset timer and wait half of the time left rc = zmq_timers_reset (timers, timer_id); assert (rc == 0); msleep (timeout / 2); rc = zmq_timers_execute (timers); assert (rc == 0); if (zmq_stopwatch_stop (stopwatch) < 2 * full_timeout) { assert (!timer_invoked); } // Wait until the end rc = sleep_and_execute (timers); assert (rc == 0); assert (timer_invoked); timer_invoked = false; // reschedule rc = zmq_timers_set_interval (timers, timer_id, 50); assert (rc == 0); rc = sleep_and_execute (timers); assert (rc == 0); assert (timer_invoked); timer_invoked = false; // cancel timer timeout = zmq_timers_timeout (timers); assert (rc != -1); rc = zmq_timers_cancel (timers, timer_id); assert (rc == 0); msleep (timeout * 2); rc = zmq_timers_execute (timers); assert (rc == 0); assert (!timer_invoked); rc = zmq_timers_destroy (&timers); assert (rc == 0); test_null_timer_pointers (); test_corner_cases (); return 0; } zeromq-4.2.5/tests/test_hwm.cpp0000664000372000037200000002355613255253220017453 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } const int MAX_SENDS = 10000; enum TestType { BIND_FIRST, CONNECT_FIRST }; void test_defaults () { // Set up bind socket void *bind_socket = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a")); // Set up connect socket void *connect_socket = test_context_socket (ZMQ_PUSH); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a")); // Send until we block int send_count = 0; while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; msleep (SETTLE_TIME); // Now receive all sent messages int recv_count = 0; while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++recv_count; TEST_ASSERT_EQUAL_INT (send_count, recv_count); // Clean up test_context_socket_close (connect_socket); test_context_socket_close (bind_socket); // Default values are 1000 on send and 1000 one receive, so 2000 total TEST_ASSERT_EQUAL_INT (2000, send_count); } int count_msg (int send_hwm, int recv_hwm, TestType testType) { void *bind_socket; void *connect_socket; if (testType == BIND_FIRST) { // Set up bind socket bind_socket = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt ( bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a")); // Set up connect socket connect_socket = test_context_socket (ZMQ_PUSH); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt ( connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a")); } else { // Set up connect socket connect_socket = test_context_socket (ZMQ_PUSH); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt ( connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a")); // Set up bind socket bind_socket = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt ( bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a")); } // Send until we block int send_count = 0; while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; // Now receive all sent messages int recv_count = 0; while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++recv_count; TEST_ASSERT_EQUAL_INT (send_count, recv_count); // Now it should be possible to send one more. send_string_expect_success (connect_socket, NULL, 0); // Consume the remaining message. recv_string_expect_success (bind_socket, NULL, 0); // Clean up test_context_socket_close (connect_socket); test_context_socket_close (bind_socket); return send_count; } int test_inproc_bind_first (int send_hwm, int recv_hwm) { return count_msg (send_hwm, recv_hwm, BIND_FIRST); } int test_inproc_connect_first (int send_hwm, int recv_hwm) { return count_msg (send_hwm, recv_hwm, CONNECT_FIRST); } int test_inproc_connect_and_close_first (int send_hwm, int recv_hwm) { // Set up connect socket void *connect_socket = test_context_socket (ZMQ_PUSH); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (connect_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a")); // Send until we block int send_count = 0; while (send_count < MAX_SENDS && zmq_send (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; // Close connect test_context_socket_close (connect_socket); // Set up bind socket void *bind_socket = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (bind_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a")); // Now receive all sent messages int recv_count = 0; while (zmq_recv (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++recv_count; TEST_ASSERT_EQUAL_INT (send_count, recv_count); // Clean up test_context_socket_close (bind_socket); return send_count; } int test_inproc_bind_and_close_first (int send_hwm, int /* recv_hwm */) { void *ctx = zmq_ctx_new (); TEST_ASSERT_NOT_NULL (ctx); // Set up bind socket void *bind_socket = zmq_socket (ctx, ZMQ_PUSH); TEST_ASSERT_NOT_NULL (bind_socket); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (bind_socket, "inproc://a")); // Send until we block int send_count = 0; while (send_count < MAX_SENDS && zmq_send (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; // Close bind TEST_ASSERT_SUCCESS_ERRNO (zmq_close (bind_socket)); /* TODO Can't currently do connect without then wiring up a bind as things hang, this needs top be fixed. // Set up connect socket void *connect_socket = zmq_socket (ctx, ZMQ_PULL); TEST_ASSERT_NOT_NULL(connect_socket); TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &recv_hwm, sizeof (recv_hwm))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (connect_socket, "inproc://a")); // Now receive all sent messages int recv_count = 0; while (zmq_recv (connect_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++recv_count; TEST_ASSERT_EQUAL_INT(send_count, recv_count); */ // Clean up //TEST_ASSERT_SUCCESS_ERRNO (zmq_close (connect_socket)); TEST_ASSERT_SUCCESS_ERRNO (zmq_ctx_term (ctx)); return send_count; } void test_infinite_both_inproc_bind_first () { int count = test_inproc_bind_first (0, 0); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_infinite_both_inproc_connect_first () { int count = test_inproc_connect_first (0, 0); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_infinite_receive_inproc_bind_first () { int count = test_inproc_bind_first (1, 0); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_infinite_receive_inproc_connect_first () { int count = test_inproc_connect_first (1, 0); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_infinite_send_inproc_bind_first () { int count = test_inproc_bind_first (0, 1); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_infinite_send_inproc_connect_first () { int count = test_inproc_connect_first (0, 1); TEST_ASSERT_EQUAL_INT (MAX_SENDS, count); } void test_finite_both_bind_first () { // Send and recv buffers hwm 1, so total that can be queued is 2 int count = test_inproc_bind_first (1, 1); TEST_ASSERT_EQUAL_INT (2, count); } void test_finite_both_connect_first () { // Send and recv buffers hwm 1, so total that can be queued is 2 int count = test_inproc_connect_first (1, 1); TEST_ASSERT_EQUAL_INT (2, count); } void test_infinite_recv_connect_and_close_first () { // Send hwm of 1, send before bind so total that can be queued is 1 int count = test_inproc_connect_and_close_first (1, 0); TEST_ASSERT_EQUAL_INT (1, count); } void test_infinite_recv_bind_and_close_first () { // Send hwm of 1, send from bind side before connect so total that can be queued should be 1, // however currently all messages get thrown away before the connect. BUG? /*int count = */ test_inproc_bind_and_close_first (1, 0); // TEST_ASSERT_EQUAL_INT (1, count); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_defaults); RUN_TEST (test_infinite_both_inproc_bind_first); RUN_TEST (test_infinite_both_inproc_connect_first); RUN_TEST (test_infinite_receive_inproc_bind_first); RUN_TEST (test_infinite_receive_inproc_connect_first); RUN_TEST (test_infinite_send_inproc_bind_first); RUN_TEST (test_infinite_send_inproc_connect_first); RUN_TEST (test_finite_both_bind_first); RUN_TEST (test_finite_both_connect_first); RUN_TEST (test_infinite_recv_connect_and_close_first); RUN_TEST (test_infinite_recv_bind_and_close_first); return UNITY_END (); } zeromq-4.2.5/tests/test_router_mandatory_tipc.cpp0000664000372000037200000000476413255253220023275 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } fprintf (stderr, "test_router_mandatory_tipc running...\n"); void *ctx = zmq_init (1); assert (ctx); // Creating the first socket. void *sa = zmq_socket (ctx, ZMQ_ROUTER); assert (sa); int rc = zmq_bind (sa, "tipc://{15560,0,0}"); assert (rc == 0); // Sending a message to an unknown peer with the default setting rc = zmq_send (sa, "UNKNOWN", 7, ZMQ_SNDMORE); assert (rc == 7); rc = zmq_send (sa, "DATA", 4, 0); assert (rc == 4); int mandatory = 1; // Set mandatory routing on socket rc = zmq_setsockopt (sa, ZMQ_ROUTER_MANDATORY, &mandatory, sizeof (mandatory)); assert (rc == 0); // Send a message and check that it fails rc = zmq_send (sa, "UNKNOWN", 7, ZMQ_SNDMORE | ZMQ_DONTWAIT); assert (rc == -1 && errno == EHOSTUNREACH); rc = zmq_close (sa); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_req_relaxed.cpp0000664000372000037200000001560613255253220021150 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static void bounce (void *socket) { int more; size_t more_size = sizeof (more); do { zmq_msg_t recv_part, sent_part; int rc = zmq_msg_init (&recv_part); assert (rc == 0); rc = zmq_msg_recv (&recv_part, socket, 0); assert (rc != -1); rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); zmq_msg_init (&sent_part); zmq_msg_copy (&sent_part, &recv_part); rc = zmq_msg_send (&sent_part, socket, more ? ZMQ_SNDMORE : 0); assert (rc != -1); zmq_msg_close (&recv_part); } while (more); } static int get_events (void *socket) { int rc; int events; size_t events_size = sizeof (events); rc = zmq_getsockopt (socket, ZMQ_EVENTS, &events, &events_size); assert (rc == 0); return events; } int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); int enabled = 1; int rc = zmq_setsockopt (req, ZMQ_REQ_RELAXED, &enabled, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (req, ZMQ_REQ_CORRELATE, &enabled, sizeof (int)); assert (rc == 0); rc = zmq_bind (req, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (req, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); const size_t services = 5; void *rep[services]; for (size_t peer = 0; peer < services; peer++) { rep[peer] = zmq_socket (ctx, ZMQ_REP); assert (rep[peer]); int timeout = 500; rc = zmq_setsockopt (rep[peer], ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_connect (rep[peer], my_endpoint); assert (rc == 0); } // We have to give the connects time to finish otherwise the requests // will not properly round-robin. We could alternatively connect the // REQ sockets to the REP sockets. msleep (SETTLE_TIME); // Case 1: Second send() before a reply arrives in a pipe. int events = get_events (req); assert (events == ZMQ_POLLOUT); // Send a request, ensure it arrives, don't send a reply s_send_seq (req, "A", "B", SEQ_END); s_recv_seq (rep[0], "A", "B", SEQ_END); events = get_events (req); assert (events == ZMQ_POLLOUT); // Send another request on the REQ socket s_send_seq (req, "C", "D", SEQ_END); s_recv_seq (rep[1], "C", "D", SEQ_END); events = get_events (req); assert (events == ZMQ_POLLOUT); // Send a reply to the first request - that should be discarded by the REQ s_send_seq (rep[0], "WRONG", SEQ_END); // Send the expected reply s_send_seq (rep[1], "OK", SEQ_END); s_recv_seq (req, "OK", SEQ_END); // Another standard req-rep cycle, just to check s_send_seq (req, "E", SEQ_END); s_recv_seq (rep[2], "E", SEQ_END); s_send_seq (rep[2], "F", "G", SEQ_END); s_recv_seq (req, "F", "G", SEQ_END); // Case 2: Second send() after a reply is already in a pipe on the REQ. // Send a request, ensure it arrives, send a reply s_send_seq (req, "H", SEQ_END); s_recv_seq (rep[3], "H", SEQ_END); s_send_seq (rep[3], "BAD", SEQ_END); // Wait for message to be there. msleep (SETTLE_TIME); // Without receiving that reply, send another request on the REQ socket s_send_seq (req, "I", SEQ_END); s_recv_seq (rep[4], "I", SEQ_END); // Send the expected reply s_send_seq (rep[4], "GOOD", SEQ_END); s_recv_seq (req, "GOOD", SEQ_END); // Case 3: Check issue #1690. Two send() in a row should not close the // communication pipes. For example pipe from req to rep[0] should not be // closed after executing Case 1. So rep[0] should be the next to receive, // not rep[1]. s_send_seq (req, "J", SEQ_END); s_recv_seq (rep[0], "J", SEQ_END); close_zero_linger (req); for (size_t peer = 0; peer < services; peer++) close_zero_linger (rep[peer]); // Wait for disconnects. msleep (SETTLE_TIME); // Case 4: Check issue #1695. As messages may pile up before a responder // is available, we check that responses to messages other than the last // sent one are correctly discarded by the REQ pipe // Setup REQ socket as client req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_setsockopt (req, ZMQ_REQ_RELAXED, &enabled, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (req, ZMQ_REQ_CORRELATE, &enabled, sizeof (int)); assert (rc == 0); rc = zmq_connect (req, ENDPOINT_0); assert (rc == 0); // Setup ROUTER socket as server but do not bind it just yet void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); // Send two requests s_send_seq (req, "TO_BE_DISCARDED", SEQ_END); s_send_seq (req, "TO_BE_ANSWERED", SEQ_END); // Bind server allowing it to receive messages rc = zmq_bind (router, ENDPOINT_0); assert (rc == 0); // Read the two messages and send them back as is bounce (router); bounce (router); // Read the expected correlated reply. As the ZMQ_REQ_CORRELATE is active, // the expected answer is "TO_BE_ANSWERED", not "TO_BE_DISCARDED". s_recv_seq (req, "TO_BE_ANSWERED", SEQ_END); close_zero_linger (req); close_zero_linger (router); // Wait for disconnects. msleep (SETTLE_TIME); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_msg_flags.cpp0000664000372000037200000000717713255253220020623 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); // Create the infrastructure void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_ROUTER); assert (sb); int rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_DEALER); assert (sc); rc = zmq_connect (sc, "inproc://a"); assert (rc == 0); // Send 2-part message. rc = zmq_send (sc, "A", 1, ZMQ_SNDMORE); assert (rc == 1); rc = zmq_send (sc, "B", 1, 0); assert (rc == 1); // Routing id comes first. zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, sb, 0); assert (rc >= 0); int more = zmq_msg_more (&msg); assert (more == 1); // Then the first part of the message body. rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); more = zmq_msg_more (&msg); assert (more == 1); // And finally, the second part of the message body. rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); more = zmq_msg_more (&msg); assert (more == 0); // Test ZMQ_SHARED property (case 1, refcounted messages) zmq_msg_t msg_a; rc = zmq_msg_init_size (&msg_a, 1024); // large enough to be a type_lmsg assert (rc == 0); // Message is not shared rc = zmq_msg_get (&msg_a, ZMQ_SHARED); assert (rc == 0); zmq_msg_t msg_b; rc = zmq_msg_init (&msg_b); assert (rc == 0); rc = zmq_msg_copy (&msg_b, &msg_a); assert (rc == 0); // Message is now shared rc = zmq_msg_get (&msg_b, ZMQ_SHARED); assert (rc == 1); // cleanup rc = zmq_msg_close (&msg_a); assert (rc == 0); rc = zmq_msg_close (&msg_b); assert (rc == 0); // Test ZMQ_SHARED property (case 2, constant data messages) rc = zmq_msg_init_data (&msg_a, (void *) "TEST", 5, 0, 0); assert (rc == 0); // Message reports as shared rc = zmq_msg_get (&msg_a, ZMQ_SHARED); assert (rc == 1); // cleanup rc = zmq_msg_close (&msg_a); assert (rc == 0); // Deallocate the infrastructure. rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_reqrep_tcp.cpp0000664000372000037200000001635113255253220021017 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_single_connect (int ipv6) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *sb = test_context_socket (ZMQ_REP); bind_loopback (sb, ipv6, my_endpoint, len); void *sc = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sc, ZMQ_IPV6, &ipv6, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint)); bounce (sb, sc); // the sockets are disconnected and unbound explicitly in this test case // to check that this can be done successfully with the expected // endpoints/addresses TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc, my_endpoint)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb, my_endpoint)); test_context_socket_close (sc); test_context_socket_close (sb); } void make_connect_address (char *connect_address, const int ipv6, const int port, const char *bind_address) { sprintf (connect_address, "tcp://%s:%i;%s", ipv6 ? "[::1]" : "127.0.0.1", port, strrchr (bind_address, '/') + 1); } void test_multi_connect (int ipv6) { size_t len = MAX_SOCKET_STRING; char my_endpoint_0[MAX_SOCKET_STRING]; char my_endpoint_1[MAX_SOCKET_STRING]; char my_endpoint_2[MAX_SOCKET_STRING]; char my_endpoint_3[MAX_SOCKET_STRING * 2]; void *sb0 = test_context_socket (ZMQ_REP); bind_loopback (sb0, ipv6, my_endpoint_0, len); void *sb1 = test_context_socket (ZMQ_REP); bind_loopback (sb1, ipv6, my_endpoint_1, len); void *sb2 = test_context_socket (ZMQ_REP); bind_loopback (sb2, ipv6, my_endpoint_2, len); void *sc = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sc, ZMQ_IPV6, &ipv6, sizeof (int))); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint_0)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint_1)); make_connect_address (my_endpoint_3, ipv6, 5564, my_endpoint_2); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc, my_endpoint_3)); bounce (sb0, sc); bounce (sb1, sc); bounce (sb2, sc); bounce (sb0, sc); bounce (sb1, sc); bounce (sb2, sc); bounce (sb0, sc); /// see comment on zmq_disconnect/zmq_unbind in test_single_connect TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc, my_endpoint_0)); TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc, my_endpoint_3)); TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc, my_endpoint_1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb0, my_endpoint_0)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb1, my_endpoint_1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb2, my_endpoint_2)); test_context_socket_close (sc); test_context_socket_close (sb0); test_context_socket_close (sb1); test_context_socket_close (sb2); } void test_multi_connect_same_port (int ipv6) { size_t len = MAX_SOCKET_STRING; char my_endpoint_0[MAX_SOCKET_STRING]; char my_endpoint_1[MAX_SOCKET_STRING]; char my_endpoint_2[MAX_SOCKET_STRING * 2]; char my_endpoint_3[MAX_SOCKET_STRING * 2]; char my_endpoint_4[MAX_SOCKET_STRING * 2]; char my_endpoint_5[MAX_SOCKET_STRING * 2]; void *sb0 = test_context_socket (ZMQ_REP); bind_loopback (sb0, ipv6, my_endpoint_0, len); void *sb1 = test_context_socket (ZMQ_REP); bind_loopback (sb1, ipv6, my_endpoint_1, len); void *sc0 = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sc0, ZMQ_IPV6, &ipv6, sizeof (int))); make_connect_address (my_endpoint_2, ipv6, 5564, my_endpoint_0); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc0, my_endpoint_2)); make_connect_address (my_endpoint_3, ipv6, 5565, my_endpoint_1); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc0, my_endpoint_3)); void *sc1 = test_context_socket (ZMQ_REQ); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (sc1, ZMQ_IPV6, &ipv6, sizeof (int))); make_connect_address (my_endpoint_4, ipv6, 5565, my_endpoint_0); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc1, my_endpoint_4)); make_connect_address (my_endpoint_5, ipv6, 5564, my_endpoint_1); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sc1, my_endpoint_5)); bounce (sb0, sc0); bounce (sb1, sc0); bounce (sb0, sc1); bounce (sb1, sc1); bounce (sb0, sc0); bounce (sb1, sc0); /// see comment on zmq_disconnect/zmq_unbind in test_single_connect TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc1, my_endpoint_4)); TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc1, my_endpoint_5)); TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc0, my_endpoint_2)); TEST_ASSERT_SUCCESS_ERRNO (zmq_disconnect (sc0, my_endpoint_3)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb0, my_endpoint_0)); TEST_ASSERT_SUCCESS_ERRNO (zmq_unbind (sb1, my_endpoint_1)); test_context_socket_close (sc0); test_context_socket_close (sc1); test_context_socket_close (sb0); test_context_socket_close (sb1); } void test_single_connect_ipv4 () { test_single_connect (false); } void test_multi_connect_ipv4 () { test_multi_connect (false); } void test_multi_connect_same_port_ipv4 () { test_multi_connect_same_port (false); } void test_single_connect_ipv6 () { test_single_connect (true); } void test_multi_connect_ipv6 () { test_multi_connect (true); } void test_multi_connect_same_port_ipv6 () { test_multi_connect_same_port (true); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_single_connect_ipv4); RUN_TEST (test_multi_connect_ipv4); RUN_TEST (test_multi_connect_same_port_ipv4); RUN_TEST (test_single_connect_ipv6); RUN_TEST (test_multi_connect_ipv6); RUN_TEST (test_multi_connect_same_port_ipv6); return UNITY_END (); } zeromq-4.2.5/tests/test_security_plain.cpp0000664000372000037200000001563613255253220021712 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket #else #include #include #include #include #endif static void zap_handler (void *ctx) { // Create and bind ZAP socket void *zap = zmq_socket (ctx, ZMQ_REP); assert (zap); int rc = zmq_bind (zap, "inproc://zeromq.zap.01"); assert (rc == 0); // Process ZAP requests forever while (true) { char *version = s_recv (zap); if (!version) break; // Terminating char *sequence = s_recv (zap); char *domain = s_recv (zap); char *address = s_recv (zap); char *routing_id = s_recv (zap); char *mechanism = s_recv (zap); char *username = s_recv (zap); char *password = s_recv (zap); assert (streq (version, "1.0")); assert (streq (mechanism, "PLAIN")); assert (streq (routing_id, "IDENT")); s_sendmore (zap, version); s_sendmore (zap, sequence); if (streq (username, "admin") && streq (password, "password")) { s_sendmore (zap, "200"); s_sendmore (zap, "OK"); s_sendmore (zap, "anonymous"); s_send (zap, ""); } else { s_sendmore (zap, "400"); s_sendmore (zap, "Invalid username or password"); s_sendmore (zap, ""); s_send (zap, ""); } free (version); free (sequence); free (domain); free (address); free (routing_id); free (mechanism); free (username); free (password); } rc = zmq_close (zap); assert (rc == 0); } int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // Spawn ZAP handler void *zap_thread = zmq_threadstart (&zap_handler, ctx); // Server socket will accept connections void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); int rc = zmq_setsockopt (server, ZMQ_ROUTING_ID, "IDENT", 6); const char domain[] = "test"; assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, domain, strlen (domain)); assert (rc == 0); int as_server = 1; rc = zmq_setsockopt (server, ZMQ_PLAIN_SERVER, &as_server, sizeof (int)); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); char username[256]; char password[256]; // Check PLAIN security with correct username/password void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); strcpy (username, "admin"); rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, username, strlen (username)); assert (rc == 0); strcpy (password, "password"); rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, password, strlen (password)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); bounce (server, client); rc = zmq_close (client); assert (rc == 0); // Check PLAIN security with badly configured client (as_server) // This will be caught by the plain_server class, not passed to ZAP client = zmq_socket (ctx, ZMQ_DEALER); assert (client); as_server = 1; rc = zmq_setsockopt (client, ZMQ_ZAP_DOMAIN, domain, strlen (domain)); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_PLAIN_SERVER, &as_server, sizeof (int)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); // Check PLAIN security -- failed authentication client = zmq_socket (ctx, ZMQ_DEALER); assert (client); strcpy (username, "wronguser"); strcpy (password, "wrongpass"); rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, username, strlen (username)); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, password, strlen (password)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); // Unauthenticated messages from a vanilla socket shouldn't be received struct sockaddr_in ip4addr; int s; unsigned short int port; rc = sscanf (my_endpoint, "tcp://127.0.0.1:%hu", &port); assert (rc == 1); ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons (port); #if defined(ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600) ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1"); #else inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #endif s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); rc = connect (s, (struct sockaddr *) &ip4addr, sizeof (ip4addr)); assert (rc > -1); // send anonymous ZMTP/1.0 greeting send (s, "\x01\x00", 2, 0); // send sneaky message that shouldn't be received send (s, "\x08\x00sneaky\0", 9, 0); int timeout = 250; zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); char *buf = s_recv (server); if (buf != NULL) { printf ("Received unauthenticated message: %s\n", buf); assert (buf == NULL); } close (s); // Shutdown rc = zmq_close (server); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Wait until ZAP handler terminates zmq_threadclose (zap_thread); return 0; } zeromq-4.2.5/tests/test_sub_forward.cpp0000664000372000037200000000676713255253220021202 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char endpoint1[MAX_SOCKET_STRING]; char endpoint2[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // First, create an intermediate device void *xpub = zmq_socket (ctx, ZMQ_XPUB); assert (xpub); int rc = zmq_bind (xpub, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (xpub, ZMQ_LAST_ENDPOINT, endpoint1, &len); assert (rc == 0); void *xsub = zmq_socket (ctx, ZMQ_XSUB); assert (xsub); rc = zmq_bind (xsub, "tcp://127.0.0.1:*"); assert (rc == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (xsub, ZMQ_LAST_ENDPOINT, endpoint2, &len); assert (rc == 0); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_PUB); assert (pub); rc = zmq_connect (pub, endpoint2); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_SUB); assert (sub); rc = zmq_connect (sub, endpoint1); assert (rc == 0); // Subscribe for all messages. rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); // Pass the subscription upstream through the device char buff[32]; rc = zmq_recv (xpub, buff, sizeof (buff), 0); assert (rc >= 0); rc = zmq_send (xsub, buff, rc, 0); assert (rc >= 0); // Wait a bit till the subscription gets to the publisher msleep (SETTLE_TIME); // Send an empty message rc = zmq_send (pub, NULL, 0, 0); assert (rc == 0); // Pass the message downstream through the device rc = zmq_recv (xsub, buff, sizeof (buff), 0); assert (rc >= 0); rc = zmq_send (xpub, buff, rc, 0); assert (rc >= 0); // Receive the message in the subscriber rc = zmq_recv (sub, buff, sizeof (buff), 0); assert (rc == 0); // Clean up. rc = zmq_close (xpub); assert (rc == 0); rc = zmq_close (xsub); assert (rc == 0); rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_proxy_terminate.cpp0000664000372000037200000001045713255253220022105 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // This is a test for issue #1382. The server thread creates a SUB-PUSH // steerable proxy. The main process then sends messages to the SUB // but there is no pull on the other side, previously the proxy blocks // in writing to the backend, preventing the proxy from terminating void server_task (void *ctx) { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Frontend socket talks to main process void *frontend = zmq_socket (ctx, ZMQ_SUB); assert (frontend); int rc = zmq_setsockopt (frontend, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); rc = zmq_bind (frontend, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (frontend, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Nice socket which is never read void *backend = zmq_socket (ctx, ZMQ_PUSH); assert (backend); rc = zmq_bind (backend, "tcp://127.0.0.1:*"); assert (rc == 0); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_REQ); assert (control); rc = zmq_connect (control, "inproc://control"); assert (rc == 0); rc = s_send (control, my_endpoint); assert (rc > 0); // Connect backend to frontend via a proxy rc = zmq_proxy_steerable (frontend, backend, NULL, control); assert (rc == 0); rc = zmq_close (frontend); assert (rc == 0); rc = zmq_close (backend); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); } // The main thread simply starts a basic steerable proxy server, publishes some messages, and then // waits for the server to terminate. int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *thread = zmq_threadstart (&server_task, ctx); // Control socket receives terminate command from main over inproc void *control = zmq_socket (ctx, ZMQ_REP); assert (control); int rc = zmq_bind (control, "inproc://control"); assert (rc == 0); char *my_endpoint = s_recv (control); assert (my_endpoint); msleep (500); // Run for 500 ms // Start a secondary publisher which writes data to the SUB-PUSH server socket void *publisher = zmq_socket (ctx, ZMQ_PUB); assert (publisher); rc = zmq_connect (publisher, my_endpoint); assert (rc == 0); msleep (SETTLE_TIME); rc = zmq_send (publisher, "This is a test", 14, 0); assert (rc == 14); msleep (50); rc = zmq_send (publisher, "This is a test", 14, 0); assert (rc == 14); msleep (50); rc = zmq_send (publisher, "This is a test", 14, 0); assert (rc == 14); rc = zmq_send (control, "TERMINATE", 9, 0); assert (rc == 9); rc = zmq_close (publisher); assert (rc == 0); rc = zmq_close (control); assert (rc == 0); free (my_endpoint); zmq_threadclose (thread); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_app_meta.cpp0000664000372000037200000001243113255253220020434 0ustar00travistravis00000000000000/* Copyright (c) 2007-2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include void setUp () { } void tearDown () { } void test_app_meta_reqrep () { void *ctx; zmq_msg_t msg; void *rep_sock, *req_sock; const char *req_hello = "X-hello:hello"; const char *req_connection = "X-connection:primary"; const char *req_z85 = "X-bin:009c6"; const char *rep_hello = "X-hello:world"; const char *rep_connection = "X-connection:backup"; const char *bad_strings[] = { ":", "key:", ":value", "keyvalue", "", "X-" "KeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKe" "yTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyT" "ooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyTooLongKeyToo" "LongKeyTooLongKeyTooLongKeyTooLongKeyTooLong:value"}; ctx = zmq_ctx_new (); rep_sock = zmq_socket (ctx, ZMQ_REP); TEST_ASSERT_NOT_NULL (rep_sock); req_sock = zmq_socket (ctx, ZMQ_REQ); TEST_ASSERT_NOT_NULL (req_sock); int rc = zmq_setsockopt (rep_sock, ZMQ_METADATA, rep_hello, strlen (rep_hello)); TEST_ASSERT_EQUAL_INT (0, rc); int l = 0; rc = zmq_setsockopt (rep_sock, ZMQ_LINGER, &l, sizeof (l)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (rep_sock, ZMQ_METADATA, rep_connection, strlen (rep_connection)); TEST_ASSERT_EQUAL_INT (0, rc); for (int i = 0; i < 6; i++) { rc = zmq_setsockopt (rep_sock, ZMQ_METADATA, bad_strings[i], strlen (bad_strings[i])); TEST_ASSERT_EQUAL_INT (-1, rc); } rc = zmq_bind (rep_sock, "tcp://127.0.0.1:5555"); TEST_ASSERT_EQUAL_INT (0, rc); l = 0; rc = zmq_setsockopt (req_sock, ZMQ_LINGER, &l, sizeof (l)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (req_sock, ZMQ_METADATA, req_hello, strlen (req_hello)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (req_sock, ZMQ_METADATA, req_connection, strlen (req_connection)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (req_sock, ZMQ_METADATA, req_z85, strlen (req_z85)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_connect (req_sock, "tcp://127.0.0.1:5555"); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_msg_init_size (&msg, 1); TEST_ASSERT_EQUAL_INT (0, rc); char *data = (char *) zmq_msg_data (&msg); data[0] = 1; rc = zmq_msg_send (&msg, req_sock, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_msg_init (&msg); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_msg_recv (&msg, rep_sock, 0); TEST_ASSERT_EQUAL_INT (1, rc); TEST_ASSERT_EQUAL_STRING ("hello", zmq_msg_gets (&msg, "X-hello")); TEST_ASSERT_EQUAL_STRING ("primary", zmq_msg_gets (&msg, "X-connection")); char *bindata = (char *) zmq_msg_gets (&msg, "X-bin"); TEST_ASSERT_NOT_NULL (bindata); uint8_t rawdata[4]; void *ret = zmq_z85_decode (rawdata, bindata); TEST_ASSERT_NOT_NULL (ret); TEST_ASSERT_EQUAL_UINT8 (0, rawdata[0]); TEST_ASSERT_EQUAL_UINT8 (1, rawdata[1]); TEST_ASSERT_EQUAL_UINT8 (2, rawdata[2]); TEST_ASSERT_EQUAL_UINT8 (3, rawdata[3]); TEST_ASSERT_NULL (zmq_msg_gets (&msg, "X-foobar")); TEST_ASSERT_NULL (zmq_msg_gets (&msg, "foobar")); rc = zmq_msg_send (&msg, rep_sock, 0); TEST_ASSERT_EQUAL_INT (1, rc); rc = zmq_msg_recv (&msg, req_sock, 0); TEST_ASSERT_EQUAL_INT (1, rc); TEST_ASSERT_EQUAL_STRING ("world", zmq_msg_gets (&msg, "X-hello")); TEST_ASSERT_EQUAL_STRING ("backup", zmq_msg_gets (&msg, "X-connection")); rc = zmq_msg_close (&msg); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (req_sock); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_close (rep_sock); TEST_ASSERT_EQUAL_INT (0, rc); zmq_ctx_term (ctx); } int main () { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_app_meta_reqrep); return UNITY_END (); } zeromq-4.2.5/tests/test_stream.cpp0000664000372000037200000002577213255253220020155 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // ZMTP protocol greeting structure typedef unsigned char byte; typedef struct { byte signature[10]; // 0xFF 8*0x00 0x7F byte version[2]; // 0x03 0x00 for ZMTP/3.0 byte mechanism[20]; // "NULL" byte as_server; byte filler[31]; } zmtp_greeting_t; #define ZMTP_DEALER 5 // Socket type constants // This is a greeting matching what 0MQ will send us; note the // 8-byte size is set to 1 for backwards compatibility static zmtp_greeting_t greeting = { {0xFF, 0, 0, 0, 0, 0, 0, 0, 1, 0x7F}, {3, 0}, {'N', 'U', 'L', 'L'}, 0, {0}}; static void test_stream_to_dealer (void) { int rc; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); // We'll be using this socket in raw mode void *stream = zmq_socket (ctx, ZMQ_STREAM); assert (stream); int zero = 0; rc = zmq_setsockopt (stream, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); int enabled = 1; rc = zmq_setsockopt (stream, ZMQ_STREAM_NOTIFY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_bind (stream, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (stream, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // We'll be using this socket as the other peer void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); rc = zmq_setsockopt (dealer, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); rc = zmq_connect (dealer, my_endpoint); // Send a message on the dealer socket rc = zmq_send (dealer, "Hello", 5, 0); assert (rc == 5); // Connecting sends a zero message // First frame is routing id zmq_msg_t routing_id; rc = zmq_msg_init (&routing_id); assert (rc == 0); rc = zmq_msg_recv (&routing_id, stream, 0); assert (rc > 0); assert (zmq_msg_more (&routing_id)); // Verify the existence of Peer-Address metadata char const *peer_address = zmq_msg_gets (&routing_id, "Peer-Address"); assert (peer_address != 0); assert (streq (peer_address, "127.0.0.1")); // Second frame is zero byte buffer[255]; rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 0); // Verify the existence of Peer-Address metadata peer_address = zmq_msg_gets (&routing_id, "Peer-Address"); assert (peer_address != 0); assert (streq (peer_address, "127.0.0.1")); // Real data follows // First frame is routing id rc = zmq_msg_recv (&routing_id, stream, 0); assert (rc > 0); assert (zmq_msg_more (&routing_id)); // Verify the existence of Peer-Address metadata peer_address = zmq_msg_gets (&routing_id, "Peer-Address"); assert (peer_address != 0); assert (streq (peer_address, "127.0.0.1")); // Second frame is greeting signature rc = zmq_recv (stream, buffer, 255, 0); assert (rc == 10); assert (memcmp (buffer, greeting.signature, 10) == 0); // Send our own protocol greeting rc = zmq_msg_send (&routing_id, stream, ZMQ_SNDMORE); assert (rc > 0); rc = zmq_send (stream, &greeting, sizeof (greeting), 0); assert (rc == sizeof (greeting)); // Now we expect the data from the DEALER socket // We want the rest of greeting along with the Ready command int bytes_read = 0; while (bytes_read < 97) { // First frame is the routing id of the connection (each time) rc = zmq_msg_recv (&routing_id, stream, 0); assert (rc > 0); assert (zmq_msg_more (&routing_id)); // Second frame contains the next chunk of data rc = zmq_recv (stream, buffer + bytes_read, 255 - bytes_read, 0); assert (rc >= 0); bytes_read += rc; } // First two bytes are major and minor version numbers. assert (buffer[0] == 3); // ZMTP/3.0 assert (buffer[1] == 0); // Mechanism is "NULL" assert (memcmp (buffer + 2, "NULL\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0); assert (memcmp (buffer + 54, "\4\51\5READY", 8) == 0); assert (memcmp (buffer + 62, "\13Socket-Type\0\0\0\6DEALER", 22) == 0); assert (memcmp (buffer + 84, "\10Identity\0\0\0\0", 13) == 0); // Announce we are ready memcpy (buffer, "\4\51\5READY", 8); memcpy (buffer + 8, "\13Socket-Type\0\0\0\6ROUTER", 22); memcpy (buffer + 30, "\10Identity\0\0\0\0", 13); // Send Ready command rc = zmq_msg_send (&routing_id, stream, ZMQ_SNDMORE); assert (rc > 0); rc = zmq_send (stream, buffer, 43, 0); assert (rc == 43); // Now we expect the data from the DEALER socket // First frame is, again, the routing id of the connection rc = zmq_msg_recv (&routing_id, stream, 0); assert (rc > 0); assert (zmq_msg_more (&routing_id)); // Third frame contains Hello message from DEALER rc = zmq_recv (stream, buffer, sizeof buffer, 0); assert (rc == 7); // Then we have a 5-byte message "Hello" assert (buffer[0] == 0); // Flags = 0 assert (buffer[1] == 5); // Size = 5 assert (memcmp (buffer + 2, "Hello", 5) == 0); // Send "World" back to DEALER rc = zmq_msg_send (&routing_id, stream, ZMQ_SNDMORE); assert (rc > 0); byte world[] = {0, 5, 'W', 'o', 'r', 'l', 'd'}; rc = zmq_send (stream, world, sizeof (world), 0); assert (rc == sizeof (world)); // Expect response on DEALER socket rc = zmq_recv (dealer, buffer, 255, 0); assert (rc == 5); assert (memcmp (buffer, "World", 5) == 0); // Test large messages over STREAM socket #define size 64000 uint8_t msgout[size]; memset (msgout, 0xAB, size); zmq_send (dealer, msgout, size, 0); uint8_t msgin[9 + size]; memset (msgin, 0, 9 + size); bytes_read = 0; while (bytes_read < 9 + size) { // Get routing id frame rc = zmq_recv (stream, buffer, 256, 0); assert (rc > 0); // Get next chunk rc = zmq_recv (stream, msgin + bytes_read, 9 + size - bytes_read, 0); assert (rc > 0); bytes_read += rc; } int byte_nbr; for (byte_nbr = 0; byte_nbr < size; byte_nbr++) { if (msgin[9 + byte_nbr] != 0xAB) assert (false); } rc = zmq_close (dealer); assert (rc == 0); rc = zmq_close (stream); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } static void test_stream_to_stream (void) { int rc; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Set-up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); void *server = zmq_socket (ctx, ZMQ_STREAM); assert (server); int enabled = 1; rc = zmq_setsockopt (server, ZMQ_STREAM_NOTIFY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); void *client = zmq_socket (ctx, ZMQ_STREAM); assert (client); rc = zmq_setsockopt (client, ZMQ_STREAM_NOTIFY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); uint8_t id[256]; size_t id_size = 256; uint8_t buffer[256]; // Connecting sends a zero message // Server: First frame is routing id, second frame is zero id_size = zmq_recv (server, id, 256, 0); assert (id_size > 0); rc = zmq_recv (server, buffer, 256, 0); assert (rc == 0); // Client: First frame is routing id, second frame is zero id_size = zmq_recv (client, id, 256, 0); assert (id_size > 0); rc = zmq_recv (client, buffer, 256, 0); assert (rc == 0); // Sent HTTP request on client socket // Get server routing id rc = zmq_getsockopt (client, ZMQ_ROUTING_ID, id, &id_size); assert (rc == 0); // First frame is server routing id rc = zmq_send (client, id, id_size, ZMQ_SNDMORE); assert (rc == (int) id_size); // Second frame is HTTP GET request rc = zmq_send (client, "GET /\n\n", 7, 0); assert (rc == 7); // Get HTTP request; ID frame and then request id_size = zmq_recv (server, id, 256, 0); assert (id_size > 0); rc = zmq_recv (server, buffer, 256, 0); assert (rc != -1); assert (memcmp (buffer, "GET /\n\n", 7) == 0); // Send reply back to client char http_response[] = "HTTP/1.0 200 OK\r\n" "Content-Type: text/plain\r\n" "\r\n" "Hello, World!"; rc = zmq_send (server, id, id_size, ZMQ_SNDMORE); assert (rc != -1); rc = zmq_send (server, http_response, sizeof (http_response), ZMQ_SNDMORE); assert (rc != -1); // Send zero to close connection to client rc = zmq_send (server, id, id_size, ZMQ_SNDMORE); assert (rc != -1); rc = zmq_send (server, NULL, 0, ZMQ_SNDMORE); assert (rc != -1); // Get reply at client and check that it's complete id_size = zmq_recv (client, id, 256, 0); assert (id_size > 0); rc = zmq_recv (client, buffer, 256, 0); assert (rc == sizeof (http_response)); assert (memcmp (buffer, http_response, sizeof (http_response)) == 0); // // Get disconnection notification // FIXME: why does this block? Bug in STREAM disconnect notification? // id_size = zmq_recv (client, id, 256, 0); // assert (id_size > 0); // rc = zmq_recv (client, buffer, 256, 0); // assert (rc == 0); rc = zmq_close (server); assert (rc == 0); rc = zmq_close (client); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_stream_to_dealer (); test_stream_to_stream (); } zeromq-4.2.5/tests/test_router_handover.cpp0000664000372000037200000000760713255253220022065 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_x () { size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *router = test_context_socket (ZMQ_ROUTER); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (router, "tcp://127.0.0.1:*")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); // Enable the handover flag int handover = 1; TEST_ASSERT_SUCCESS_ERRNO (zmq_setsockopt (router, ZMQ_ROUTER_HANDOVER, &handover, sizeof (handover))); // Create dealer called "X" and connect it to our router void *dealer_one = test_context_socket (ZMQ_DEALER); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer_one, ZMQ_ROUTING_ID, "X", 1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer_one, my_endpoint)); // Get message from dealer to know when connection is ready char buffer[255]; send_string_expect_success (dealer_one, "Hello", 0); recv_string_expect_success (router, "X", 0); recv_string_expect_success (router, "Hello", 0); // Now create a second dealer that uses the same routing id void *dealer_two = test_context_socket (ZMQ_DEALER); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (dealer_two, ZMQ_ROUTING_ID, "X", 1)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (dealer_two, my_endpoint)); // Get message from dealer to know when connection is ready send_string_expect_success (dealer_two, "Hello", 0); recv_string_expect_success (router, "X", 0); recv_string_expect_success (router, "Hello", 0); // Send a message to 'X' routing id. This should be delivered // to the second dealer, instead of the first beccause of the handover. send_string_expect_success (router, "X", ZMQ_SNDMORE); send_string_expect_success (router, "Hello", 0); // Ensure that the first dealer doesn't receive the message // but the second one does int rc = zmq_recv (dealer_one, buffer, 255, ZMQ_NOBLOCK); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EAGAIN, errno); recv_string_expect_success (dealer_two, "Hello", 0); test_context_socket_close (router); test_context_socket_close (dealer_one); test_context_socket_close (dealer_two); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_x); return UNITY_END (); } zeromq-4.2.5/tests/test_security_null.cpp0000664000372000037200000002053713255253220021555 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket #else #include #include #include #include #endif static void zap_handler (void *handler) { // Process ZAP requests forever while (true) { char *version = s_recv (handler); if (!version) break; // Terminating char *sequence = s_recv (handler); char *domain = s_recv (handler); char *address = s_recv (handler); char *routing_id = s_recv (handler); char *mechanism = s_recv (handler); assert (streq (version, "1.0")); assert (streq (mechanism, "NULL")); s_sendmore (handler, version); s_sendmore (handler, sequence); if (streq (domain, "TEST")) { s_sendmore (handler, "200"); s_sendmore (handler, "OK"); s_sendmore (handler, "anonymous"); s_send (handler, ""); } else { s_sendmore (handler, "400"); s_sendmore (handler, "BAD DOMAIN"); s_sendmore (handler, ""); s_send (handler, ""); } free (version); free (sequence); free (domain); free (address); free (routing_id); free (mechanism); } close_zero_linger (handler); } int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // We first test client/server with a ZAP domain but with no handler // If there is no handler, libzmq should ignore the ZAP option unless // ZMQ_ZAP_ENFORCE_DOMAIN is set void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "TEST", 5); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); bounce (server, client); close_zero_linger (client); close_zero_linger (server); #ifdef ZMQ_ZAP_ENFORCE_DOMAIN // Now set ZMQ_ZAP_ENFORCE_DOMAIN which strictly enforces the ZAP // RFC but is backward-incompatible, now it should fail server = zmq_socket (ctx, ZMQ_DEALER); assert (server); client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int required = 1; rc = zmq_setsockopt (server, ZMQ_ZAP_ENFORCE_DOMAIN, &required, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "TEST", 5); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); close_zero_linger (server); #endif // Spawn ZAP handler // We create and bind ZAP socket in main thread to avoid case // where child thread does not start up fast enough. void *handler = zmq_socket (ctx, ZMQ_REP); assert (handler); rc = zmq_bind (handler, "inproc://zeromq.zap.01"); assert (rc == 0); void *zap_thread = zmq_threadstart (&zap_handler, handler); // We bounce between a binding server and a connecting client // We first test client/server with no ZAP domain // Libzmq does not call our ZAP handler, the connect must succeed server = zmq_socket (ctx, ZMQ_DEALER); assert (server); client = zmq_socket (ctx, ZMQ_DEALER); assert (client); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); bounce (server, client); close_zero_linger (client); close_zero_linger (server); // Now define a ZAP domain for the server; this enables // authentication. We're using the wrong domain so this test // must fail. server = zmq_socket (ctx, ZMQ_DEALER); assert (server); client = zmq_socket (ctx, ZMQ_DEALER); assert (client); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "WRONG", 5); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); close_zero_linger (server); // Now use the right domain, the test must pass server = zmq_socket (ctx, ZMQ_DEALER); assert (server); client = zmq_socket (ctx, ZMQ_DEALER); assert (client); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "TEST", 4); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); bounce (server, client); close_zero_linger (client); close_zero_linger (server); // Unauthenticated messages from a vanilla socket shouldn't be received server = zmq_socket (ctx, ZMQ_DEALER); assert (server); rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, "WRONG", 5); assert (rc == 0); rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); len = MAX_SOCKET_STRING; rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); struct sockaddr_in ip4addr; int s; unsigned short int port; rc = sscanf (my_endpoint, "tcp://127.0.0.1:%hu", &port); assert (rc == 1); ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons (port); #if defined(ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600) ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1"); #else inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #endif s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); rc = connect (s, (struct sockaddr *) &ip4addr, sizeof ip4addr); assert (rc > -1); // send anonymous ZMTP/1.0 greeting send (s, "\x01\x00", 2, 0); // send sneaky message that shouldn't be received send (s, "\x08\x00sneaky\0", 9, 0); int timeout = 250; zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); char *buf = s_recv (server); if (buf != NULL) { printf ("Received unauthenticated message: %s\n", buf); assert (buf == NULL); } close (s); close_zero_linger (server); // Shutdown rc = zmq_ctx_term (ctx); assert (rc == 0); // Wait until ZAP handler terminates zmq_threadclose (zap_thread); return 0; } zeromq-4.2.5/tests/test_scatter_gather.cpp0000664000372000037200000000510213255253220021642 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *scatter = zmq_socket (ctx, ZMQ_SCATTER); void *gather = zmq_socket (ctx, ZMQ_GATHER); void *gather2 = zmq_socket (ctx, ZMQ_GATHER); int rc = zmq_bind (scatter, "inproc://test-scatter-gather"); assert (rc == 0); rc = zmq_connect (gather, "inproc://test-scatter-gather"); assert (rc == 0); rc = zmq_connect (gather2, "inproc://test-scatter-gather"); assert (rc == 0); // Should fail, multipart is not supported rc = s_sendmore (scatter, "1"); assert (rc == -1); rc = s_send (scatter, "1"); assert (rc == 1); rc = s_send (scatter, "2"); assert (rc == 1); char *message = s_recv (gather); assert (message); assert (streq (message, "1")); free (message); message = s_recv (gather2); assert (message); assert (streq (message, "2")); free (message); rc = zmq_close (scatter); assert (rc == 0); rc = zmq_close (gather); assert (rc == 0); rc = zmq_close (gather2); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/CMakeLists.txt0000664000372000037200000001562113255253220017647 0ustar00travistravis00000000000000# CMake build script for ZeroMQ tests cmake_minimum_required(VERSION "2.8.1") # On Windows: solution file will be called tests.sln PROJECT(tests) set(tests test_ancillaries test_system test_pair_inproc test_pair_tcp test_reqrep_inproc test_reqrep_tcp test_hwm test_hwm_pubsub test_reqrep_device test_sub_forward test_invalid_rep test_msg_flags test_msg_ffn test_connect_resolve test_immediate test_last_endpoint test_term_endpoint test_router_mandatory test_probe_router test_stream test_stream_empty test_stream_disconnect test_disconnect_inproc test_unbind_inproc test_unbind_wildcard test_ctx_options test_ctx_destroy test_security_null test_security_plain test_security_zap test_iov test_spec_req test_spec_rep test_spec_dealer test_spec_router test_spec_pushpull test_req_correlate test_req_relaxed test_conflate test_inproc_connect test_issue_566 test_shutdown_stress test_timeo test_many_sockets test_diffserv test_connect_rid test_xpub_nodrop test_pub_invert_matching test_setsockopt test_sockopt_hwm test_heartbeats test_atomics test_bind_src_address test_capabilities test_metadata test_router_handover test_srcfd test_stream_timeout test_xpub_manual test_xpub_welcome_msg test_xpub_verbose test_base85 test_bind_after_connect_tcp test_sodium test_monitor test_socket_null test_reconnect_ivl ) if(ZMQ_HAVE_CURVE) list(APPEND tests test_security_curve) endif() if(NOT WIN32) list(APPEND tests test_ipc_wildcard test_pair_ipc test_rebind_ipc test_reqrep_ipc test_proxy test_proxy_single_socket test_proxy_terminate test_getsockopt_memset test_filter_ipc test_stream_exceeds_buffer test_router_mandatory_hwm test_use_fd_ipc test_use_fd_tcp test_zmq_poll_fd ) if(HAVE_FORK) list(APPEND tests test_fork) endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") list(APPEND tests test_abstract_ipc ) if(ZMQ_HAVE_TIPC) list(APPEND tests test_address_tipc test_pair_tipc test_reqrep_device_tipc test_reqrep_tipc test_router_mandatory_tipc test_sub_forward_tipc test_connect_delay_tipc test_shutdown_stress_tipc test_term_endpoint_tipc ) endif() endif() endif() if(WITH_VMCI) list(APPEND tests test_pair_vmci test_reqrep_vmci ) endif() IF (ENABLE_DRAFTS) list(APPEND tests test_poller test_thread_safe test_client_server test_timers test_radio_dish test_scatter_gather test_dgram test_app_meta ) ENDIF (ENABLE_DRAFTS) # add location of platform.hpp for Windows builds if(WIN32) add_definitions(-DZMQ_CUSTOM_PLATFORM_HPP) add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) # Same name on 64bit systems link_libraries(ws2_32.lib) endif() add_library (unity STATIC "${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c" "${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.h" "${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity_internals.h") set_target_properties (unity PROPERTIES PUBLIC_HEADER "${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.h") target_compile_definitions (unity PUBLIC "UNITY_USE_COMMAND_LINE_ARGS" "UNITY_EXCLUDE_FLOAT") target_include_directories (unity PUBLIC "${CMAKE_CURRENT_LIST_DIR}/../external/unity") IF (MSVC_VERSION LESS 1700) SET_SOURCE_FILES_PROPERTIES("${CMAKE_CURRENT_LIST_DIR}/../external/unity/unity.c" PROPERTIES LANGUAGE CXX) ENDIF() # add library and include dirs for all targets if (BUILD_SHARED) link_libraries(libzmq ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} unity) else () link_libraries(libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} unity) endif () include_directories("${CMAKE_SOURCE_DIR}/../include" "${CMAKE_BINARY_DIR}") foreach(test ${tests}) # target_sources not supported before CMake 3.1 if (ZMQ_HAVE_CURVE AND ${test} MATCHES test_security_curve) add_executable(${test} ${test}.cpp "../src/tweetnacl.c" "../src/err.cpp" "../src/random.cpp" "../src/clock.cpp" "testutil_security.hpp") elseif (${test} MATCHES test_security_zap) add_executable(${test} ${test}.cpp "testutil_security.hpp") else () add_executable(${test} ${test}.cpp "testutil.hpp" "testutil_unity.hpp") endif () if(WIN32) # This is the output for Debug dynamic builds on Visual Studio 6.0 # You should provide the correct directory, don't know how to do it automatically find_path(LIBZMQ_PATH "libzmq.lib" PATHS "../bin/Win32/Debug/v120/dynamic") if(NOT ${LIBZMQ_PATH} STREQUAL "LIBZMQ_PATH-NOTFOUND") SET_TARGET_PROPERTIES( ${test} PROPERTIES LINK_FLAGS "/LIBPATH:${LIBZMQ_PATH}" ) endif() else() # per-test directories not generated on OS X / Darwin if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang.*") link_directories(${test} PRIVATE "${CMAKE_SOURCE_DIR}/../lib") endif() endif() if(RT_LIBRARY) target_link_libraries(${test} ${RT_LIBRARY} ) endif() if(WIN32) add_test(NAME ${test} WORKING_DIRECTORY ${LIBRARY_OUTPUT_PATH} COMMAND ${test}) else() add_test(NAME ${test} COMMAND ${test}) endif() set_tests_properties(${test} PROPERTIES TIMEOUT 10) set_tests_properties(${test} PROPERTIES SKIP_RETURN_CODE 77) endforeach() #override timeout for these tests if(ZMQ_HAVE_CURVE) set_tests_properties(test_security_curve PROPERTIES TIMEOUT 60) endif() if(WIN32 AND ${POLLER} MATCHES "poll") set_tests_properties(test_many_sockets PROPERTIES TIMEOUT 30) set_tests_properties(test_immediate PROPERTIES TIMEOUT 30) endif() #add additional required flags #ZMQ_USE_TWEETNACL will already be defined when not using sodium if(ZMQ_HAVE_CURVE AND NOT ZMQ_USE_TWEETNACL) target_compile_definitions(test_security_curve PRIVATE "-DZMQ_USE_TWEETNACL") endif() set_tests_properties(test_security_zap PROPERTIES TIMEOUT 60) #Check whether all tests in the current folder are present file(READ "${CMAKE_CURRENT_LIST_FILE}" CURRENT_LIST_FILE_CONTENT) file(GLOB ALL_TEST_SOURCES "test_*.cpp") foreach(TEST_SOURCE ${ALL_TEST_SOURCES}) get_filename_component(TESTNAME "${TEST_SOURCE}" NAME_WE) string(REGEX MATCH "${TESTNAME}" MATCH_TESTNAME "${CURRENT_LIST_FILE_CONTENT}") if (NOT MATCH_TESTNAME) message(AUTHOR_WARNING "Test '${TESTNAME}' is not known to CTest.") endif() endforeach() zeromq-4.2.5/tests/test_atomics.cpp0000664000372000037200000000412613255253220020307 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { void *counter = zmq_atomic_counter_new (); assert (zmq_atomic_counter_value (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 0); assert (zmq_atomic_counter_inc (counter) == 1); assert (zmq_atomic_counter_inc (counter) == 2); assert (zmq_atomic_counter_value (counter) == 3); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_set (counter, 2); assert (zmq_atomic_counter_dec (counter) == 1); assert (zmq_atomic_counter_dec (counter) == 0); zmq_atomic_counter_destroy (&counter); return 0; } zeromq-4.2.5/tests/test_stream_disconnect.cpp0000664000372000037200000002452113255253220022355 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static const int SERVER = 0; static const int CLIENT = 1; struct test_message_t { int turn; const char *text; }; // NOTE: messages are sent without null terminator. const test_message_t dialog[] = { {CLIENT, "i can haz cheez burger?"}, {SERVER, "y u no disonnect?"}, {CLIENT, ""}, }; const int steps = sizeof (dialog) / sizeof (dialog[0]); bool has_more (void *socket) { int more = 0; size_t more_size = sizeof (more); int rc = zmq_getsockopt (socket, ZMQ_RCVMORE, &more, &more_size); if (rc != 0) return false; return more != 0; } bool get_routing_id (void *socket, char *data, size_t *size) { int rc = zmq_getsockopt (socket, ZMQ_ROUTING_ID, data, size); return rc == 0; } int main (int, char **) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char bind_endpoint[MAX_SOCKET_STRING]; char connect_endpoint[MAX_SOCKET_STRING]; void *context = zmq_ctx_new (); void *sockets[2]; int rc = 0; sockets[SERVER] = zmq_socket (context, ZMQ_STREAM); int enabled = 1; rc = zmq_setsockopt (sockets[SERVER], ZMQ_STREAM_NOTIFY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_bind (sockets[SERVER], "tcp://0.0.0.0:*"); assert (rc == 0); rc = zmq_getsockopt (sockets[SERVER], ZMQ_LAST_ENDPOINT, bind_endpoint, &len); assert (rc == 0); // Apparently Windows can't connect to 0.0.0.0. A better fix would be welcome. #ifdef ZMQ_HAVE_WINDOWS sprintf (connect_endpoint, "tcp://127.0.0.1:%s", strrchr (bind_endpoint, ':') + 1); #else strcpy (connect_endpoint, bind_endpoint); #endif sockets[CLIENT] = zmq_socket (context, ZMQ_STREAM); rc = zmq_setsockopt (sockets[CLIENT], ZMQ_STREAM_NOTIFY, &enabled, sizeof (enabled)); assert (rc == 0); rc = zmq_connect (sockets[CLIENT], connect_endpoint); assert (rc == 0); // wait for connect notification // Server: Grab the 1st frame (peer routing id). zmq_msg_t peer_frame; rc = zmq_msg_init (&peer_frame); assert (rc == 0); rc = zmq_msg_recv (&peer_frame, sockets[SERVER], 0); assert (rc != -1); assert (zmq_msg_size (&peer_frame) > 0); assert (has_more (sockets[SERVER])); rc = zmq_msg_close (&peer_frame); assert (rc == 0); // Server: Grab the 2nd frame (actual payload). zmq_msg_t data_frame; rc = zmq_msg_init (&data_frame); assert (rc == 0); rc = zmq_msg_recv (&data_frame, sockets[SERVER], 0); assert (rc != -1); assert (zmq_msg_size (&data_frame) == 0); rc = zmq_msg_close (&data_frame); assert (rc == 0); // Client: Grab the 1st frame (peer routing id). rc = zmq_msg_init (&peer_frame); assert (rc == 0); rc = zmq_msg_recv (&peer_frame, sockets[CLIENT], 0); assert (rc != -1); assert (zmq_msg_size (&peer_frame) > 0); assert (has_more (sockets[CLIENT])); rc = zmq_msg_close (&peer_frame); assert (rc == 0); // Client: Grab the 2nd frame (actual payload). rc = zmq_msg_init (&data_frame); assert (rc == 0); rc = zmq_msg_recv (&data_frame, sockets[CLIENT], 0); assert (rc != -1); assert (zmq_msg_size (&data_frame) == 0); rc = zmq_msg_close (&data_frame); assert (rc == 0); // Send initial message. char blob_data[256]; size_t blob_size = sizeof (blob_data); rc = zmq_getsockopt (sockets[CLIENT], ZMQ_ROUTING_ID, blob_data, &blob_size); assert (rc != -1); assert (blob_size > 0); zmq_msg_t msg; rc = zmq_msg_init_size (&msg, blob_size); assert (rc == 0); memcpy (zmq_msg_data (&msg), blob_data, blob_size); rc = zmq_msg_send (&msg, sockets[dialog[0].turn], ZMQ_SNDMORE); assert (rc != -1); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_msg_init_size (&msg, strlen (dialog[0].text)); assert (rc == 0); memcpy (zmq_msg_data (&msg), dialog[0].text, strlen (dialog[0].text)); rc = zmq_msg_send (&msg, sockets[dialog[0].turn], ZMQ_SNDMORE); assert (rc != -1); rc = zmq_msg_close (&msg); assert (rc == 0); // TODO: make sure this loop doesn't loop forever if something is wrong // with the test (or the implementation). int step = 0; while (step < steps) { // Wait until something happens. zmq_pollitem_t items[] = { {sockets[SERVER], 0, ZMQ_POLLIN, 0}, {sockets[CLIENT], 0, ZMQ_POLLIN, 0}, }; int rc = zmq_poll (items, 2, 100); assert (rc >= 0); // Check for data received by the server. if (items[SERVER].revents & ZMQ_POLLIN) { assert (dialog[step].turn == CLIENT); // Grab the 1st frame (peer routing id). zmq_msg_t peer_frame; rc = zmq_msg_init (&peer_frame); assert (rc == 0); rc = zmq_msg_recv (&peer_frame, sockets[SERVER], 0); assert (rc != -1); assert (zmq_msg_size (&peer_frame) > 0); assert (has_more (sockets[SERVER])); // Grab the 2nd frame (actual payload). zmq_msg_t data_frame; rc = zmq_msg_init (&data_frame); assert (rc == 0); rc = zmq_msg_recv (&data_frame, sockets[SERVER], 0); assert (rc != -1); // Make sure payload matches what we expect. const char *const data = (const char *) zmq_msg_data (&data_frame); const int size = zmq_msg_size (&data_frame); // 0-length frame is a disconnection notification. The server // should receive it as the last step in the dialogue. if (size == 0) { ++step; assert (step == steps); } else { assert ((size_t) size == strlen (dialog[step].text)); int cmp = memcmp (dialog[step].text, data, size); assert (cmp == 0); ++step; assert (step < steps); // Prepare the response. rc = zmq_msg_close (&data_frame); assert (rc == 0); rc = zmq_msg_init_size (&data_frame, strlen (dialog[step].text)); assert (rc == 0); memcpy (zmq_msg_data (&data_frame), dialog[step].text, zmq_msg_size (&data_frame)); // Send the response. rc = zmq_msg_send (&peer_frame, sockets[SERVER], ZMQ_SNDMORE); assert (rc != -1); rc = zmq_msg_send (&data_frame, sockets[SERVER], ZMQ_SNDMORE); assert (rc != -1); } // Release resources. rc = zmq_msg_close (&peer_frame); assert (rc == 0); rc = zmq_msg_close (&data_frame); assert (rc == 0); } // Check for data received by the client. if (items[CLIENT].revents & ZMQ_POLLIN) { assert (dialog[step].turn == SERVER); // Grab the 1st frame (peer routing id). zmq_msg_t peer_frame; rc = zmq_msg_init (&peer_frame); assert (rc == 0); rc = zmq_msg_recv (&peer_frame, sockets[CLIENT], 0); assert (rc != -1); assert (zmq_msg_size (&peer_frame) > 0); assert (has_more (sockets[CLIENT])); // Grab the 2nd frame (actual payload). zmq_msg_t data_frame; rc = zmq_msg_init (&data_frame); assert (rc == 0); rc = zmq_msg_recv (&data_frame, sockets[CLIENT], 0); assert (rc != -1); assert (zmq_msg_size (&data_frame) > 0); // Make sure payload matches what we expect. const char *const data = (const char *) zmq_msg_data (&data_frame); const int size = zmq_msg_size (&data_frame); assert ((size_t) size == strlen (dialog[step].text)); int cmp = memcmp (dialog[step].text, data, size); assert (cmp == 0); ++step; // Prepare the response (next line in the dialog). assert (step < steps); rc = zmq_msg_close (&data_frame); assert (rc == 0); rc = zmq_msg_init_size (&data_frame, strlen (dialog[step].text)); assert (rc == 0); memcpy (zmq_msg_data (&data_frame), dialog[step].text, zmq_msg_size (&data_frame)); // Send the response. rc = zmq_msg_send (&peer_frame, sockets[CLIENT], ZMQ_SNDMORE); assert (rc != -1); rc = zmq_msg_send (&data_frame, sockets[CLIENT], ZMQ_SNDMORE); assert (rc != -1); // Release resources. rc = zmq_msg_close (&peer_frame); assert (rc == 0); rc = zmq_msg_close (&data_frame); assert (rc == 0); } } assert (step == steps); rc = zmq_close (sockets[CLIENT]); assert (rc == 0); rc = zmq_close (sockets[SERVER]); assert (rc == 0); rc = zmq_ctx_term (context); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_connect_resolve.cpp0000664000372000037200000000560013255253220022036 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void *sock; void setUp () { setup_test_context (); sock = test_context_socket (ZMQ_PUB); } void tearDown () { test_context_socket_close (sock); sock = NULL; teardown_test_context (); } void test_hostname_ipv4 () { TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sock, "tcp://localhost:1234")); } void test_loopback_ipv6 () { TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sock, "tcp://[::1]:1234")); } void test_invalid_service_fails () { int rc = zmq_connect (sock, "tcp://localhost:invalid"); TEST_ASSERT_EQUAL_INT (-1, rc); } void test_hostname_with_spaces_fails () { int rc = zmq_connect (sock, "tcp://in val id:1234"); TEST_ASSERT_EQUAL_INT (-1, rc); } void test_no_hostname_fails () { int rc = zmq_connect (sock, "tcp://"); TEST_ASSERT_EQUAL_INT (-1, rc); } void test_x () { int rc = zmq_connect (sock, "tcp://192.168.0.200:*"); TEST_ASSERT_EQUAL_INT (-1, rc); } void test_invalid_proto_fails () { int rc = zmq_connect (sock, "invalid://localhost:1234"); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EPROTONOSUPPORT, errno); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_hostname_ipv4); RUN_TEST (test_loopback_ipv6); RUN_TEST (test_hostname_with_spaces_fails); RUN_TEST (test_no_hostname_fails); RUN_TEST (test_invalid_service_fails); RUN_TEST (test_invalid_proto_fails); return UNITY_END (); } zeromq-4.2.5/tests/test_pair_ipc.cpp0000664000372000037200000000373013255253220020436 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); int rc = zmq_bind (sb, "ipc:///tmp/test_pair_ipc"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, "ipc:///tmp/test_pair_ipc"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_capabilities.cpp0000664000372000037200000000447413255253220021307 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { #if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_OPENVMS) assert (zmq_has ("ipc")); #else assert (!zmq_has ("ipc")); #endif #if defined(ZMQ_HAVE_OPENPGM) assert (zmq_has ("pgm")); #else assert (!zmq_has ("pgm")); #endif #if defined(ZMQ_HAVE_TIPC) assert (zmq_has ("tipc")); #else assert (!zmq_has ("tipc")); #endif #if defined(ZMQ_HAVE_NORM) assert (zmq_has ("norm")); #else assert (!zmq_has ("norm")); #endif #if defined(ZMQ_HAVE_CURVE) assert (zmq_has ("curve")); #else assert (!zmq_has ("curve")); #endif #if defined(HAVE_LIBGSSAPI_KRB5) assert (zmq_has ("gssapi")); #else assert (!zmq_has ("gssapi")); #endif #if defined(ZMQ_HAVE_VMCI) assert (zmq_has ("vmci")); #else assert (!zmq_has ("vmci")); #endif #if defined(ZMQ_BUILD_DRAFT_API) assert (zmq_has ("draft")); #else assert (!zmq_has ("draft")); #endif return 0; } zeromq-4.2.5/tests/test_client_server.cpp0000664000372000037200000001007413255253220021513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void create_inproc_client_server_pair (void **server, void **client) { *server = test_context_socket (ZMQ_SERVER); *client = test_context_socket (ZMQ_CLIENT); TEST_ASSERT_SUCCESS_ERRNO ( zmq_bind (*server, "inproc://test-client-server")); TEST_ASSERT_SUCCESS_ERRNO ( zmq_connect (*client, "inproc://test-client-server")); } void send_sndmore_expect_failure (void *socket) { int rc = zmq_send (socket, "X", 1, ZMQ_SNDMORE); TEST_ASSERT_EQUAL_INT (-1, rc); TEST_ASSERT_EQUAL_INT (EINVAL, errno); } void test_client_sndmore_fails () { void *server, *client; create_inproc_client_server_pair (&server, &client); send_sndmore_expect_failure (client); test_context_socket_close (server); test_context_socket_close (client); } void test_server_sndmore_fails () { void *server, *client; create_inproc_client_server_pair (&server, &client); send_sndmore_expect_failure (server); test_context_socket_close (server); test_context_socket_close (client); } void test_routing_id () { void *server, *client; create_inproc_client_server_pair (&server, &client); send_string_expect_success (client, "X", 0); uint32_t routing_id; { zmq_msg_t msg; TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_init (&msg)); int rc = TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_recv (&msg, server, 0)); TEST_ASSERT_EQUAL_INT (1, rc); routing_id = zmq_msg_routing_id (&msg); TEST_ASSERT_NOT_EQUAL (0, routing_id); TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_close (&msg)); } { zmq_msg_t msg; TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_init_size (&msg, 1)); char *data = (char *) zmq_msg_data (&msg); data[0] = 2; TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_set_routing_id (&msg, routing_id)); int rc = zmq_msg_send (&msg, server, 0); TEST_ASSERT_EQUAL_INT (1, rc); } { zmq_msg_t msg; TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_init (&msg)); int rc = zmq_msg_recv (&msg, client, 0); TEST_ASSERT_EQUAL_INT (1, rc); routing_id = zmq_msg_routing_id (&msg); TEST_ASSERT_EQUAL_UINT32 (0, routing_id); TEST_ASSERT_SUCCESS_ERRNO (zmq_msg_close (&msg)); } test_context_socket_close (server); test_context_socket_close (client); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_client_sndmore_fails); RUN_TEST (test_server_sndmore_fails); RUN_TEST (test_routing_id); return UNITY_END (); } zeromq-4.2.5/tests/test_reqrep_device_tipc.cpp0000664000372000037200000001132113255253220022477 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } fprintf (stderr, "test_reqrep_device_tipc running...\n"); void *ctx = zmq_init (1); assert (ctx); // Create a req/rep device. void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); int rc = zmq_bind (dealer, "tipc://{5560,0,0}"); assert (rc == 0); void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); rc = zmq_bind (router, "tipc://{5561,0,0}"); assert (rc == 0); // Create a worker. void *rep = zmq_socket (ctx, ZMQ_REP); assert (rep); rc = zmq_connect (rep, "tipc://{5560,0}@0.0.0"); assert (rc == 0); // Create a client. void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); rc = zmq_connect (req, "tipc://{5561,0}@0.0.0"); assert (rc == 0); // Send a request. rc = zmq_send (req, "ABC", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (req, "DEF", 3, 0); assert (rc == 3); // Pass the request through the device. for (int i = 0; i != 4; i++) { zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_recvmsg (router, &msg, 0); assert (rc >= 0); int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (router, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); rc = zmq_sendmsg (dealer, &msg, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } // Receive the request. char buff[3]; rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "ABC", 3) == 0); int rcvmore; size_t sz = sizeof (rcvmore); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (rep, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "DEF", 3) == 0); rc = zmq_getsockopt (rep, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); // Send the reply. rc = zmq_send (rep, "GHI", 3, ZMQ_SNDMORE); assert (rc == 3); rc = zmq_send (rep, "JKL", 3, 0); assert (rc == 3); // Pass the reply through the device. for (int i = 0; i != 4; i++) { zmq_msg_t msg; rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_recvmsg (dealer, &msg, 0); assert (rc >= 0); int rcvmore; rc = zmq_getsockopt (dealer, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); rc = zmq_sendmsg (router, &msg, rcvmore ? ZMQ_SNDMORE : 0); assert (rc >= 0); } // Receive the reply. rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "GHI", 3) == 0); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (rcvmore); rc = zmq_recv (req, buff, 3, 0); assert (rc == 3); assert (memcmp (buff, "JKL", 3) == 0); rc = zmq_getsockopt (req, ZMQ_RCVMORE, &rcvmore, &sz); assert (rc == 0); assert (!rcvmore); // Clean up. rc = zmq_close (req); assert (rc == 0); rc = zmq_close (rep); assert (rc == 0); rc = zmq_close (router); assert (rc == 0); rc = zmq_close (dealer); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_heartbeats.cpp0000664000372000037200000002423213255253220020772 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of 0MQ. 0MQ is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 0MQ is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket typedef SOCKET raw_socket; #else #include typedef int raw_socket; #endif // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. static int get_monitor_event (void *monitor) { for (int i = 0; i < 2; i++) { // First frame in message contains event number and value zmq_msg_t msg; int rc = zmq_msg_init (&msg); assert (rc == 0); if (zmq_msg_recv (&msg, monitor, ZMQ_DONTWAIT) == -1) { msleep (SETTLE_TIME); continue; // Interruped, presumably } assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); // Second frame in message contains event address rc = zmq_msg_init (&msg); assert (rc == 0); if (zmq_msg_recv (&msg, monitor, 0) == -1) { return -1; // Interruped, presumably } assert (!zmq_msg_more (&msg)); return event; } return -1; } static void recv_with_retry (raw_socket fd, char *buffer, int bytes) { int received = 0; while (true) { int rc = recv (fd, buffer + received, bytes - received, 0); assert (rc > 0); received += rc; assert (received <= bytes); if (received == bytes) break; } } static void mock_handshake (raw_socket fd) { const uint8_t zmtp_greeting[33] = {0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0x7f, 3, 0, 'N', 'U', 'L', 'L', 0}; char buffer[128]; memset (buffer, 0, sizeof (buffer)); memcpy (buffer, zmtp_greeting, sizeof (zmtp_greeting)); int rc = send (fd, buffer, 64, 0); assert (rc == 64); recv_with_retry (fd, buffer, 64); const uint8_t zmtp_ready[43] = { 4, 41, 5, 'R', 'E', 'A', 'D', 'Y', 11, 'S', 'o', 'c', 'k', 'e', 't', '-', 'T', 'y', 'p', 'e', 0, 0, 0, 6, 'D', 'E', 'A', 'L', 'E', 'R', 8, 'I', 'd', 'e', 'n', 't', 'i', 't', 'y', 0, 0, 0, 0}; memset (buffer, 0, sizeof (buffer)); memcpy (buffer, zmtp_ready, 43); rc = send (fd, buffer, 43, 0); assert (rc == 43); recv_with_retry (fd, buffer, 43); } static void setup_curve (void *socket, int is_server) { const char *secret_key; const char *public_key; const char *server_key; if (is_server) { secret_key = "JTKVSB%%)wK0E.X)V>+}o?pNmC{O&4W4b!Ni{Lh6"; public_key = "rq:rM>}U?@Lns47E1%kR.o@n%FcmmsL/@{H8]yf7"; server_key = NULL; } else { secret_key = "D:)Q[IlAW!ahhC2ac:9*A}h:p?([4%wOTJ%JR%cs"; public_key = "Yne@$w-vo -1); // Mock a ZMTP 3 client so we can forcibly time out a connection mock_handshake (s); // By now everything should report as connected rc = get_monitor_event (server_mon); assert (rc == ZMQ_EVENT_ACCEPTED); // We should have been disconnected rc = get_monitor_event (server_mon); assert (rc == ZMQ_EVENT_DISCONNECTED); close (s); rc = zmq_close (server); assert (rc == 0); rc = zmq_close (server_mon); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } // This checks that peers respect the TTL value in ping messages // We set up a mock ZMTP 3 client and send a ping message with a TLL // to a server that is not doing any heartbeating. Then we sleep, // if the server disconnects the client, then we know the TTL did // its thing correctly. static void test_heartbeat_ttl (void) { int rc, value; char my_endpoint[MAX_SOCKET_STRING]; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); void *server, *server_mon, *client; prep_server_socket (ctx, 0, 0, &server, &server_mon, my_endpoint, MAX_SOCKET_STRING); client = zmq_socket (ctx, ZMQ_DEALER); assert (client != NULL); // Set the heartbeat TTL to 0.1 seconds value = 100; rc = zmq_setsockopt (client, ZMQ_HEARTBEAT_TTL, &value, sizeof (value)); assert (rc == 0); // Set the heartbeat interval to much longer than the TTL so that // the socket times out oon the remote side. value = 250; rc = zmq_setsockopt (client, ZMQ_HEARTBEAT_IVL, &value, sizeof (value)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); // By now everything should report as connected rc = get_monitor_event (server_mon); assert (rc == ZMQ_EVENT_ACCEPTED); msleep (SETTLE_TIME); // We should have been disconnected rc = get_monitor_event (server_mon); assert (rc == ZMQ_EVENT_DISCONNECTED); rc = zmq_close (server); assert (rc == 0); rc = zmq_close (server_mon); assert (rc == 0); rc = zmq_close (client); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } // This checks for normal operation - that is pings and pongs being // exchanged normally. There should be an accepted event on the server, // and then no event afterwards. static void test_heartbeat_notimeout (int is_curve) { int rc; char my_endpoint[MAX_SOCKET_STRING]; // Set up our context and sockets void *ctx = zmq_ctx_new (); assert (ctx); void *server, *server_mon; prep_server_socket (ctx, 1, is_curve, &server, &server_mon, my_endpoint, MAX_SOCKET_STRING); void *client = zmq_socket (ctx, ZMQ_DEALER); if (is_curve) setup_curve (client, 0); rc = zmq_connect (client, my_endpoint); // Give it a sec to connect and handshake msleep (SETTLE_TIME); // By now everything should report as connected rc = get_monitor_event (server_mon); assert (rc == ZMQ_EVENT_ACCEPTED); // We should still be connected because pings and pongs are happenin' rc = get_monitor_event (server_mon); assert (rc == -1); rc = zmq_close (client); assert (rc == 0); rc = zmq_close (server); assert (rc == 0); rc = zmq_close (server_mon); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); test_heartbeat_timeout (); test_heartbeat_ttl (); // Run this test without curve test_heartbeat_notimeout (0); // Then rerun it with curve test_heartbeat_notimeout (1); } zeromq-4.2.5/tests/test_dgram.cpp0000664000372000037200000000606313255253220017744 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" void str_send_to (void *s_, const char *content_, const char *address_) { // Send the address part int rc = s_sendmore (s_, address_); assert (rc > 0); rc = s_send (s_, content_); assert (rc > 0); } void str_recv_from (void *s_, char **ptr_content_, char **ptr_address_) { *ptr_address_ = s_recv (s_); assert (ptr_address_); *ptr_content_ = s_recv (s_); assert (ptr_content_); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); char *message_string; char *address; void *sender = zmq_socket (ctx, ZMQ_DGRAM); void *listener = zmq_socket (ctx, ZMQ_DGRAM); // Connecting dgram shoudl fail int rc = zmq_connect (listener, ENDPOINT_4); assert (rc == -1); rc = zmq_bind (listener, ENDPOINT_4); assert (rc == 0); rc = zmq_bind (sender, ENDPOINT_5); assert (rc == 0); str_send_to (sender, "Is someone there ?", strrchr (ENDPOINT_4, '/') + 1); str_recv_from (listener, &message_string, &address); assert (strcmp (message_string, "Is someone there ?") == 0); assert (strcmp (address, strrchr (ENDPOINT_5, '/') + 1) == 0); free (message_string); str_send_to (listener, "Yes, there is !", address); free (address); str_recv_from (sender, &message_string, &address); assert (strcmp (message_string, "Yes, there is !") == 0); assert (strcmp (address, strrchr (ENDPOINT_4, '/') + 1) == 0); free (message_string); free (address); rc = zmq_close (sender); assert (rc == 0); rc = zmq_close (listener); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_poller.cpp0000664000372000037200000005046013255253220020147 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } // duplicated from fd.hpp #ifdef ZMQ_HAVE_WINDOWS #define close closesocket #if defined _MSC_VER && _MSC_VER <= 1400 typedef UINT_PTR fd_t; enum { retired_fd = (fd_t) (~0) }; #else typedef SOCKET fd_t; enum { retired_fd = (fd_t) INVALID_SOCKET }; #endif #else typedef int fd_t; enum { retired_fd = -1 }; #endif fd_t get_fd (void *socket) { fd_t fd; size_t fd_size = sizeof fd; TEST_ASSERT_SUCCESS_ERRNO (zmq_getsockopt (socket, ZMQ_FD, &fd, &fd_size)); return fd; } void test_null_poller_pointers_destroy_direct () { TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_destroy (NULL)); } void test_null_poller_pointers_destroy_indirect () { void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_destroy (&null_poller)); } void test_null_poller_pointers_add_direct () { void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_add (NULL, socket, NULL, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_add_indirect () { void *null_poller = NULL; void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO ( EFAULT, zmq_poller_add (&null_poller, socket, NULL, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_modify_direct () { void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_modify (NULL, socket, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_modify_indirect () { void *null_poller = NULL; void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO ( EFAULT, zmq_poller_modify (&null_poller, socket, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_remove_direct () { void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_remove (NULL, socket)); test_context_socket_close (socket); } void test_null_poller_pointers_remove_indirect () { void *null_poller = NULL; void *socket = test_context_socket (ZMQ_PAIR); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_remove (&null_poller, socket)); test_context_socket_close (socket); } void test_null_poller_pointers_add_fd_direct () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_add_fd (NULL, fd, NULL, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_add_fd_indirect () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO ( EFAULT, zmq_poller_add_fd (&null_poller, fd, NULL, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_modify_fd_direct () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_modify_fd (NULL, fd, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_modify_fd_indirect () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO ( EFAULT, zmq_poller_modify_fd (&null_poller, fd, ZMQ_POLLIN)); test_context_socket_close (socket); } void test_null_poller_pointers_remove_fd_direct () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_remove_fd (NULL, fd)); test_context_socket_close (socket); } void test_null_poller_pointers_remove_fd_indirect () { void *socket = test_context_socket (ZMQ_PAIR); const fd_t fd = get_fd (socket); void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_remove_fd (&null_poller, fd)); test_context_socket_close (socket); } void test_null_poller_pointers_wait_direct () { zmq_poller_event_t event; TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait (NULL, &event, 0)); } void test_null_poller_pointers_wait_indirect () { zmq_poller_event_t event; void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait (&null_poller, &event, 0)); } void test_null_poller_pointers_wait_all_direct () { zmq_poller_event_t event; TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait_all (NULL, &event, 1, 0)); } void test_null_poller_pointers_wait_all_indirect () { zmq_poller_event_t event; void *null_poller = NULL; TEST_ASSERT_FAILURE_ERRNO ( EFAULT, zmq_poller_wait_all (&null_poller, &event, 1, 0)); } void test_null_socket_pointers () { void *poller = zmq_poller_new (); TEST_ASSERT_NOT_NULL (poller); TEST_ASSERT_FAILURE_ERRNO (ENOTSOCK, zmq_poller_add (poller, NULL, NULL, ZMQ_POLLIN)); TEST_ASSERT_FAILURE_ERRNO (ENOTSOCK, zmq_poller_modify (poller, NULL, ZMQ_POLLIN)); TEST_ASSERT_FAILURE_ERRNO (ENOTSOCK, zmq_poller_remove (poller, NULL)); fd_t null_socket_fd = retired_fd; TEST_ASSERT_FAILURE_ERRNO ( EBADF, zmq_poller_add_fd (poller, null_socket_fd, NULL, ZMQ_POLLIN)); TEST_ASSERT_FAILURE_ERRNO ( EBADF, zmq_poller_modify_fd (poller, null_socket_fd, ZMQ_POLLIN)); TEST_ASSERT_FAILURE_ERRNO (EBADF, zmq_poller_remove_fd (poller, null_socket_fd)); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); } typedef void (*extra_poller_socket_func_t) (void *poller, void *socket); void test_with_empty_poller (extra_poller_socket_func_t extra_func) { void *socket = test_context_socket (ZMQ_PAIR); void *poller = zmq_poller_new (); TEST_ASSERT_NOT_NULL (poller); extra_func (poller, socket); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); test_context_socket_close (socket); } typedef void (*extra_poller_func_t) (void *poller); void test_with_valid_poller (extra_poller_func_t extra_func) { void *socket = test_context_socket (ZMQ_PAIR); void *poller = zmq_poller_new (); TEST_ASSERT_NOT_NULL (poller); TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add (poller, socket, NULL, ZMQ_POLLIN)); extra_func (poller); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); test_context_socket_close (socket); } void call_poller_wait_null_event_fails (void *poller) { TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait (poller, NULL, 0)); } void call_poller_wait_all_null_event_fails_event_count_nonzero (void *poller) { TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait_all (poller, NULL, 1, 0)); } void call_poller_wait_all_null_event_fails_event_count_zero (void *poller) { #if 0 // TODO this causes an assertion, which is not consistent if the number // of events may be 0, the pointer should be allowed to by NULL in that // case too TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_wait_all (poller, NULL, 0, 0)); #endif } #define TEST_CASE_FUNC_PARAM(name, func) \ void test_##name () { func (name); } TEST_CASE_FUNC_PARAM (call_poller_wait_null_event_fails, test_with_valid_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_null_event_fails_event_count_nonzero, test_with_valid_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_null_event_fails_event_count_zero, test_with_valid_poller) void call_poller_add_twice_fails (void *poller, void *socket) { TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add (poller, socket, NULL, ZMQ_POLLIN)); // attempt to add the same socket twice TEST_ASSERT_FAILURE_ERRNO ( EINVAL, zmq_poller_add (poller, socket, NULL, ZMQ_POLLIN)); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_remove (poller, socket)); } void call_poller_remove_unregistered_fails (void *poller, void *socket) { // attempt to remove socket that is not present TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_poller_remove (poller, socket)); } void call_poller_modify_unregistered_fails (void *poller, void *socket) { // attempt to modify socket that is not present TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_poller_modify (poller, socket, ZMQ_POLLIN)); } void call_poller_add_no_events (void *poller, void *socket) { // add a socket with no events // TODO should this really be legal? it does not make any sense... TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_add (poller, socket, NULL, 0)); } void call_poller_add_fd_twice_fails (void *poller, void * /*zeromq_socket*/) { fd_t plain_socket = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add_fd (poller, plain_socket, NULL, ZMQ_POLLIN)); // attempt to add the same plain socket twice TEST_ASSERT_FAILURE_ERRNO ( EINVAL, zmq_poller_add_fd (poller, plain_socket, NULL, ZMQ_POLLIN)); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_remove_fd (poller, plain_socket)); TEST_ASSERT_SUCCESS_ERRNO (close (plain_socket)); } void call_poller_remove_fd_unregistered_fails (void *poller, void * /*zeromq_socket*/) { fd_t plain_socket = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); // attempt to remove plain socket that is not present TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_poller_remove_fd (poller, plain_socket)); TEST_ASSERT_SUCCESS_ERRNO (close (plain_socket)); } void call_poller_modify_fd_unregistered_fails (void *poller, void * /*zeromq_socket*/) { fd_t plain_socket = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); // attempt to remove plain socket that is not present TEST_ASSERT_FAILURE_ERRNO ( EINVAL, zmq_poller_modify_fd (poller, plain_socket, ZMQ_POLLIN)); TEST_ASSERT_SUCCESS_ERRNO (close (plain_socket)); } TEST_CASE_FUNC_PARAM (call_poller_add_twice_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_remove_unregistered_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_modify_unregistered_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_add_no_events, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_add_fd_twice_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_remove_fd_unregistered_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_modify_fd_unregistered_fails, test_with_empty_poller) void call_poller_wait_empty_with_timeout_fails (void *poller, void * /*socket*/) { zmq_poller_event_t event; // waiting on poller with no registered sockets should report error TEST_ASSERT_FAILURE_ERRNO (EAGAIN, zmq_poller_wait (poller, &event, 0)); } void call_poller_wait_empty_without_timeout_fails (void *poller, void * /*socket*/) { zmq_poller_event_t event; // this would never be able to return since no socket was registered, and should yield an error TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait (poller, &event, -1)); } void call_poller_wait_all_empty_negative_count_fails (void *poller, void * /*socket*/) { zmq_poller_event_t event; TEST_ASSERT_FAILURE_ERRNO (EINVAL, zmq_poller_wait_all (poller, &event, -1, 0)); } void call_poller_wait_all_empty_without_timeout_fails (void *poller, void * /*socket*/) { zmq_poller_event_t event; TEST_ASSERT_FAILURE_ERRNO (EAGAIN, zmq_poller_wait_all (poller, &event, 0, 0)); } void call_poller_wait_all_empty_with_timeout_fails (void *poller, void * /*socket*/) { zmq_poller_event_t event; // this would never be able to return since no socket was registered, and should yield an error TEST_ASSERT_FAILURE_ERRNO (EFAULT, zmq_poller_wait_all (poller, &event, 0, -1)); } TEST_CASE_FUNC_PARAM (call_poller_wait_empty_with_timeout_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_empty_without_timeout_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_empty_negative_count_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_empty_without_timeout_fails, test_with_empty_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_empty_with_timeout_fails, test_with_empty_poller) void test_poll_basic () { // Create few sockets void *vent = test_context_socket (ZMQ_PUSH); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; bind_loopback_ipv4 (vent, my_endpoint, len); void *sink = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (sink, my_endpoint)); // Set up poller void *poller = zmq_poller_new (); // register sink TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_add (poller, sink, sink, ZMQ_POLLIN)); // Send a message const char *vent_sink_msg = "H"; send_string_expect_success (vent, vent_sink_msg, 0); // We expect a message only on the sink zmq_poller_event_t event; TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_wait (poller, &event, -1)); TEST_ASSERT_EQUAL_PTR (sink, event.socket); TEST_ASSERT_EQUAL_PTR (sink, event.user_data); recv_string_expect_success (sink, vent_sink_msg, 0); // We expect timed out TEST_ASSERT_FAILURE_ERRNO (EAGAIN, zmq_poller_wait (poller, &event, 0)); // Stop polling sink TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_remove (poller, sink)); // Clean up test_context_socket_close (vent); test_context_socket_close (sink); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); } void test_poll_fd () { // Create sockets void *vent = test_context_socket (ZMQ_PUSH); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; bind_loopback_ipv4 (vent, my_endpoint, len); void *bowl = test_context_socket (ZMQ_PULL); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (bowl, my_endpoint)); // Set up poller void *poller = zmq_poller_new (); // Check we can poll an FD const fd_t fd = get_fd (bowl); TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add_fd (poller, fd, bowl, ZMQ_POLLIN)); zmq_poller_event_t event; TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_wait (poller, &event, 500)); TEST_ASSERT_NULL (event.socket); TEST_ASSERT_EQUAL (fd, event.fd); TEST_ASSERT_EQUAL_PTR (bowl, event.user_data); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_remove_fd (poller, fd)); // Clean up test_context_socket_close (vent); test_context_socket_close (bowl); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); } void test_poll_client_server () { #if defined(ZMQ_SERVER) && defined(ZMQ_CLIENT) // Create sockets void *server = test_context_socket (ZMQ_SERVER); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; bind_loopback_ipv4 (server, my_endpoint, len); void *client = test_context_socket (ZMQ_CLIENT); // Set up poller void *poller = zmq_poller_new (); // Polling on thread safe sockets TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_add (poller, server, NULL, ZMQ_POLLIN)); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (client, my_endpoint)); const char *client_server_msg = "I"; send_string_expect_success (client, client_server_msg, 0); zmq_poller_event_t event; TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_wait (poller, &event, 500)); TEST_ASSERT_EQUAL_PTR (server, event.socket); TEST_ASSERT_NULL (event.user_data); recv_string_expect_success (server, client_server_msg, 0); // Polling on pollout TEST_ASSERT_SUCCESS_ERRNO ( zmq_poller_modify (poller, server, ZMQ_POLLOUT | ZMQ_POLLIN)); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_wait (poller, &event, 0)); TEST_ASSERT_EQUAL_PTR (server, event.socket); TEST_ASSERT_NULL (event.user_data); TEST_ASSERT_EQUAL_INT (ZMQ_POLLOUT, event.events); // Stop polling server TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_remove (poller, server)); // Clean up test_context_socket_close (server); test_context_socket_close (client); TEST_ASSERT_SUCCESS_ERRNO (zmq_poller_destroy (&poller)); #endif } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_null_poller_pointers_destroy_direct); RUN_TEST (test_null_poller_pointers_destroy_indirect); RUN_TEST (test_null_poller_pointers_add_direct); RUN_TEST (test_null_poller_pointers_add_indirect); RUN_TEST (test_null_poller_pointers_modify_direct); RUN_TEST (test_null_poller_pointers_modify_indirect); RUN_TEST (test_null_poller_pointers_remove_direct); RUN_TEST (test_null_poller_pointers_remove_indirect); RUN_TEST (test_null_poller_pointers_add_fd_direct); RUN_TEST (test_null_poller_pointers_add_fd_indirect); RUN_TEST (test_null_poller_pointers_modify_fd_direct); RUN_TEST (test_null_poller_pointers_modify_fd_indirect); RUN_TEST (test_null_poller_pointers_remove_fd_direct); RUN_TEST (test_null_poller_pointers_remove_fd_indirect); RUN_TEST (test_null_poller_pointers_wait_direct); RUN_TEST (test_null_poller_pointers_wait_indirect); RUN_TEST (test_null_poller_pointers_wait_all_direct); RUN_TEST (test_null_poller_pointers_wait_all_indirect); RUN_TEST (test_null_socket_pointers); RUN_TEST (test_call_poller_wait_null_event_fails); RUN_TEST (test_call_poller_wait_all_null_event_fails_event_count_nonzero); RUN_TEST (test_call_poller_wait_all_null_event_fails_event_count_zero); RUN_TEST (test_call_poller_add_twice_fails); RUN_TEST (test_call_poller_remove_unregistered_fails); RUN_TEST (test_call_poller_modify_unregistered_fails); RUN_TEST (test_call_poller_add_no_events); RUN_TEST (test_call_poller_add_fd_twice_fails); RUN_TEST (test_call_poller_remove_fd_unregistered_fails); RUN_TEST (test_call_poller_modify_fd_unregistered_fails); RUN_TEST (test_call_poller_wait_empty_with_timeout_fails); RUN_TEST (test_call_poller_wait_empty_without_timeout_fails); RUN_TEST (test_call_poller_wait_all_empty_negative_count_fails); RUN_TEST (test_call_poller_wait_all_empty_without_timeout_fails); RUN_TEST (test_call_poller_wait_all_empty_with_timeout_fails); RUN_TEST (test_poll_basic); RUN_TEST (test_poll_fd); RUN_TEST (test_poll_client_server); return UNITY_END (); } zeromq-4.2.5/tests/test_iov.cpp0000664000372000037200000001157313255253220017451 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // XSI vector I/O #if defined ZMQ_HAVE_UIO #include #else struct iovec { void *iov_base; size_t iov_len; }; #endif void do_check (void *sb, void *sc, size_t msg_size) { assert (sb && sc && msg_size > 0); int rc = 0; const char msg_val = '1'; const int num_messages = 10; size_t send_count, recv_count; send_count = recv_count = num_messages; char *ref_msg = (char *) malloc (msg_size); assert (ref_msg); memset (ref_msg, msg_val, msg_size); // zmq_sendiov(3) as a single multi-part send struct iovec send_iov[num_messages]; char *buf = (char *) malloc (msg_size * num_messages); for (int i = 0; i < num_messages; i++) { send_iov[i].iov_base = &buf[i * msg_size]; send_iov[i].iov_len = msg_size; memcpy (send_iov[i].iov_base, ref_msg, msg_size); assert (memcmp (ref_msg, send_iov[i].iov_base, msg_size) == 0); } // Test errors - zmq_recviov - null socket rc = zmq_sendiov (NULL, send_iov, send_count, ZMQ_SNDMORE); assert (rc == -1 && errno == ENOTSOCK); // Test errors - zmq_recviov - invalid send count rc = zmq_sendiov (sc, send_iov, 0, 0); assert (rc == -1 && errno == EINVAL); // Test errors - zmq_recviov - null iovec rc = zmq_sendiov (sc, NULL, send_count, 0); assert (rc == -1 && errno == EINVAL); // Test success rc = zmq_sendiov (sc, send_iov, send_count, ZMQ_SNDMORE); // The zmq_sendiov(3) API method does not follow the same semantics as // zmq_recviov(3); the latter returns the count of messages sent, rightly // so, whilst the former sends the number of bytes successfully sent from // the last message, which does not hold much sense from a batch send // perspective; hence the assert checks if rc is same as msg_size. assert ((size_t) rc == msg_size); // zmq_recviov(3) single-shot struct iovec recv_iov[num_messages]; // Test errors - zmq_recviov - null socket rc = zmq_recviov (NULL, recv_iov, &recv_count, 0); assert (rc == -1 && errno == ENOTSOCK); // Test error - zmq_recviov - invalid receive count rc = zmq_recviov (sb, recv_iov, NULL, 0); assert (rc == -1 && errno == EINVAL); size_t invalid_recv_count = 0; rc = zmq_recviov (sb, recv_iov, &invalid_recv_count, 0); assert (rc == -1 && errno == EINVAL); // Test error - zmq_recviov - null iovec rc = zmq_recviov (sb, NULL, &recv_count, 0); assert (rc == -1 && errno == EINVAL); // Test success rc = zmq_recviov (sb, recv_iov, &recv_count, 0); assert (rc == num_messages); for (int i = 0; i < num_messages; i++) { assert (recv_iov[i].iov_base); assert (memcmp (ref_msg, recv_iov[i].iov_base, msg_size) == 0); free (recv_iov[i].iov_base); } assert (send_count == recv_count); free (ref_msg); free (buf); } int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); int rc; void *sb = zmq_socket (ctx, ZMQ_PULL); assert (sb); rc = zmq_bind (sb, "inproc://a"); assert (rc == 0); msleep (SETTLE_TIME); void *sc = zmq_socket (ctx, ZMQ_PUSH); rc = zmq_connect (sc, "inproc://a"); assert (rc == 0); // message bigger than VSM max do_check (sb, sc, 100); // message smaller than VSM max do_check (sb, sc, 10); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_ancillaries.cpp0000664000372000037200000000364313255253220021141 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ /* * File for adding tests for ancillary API methods and other miscellaenous * API internals. Please ensure that when adding such tests into this file, * that they are short-lived so they do not trigger timeouts in the * CI build environments. */ #include "testutil.hpp" int main (void) { int major, minor, patch; zmq_version (&major, &minor, &patch); assert (major == ZMQ_VERSION_MAJOR && minor == ZMQ_VERSION_MINOR && patch == ZMQ_VERSION_PATCH); assert (zmq_strerror (EINVAL)); return 0; } zeromq-4.2.5/tests/test_abstract_ipc.cpp0000664000372000037200000000426213255253220021307 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_DEALER); assert (sb); int rc = zmq_bind (sb, "ipc://@tmp-tester"); assert (rc == 0); char endpoint[200]; size_t size = sizeof (endpoint); rc = zmq_getsockopt (sb, ZMQ_LAST_ENDPOINT, endpoint, &size); assert (rc == 0); rc = strncmp (endpoint, "ipc://@tmp-tester", size); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_DEALER); assert (sc); rc = zmq_connect (sc, "ipc://@tmp-tester"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_xpub_nodrop.cpp0000664000372000037200000000662413255253220021214 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); // Create a publisher void *pub = zmq_socket (ctx, ZMQ_PUB); assert (pub); int hwm = 2000; int rc = zmq_setsockopt (pub, ZMQ_SNDHWM, &hwm, 4); assert (rc == 0); rc = zmq_bind (pub, "inproc://soname"); assert (rc == 0); // set pub socket options int wait = 1; rc = zmq_setsockopt (pub, ZMQ_XPUB_NODROP, &wait, 4); assert (rc == 0); // Create a subscriber void *sub = zmq_socket (ctx, ZMQ_SUB); assert (sub); rc = zmq_connect (sub, "inproc://soname"); assert (rc == 0); // Subscribe for all messages. rc = zmq_setsockopt (sub, ZMQ_SUBSCRIBE, "", 0); assert (rc == 0); int hwmlimit = hwm - 1; int send_count = 0; // Send an empty message for (int i = 0; i < hwmlimit; i++) { rc = zmq_send (pub, NULL, 0, 0); assert (rc == 0); send_count++; } int recv_count = 0; do { // Receive the message in the subscriber rc = zmq_recv (sub, NULL, 0, ZMQ_DONTWAIT); if (rc == -1) assert (errno == EAGAIN); else { assert (rc == 0); recv_count++; } } while (rc == 0); assert (send_count == recv_count); // Now test real blocking behavior // Set a timeout, default is infinite int timeout = 0; rc = zmq_setsockopt (pub, ZMQ_SNDTIMEO, &timeout, 4); assert (rc == 0); send_count = 0; recv_count = 0; hwmlimit = hwm; // Send an empty message until we get an error, which must be EAGAIN while (zmq_send (pub, "", 0, 0) == 0) send_count++; assert (errno == EAGAIN); while (zmq_recv (sub, NULL, 0, ZMQ_DONTWAIT) == 0) recv_count++; assert (send_count == recv_count); // Clean up. rc = zmq_close (pub); assert (rc == 0); rc = zmq_close (sub); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_stream_empty.cpp0000664000372000037200000000511013255253220021353 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *stream = zmq_socket (ctx, ZMQ_STREAM); assert (stream); void *dealer = zmq_socket (ctx, ZMQ_DEALER); assert (dealer); int rc = zmq_bind (stream, "tcp://127.0.0.1:*"); assert (rc >= 0); rc = zmq_getsockopt (stream, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (dealer, my_endpoint); assert (rc >= 0); zmq_send (dealer, "", 0, 0); zmq_msg_t ident, empty; zmq_msg_init (&ident); rc = zmq_msg_recv (&ident, stream, 0); assert (rc >= 0); rc = zmq_msg_init_data (&empty, (void *) "", 0, NULL, NULL); assert (rc >= 0); rc = zmq_msg_send (&ident, stream, ZMQ_SNDMORE); assert (rc >= 0); rc = zmq_msg_close (&ident); assert (rc >= 0); rc = zmq_msg_send (&empty, stream, 0); assert (rc >= 0); // This close used to fail with Bad Address rc = zmq_msg_close (&empty); assert (rc >= 0); close_zero_linger (dealer); close_zero_linger (stream); zmq_ctx_term (ctx); } zeromq-4.2.5/tests/test_system.cpp0000664000372000037200000000636413255253220020202 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #else #include #include #include #endif #if defined(ZMQ_HAVE_WINDOWS) void initialise_network (void) { WSADATA info; if (WSAStartup (MAKEWORD (2, 0), &info) != 0) throw std::runtime_error ("Could not start WSA"); } #else void initialise_network (void) { } #endif // This test case stresses the system to shake out known configuration // problems. We're direct system calls when necessary. Some code may // need wrapping to be properly portable. int main (void) { initialise_network (); // Check that we have local networking via ZeroMQ void *ctx = zmq_ctx_new (); assert (ctx); void *dealer = zmq_socket (ctx, ZMQ_DEALER); if (zmq_bind (dealer, "tcp://127.0.0.1:*") == -1) { printf ( "E: Cannot find 127.0.0.1 -- your system does not have local\n"); printf ( "E: networking. Please fix this before running libzmq checks.\n"); return -1; } // Check that we can create 1,000 sockets int handle[1000]; int count; for (count = 0; count < 1000; count++) { handle[count] = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); if (handle[count] == -1) { printf ("W: Only able to create %d sockets on this box\n", count); printf ( "I: Tune your system to increase maximum allowed file handles\n"); #if defined(ZMQ_HAVE_OSX) printf ("I: On OS/X, run 'ulimit -n 1200' in bash\n"); #elif defined(ZMQ_HAVE_LINUX) printf ("I: On Linux, run 'ulimit -n 1200' in bash\n"); #endif return -1; } } // Release the socket handles for (count = 0; count < 1000; count++) { close (handle[count]); } zmq_close (dealer); zmq_ctx_term (ctx); } zeromq-4.2.5/tests/test_base85.cpp0000664000372000037200000001342213255253220017736 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // Test vector: rfc.zeromq.org/spec:32/Z85 void test__zmq_z85_encode__valid__success () { static const size_t size = 8; static const size_t length = size * 5 / 4; static const uint8_t decoded[size] = {0x86, 0x4F, 0xD2, 0x6F, 0xB5, 0x59, 0xF7, 0x5B}; static const char expected[length + 1] = "HelloWorld"; char out_encoded[length + 1] = {0}; errno = 0; assert (zmq_z85_encode (out_encoded, decoded, size) != NULL); assert (streq (out_encoded, expected)); assert (zmq_errno () == 0); } // Buffer length must be evenly divisible by 4 or must fail with EINVAL. void test__zmq_z85_encode__invalid__failure (size_t size) { errno = 0; assert (zmq_z85_encode (NULL, NULL, size) == NULL); assert (zmq_errno () == EINVAL); } // Test vector: rfc.zeromq.org/spec:32/Z85 void test__zmq_z85_decode__valid__success () { static const size_t size = 10 * 4 / 5; static const uint8_t expected[size] = {0x86, 0x4F, 0xD2, 0x6F, 0xB5, 0x59, 0xF7, 0x5B}; static const char *encoded = "HelloWorld"; uint8_t out_decoded[size] = {0}; errno = 0; assert (zmq_z85_decode (out_decoded, encoded) != NULL); assert (zmq_errno () == 0); assert (memcmp (out_decoded, expected, size) == 0); } // Invalid input data must fail with EINVAL. template void test__zmq_z85_decode__invalid__failure (const char (&encoded)[SIZE]) { uint8_t decoded[SIZE * 4 / 5 + 1]; errno = 0; assert (zmq_z85_decode (decoded, encoded) == NULL); assert (zmq_errno () == EINVAL); } // call zmq_z85_encode, then zmq_z85_decode, and compare the results with the original template void test__zmq_z85_encode__zmq_z85_decode__roundtrip ( const uint8_t (&test_data)[SIZE]) { char test_data_z85[SIZE * 5 / 4 + 1]; char *res1 = zmq_z85_encode (test_data_z85, test_data, SIZE); assert (res1 != NULL); uint8_t test_data_decoded[SIZE]; uint8_t *res2 = zmq_z85_decode (test_data_decoded, test_data_z85); assert (res2 != NULL); int res3 = memcmp (test_data, test_data_decoded, SIZE); assert (res3 == 0); } // call zmq_z85_encode, then zmq_z85_decode, and compare the results with the original template void test__zmq_z85_decode__zmq_z85_encode__roundtrip ( const char (&test_data)[SIZE]) { const size_t decoded_size = (SIZE - 1) * 4 / 5; uint8_t test_data_decoded[decoded_size]; uint8_t *res1 = zmq_z85_decode (test_data_decoded, test_data); assert (res1 != NULL); char test_data_z85[SIZE]; char *res2 = zmq_z85_encode (test_data_z85, test_data_decoded, decoded_size); assert (res2 != NULL); int res3 = memcmp (test_data, test_data_z85, SIZE); assert (res3 == 0); } int main (void) { test__zmq_z85_encode__valid__success (); test__zmq_z85_encode__invalid__failure (1); test__zmq_z85_encode__invalid__failure (42); test__zmq_z85_decode__valid__success (); // String length must be evenly divisible by 5 or must fail with EINVAL. test__zmq_z85_decode__invalid__failure ("01234567"); test__zmq_z85_decode__invalid__failure ("0"); // decode invalid data with the maximum representable value test__zmq_z85_decode__invalid__failure ("#####"); // decode invalid data with the minimum value beyond the limit // "%nSc0" is 0xffffffff test__zmq_z85_decode__invalid__failure ("%nSc1"); // decode invalid data with an invalid character in the range of valid // characters test__zmq_z85_decode__invalid__failure ("####\0047"); // decode invalid data with an invalid character just below the range of valid // characters test__zmq_z85_decode__invalid__failure ("####\0200"); // decode invalid data with an invalid character just above the range of valid // characters test__zmq_z85_decode__invalid__failure ("####\0037"); // round-trip encoding and decoding with minimum value { const uint8_t test_data[] = {0x00, 0x00, 0x00, 0x00}; test__zmq_z85_encode__zmq_z85_decode__roundtrip (test_data); } // round-trip encoding and decoding with maximum value { const uint8_t test_data[] = {0xff, 0xff, 0xff, 0xff}; test__zmq_z85_encode__zmq_z85_decode__roundtrip (test_data); } test__zmq_z85_decode__zmq_z85_encode__roundtrip ( "r^/rM9M=rMToK)63O8dCvd9D. */ #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); void *frontend = zmq_socket (ctx, ZMQ_DEALER); assert (frontend); int rc = zmq_bind (frontend, "inproc://timeout_test"); assert (rc == 0); // Receive on disconnected socket returns immediately char buffer[32]; rc = zmq_recv (frontend, buffer, 32, ZMQ_DONTWAIT); assert (rc == -1); assert (zmq_errno () == EAGAIN); // Check whether receive timeout is honored const int timeout = 250; const int jitter = 50; rc = zmq_setsockopt (frontend, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); void *stopwatch = zmq_stopwatch_start (); rc = zmq_recv (frontend, buffer, 32, 0); assert (rc == -1); assert (zmq_errno () == EAGAIN); unsigned int elapsed = zmq_stopwatch_stop (stopwatch) / 1000; assert (elapsed > timeout - jitter); if (elapsed >= timeout + jitter) { // we cannot assert this on a non-RT system fprintf (stderr, "zmq_recv took quite long, with a timeout of %i ms, it took " "actually %i ms\n", timeout, elapsed); } // Check that normal message flow works as expected void *backend = zmq_socket (ctx, ZMQ_DEALER); assert (backend); rc = zmq_connect (backend, "inproc://timeout_test"); assert (rc == 0); rc = zmq_setsockopt (backend, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_send (backend, "Hello", 5, 0); assert (rc == 5); rc = zmq_recv (frontend, buffer, 32, 0); assert (rc == 5); // Clean-up rc = zmq_close (backend); assert (rc == 0); rc = zmq_close (frontend); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_sodium.cpp0000664000372000037200000000615213255253220020151 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // There is no way to test for correctness because of the embedded RNG. void test__zmq_curve_keypair__always__success (void) { errno = 0; char public_key[41] = {0}; char secret_key[41] = {0}; const int rc = zmq_curve_keypair (public_key, secret_key); #if defined(ZMQ_HAVE_CURVE) assert (rc == 0); #else assert (rc == -1); assert (zmq_errno () == ENOTSUP); #endif } void test__zmq_curve_public__valid__success () { // These are paired according to hintjens.com/blog:45 static const char public_key[] = "Yne@$w-vo. */ #include #include #include #include "testutil.hpp" int main (void) { setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); std::stringstream s; s << "vmci://" << VMCISock_GetLocalCID () << ":" << 5560; std::string endpoint = s.str (); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); int rc = zmq_bind (sb, endpoint.c_str ()); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, endpoint.c_str ()); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_disconnect_inproc.cpp0000664000372000037200000001350413255253220022353 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" /// Initialize a zeromq message with a given null-terminated string #define ZMQ_PREPARE_STRING(msg, data, size) \ \ zmq_msg_init (&msg) \ && printf ("zmq_msg_init: %s\n", zmq_strerror (errno)); \ \ zmq_msg_init_size (&msg, size + 1) \ && printf ("zmq_msg_init_size: %s\n", zmq_strerror (errno)); \ \ memcpy (zmq_msg_data (&msg), data, size + 1); // TODO: this code fails to meet our style guidelines, and needs rewriting static int publicationsReceived = 0; static bool isSubscribed = false; int main (int, char **) { setup_test_environment (); void *context = zmq_ctx_new (); void *pubSocket; void *subSocket; (pubSocket = zmq_socket (context, ZMQ_XPUB)) || printf ("zmq_socket: %s\n", zmq_strerror (errno)); (subSocket = zmq_socket (context, ZMQ_SUB)) || printf ("zmq_socket: %s\n", zmq_strerror (errno)); zmq_setsockopt (subSocket, ZMQ_SUBSCRIBE, "foo", 3) && printf ("zmq_setsockopt: %s\n", zmq_strerror (errno)); zmq_bind (pubSocket, "inproc://someInProcDescriptor") && printf ("zmq_bind: %s\n", zmq_strerror (errno)); //zmq_bind(pubSocket, "tcp://127.0.0.1:30010") && printf("zmq_bind: %s\n", zmq_strerror(errno)); int more; size_t more_size = sizeof (more); int iteration = 0; while (1) { zmq_pollitem_t items[] = { {subSocket, 0, ZMQ_POLLIN, 0}, // read publications {pubSocket, 0, ZMQ_POLLIN, 0}, // read subscriptions }; int rc = zmq_poll (items, 2, 100); if (items[1].revents & ZMQ_POLLIN) { while (1) { zmq_msg_t msg; zmq_msg_init (&msg); zmq_msg_recv (&msg, pubSocket, 0); char *buffer = (char *) zmq_msg_data (&msg); if (buffer[0] == 0) { assert (isSubscribed); isSubscribed = false; } else { assert (!isSubscribed); isSubscribed = true; } zmq_getsockopt (pubSocket, ZMQ_RCVMORE, &more, &more_size); zmq_msg_close (&msg); if (!more) break; // Last message part } } if (items[0].revents & ZMQ_POLLIN) { while (1) { zmq_msg_t msg; zmq_msg_init (&msg); zmq_msg_recv (&msg, subSocket, 0); zmq_getsockopt (subSocket, ZMQ_RCVMORE, &more, &more_size); zmq_msg_close (&msg); if (!more) { publicationsReceived++; break; // Last message part } } } if (iteration == 1) { zmq_connect (subSocket, "inproc://someInProcDescriptor") && printf ("zmq_connect: %s\n", zmq_strerror (errno)); msleep (SETTLE_TIME); } if (iteration == 4) { zmq_disconnect (subSocket, "inproc://someInProcDescriptor") && printf ("zmq_disconnect(%d): %s\n", errno, zmq_strerror (errno)); } if (iteration > 4 && rc == 0) break; zmq_msg_t channelEnvlp; ZMQ_PREPARE_STRING (channelEnvlp, "foo", 3); zmq_msg_send (&channelEnvlp, pubSocket, ZMQ_SNDMORE) >= 0 || printf ("zmq_msg_send: %s\n", zmq_strerror (errno)); zmq_msg_close (&channelEnvlp) && printf ("zmq_msg_close: %s\n", zmq_strerror (errno)); zmq_msg_t message; ZMQ_PREPARE_STRING (message, "this is foo!", 12); zmq_msg_send (&message, pubSocket, 0) >= 0 || printf ("zmq_msg_send: %s\n", zmq_strerror (errno)); zmq_msg_close (&message) && printf ("zmq_msg_close: %s\n", zmq_strerror (errno)); iteration++; } assert (publicationsReceived == 3); assert (!isSubscribed); zmq_close (pubSocket) && printf ("zmq_close: %s", zmq_strerror (errno)); zmq_close (subSocket) && printf ("zmq_close: %s", zmq_strerror (errno)); zmq_ctx_term (context); return 0; } zeromq-4.2.5/tests/test_monitor.cpp0000664000372000037200000001040213255253220020331 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_security.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // We'll monitor these two sockets void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); // Socket monitoring only works over inproc:// int rc = zmq_socket_monitor (client, "tcp://127.0.0.1:*", 0); assert (rc == -1); assert (zmq_errno () == EPROTONOSUPPORT); // Monitor all events on client and server sockets rc = zmq_socket_monitor (client, "inproc://monitor-client", ZMQ_EVENT_ALL); assert (rc == 0); rc = zmq_socket_monitor (server, "inproc://monitor-server", ZMQ_EVENT_ALL); assert (rc == 0); // Create two sockets for collecting monitor events void *client_mon = zmq_socket (ctx, ZMQ_PAIR); assert (client_mon); void *server_mon = zmq_socket (ctx, ZMQ_PAIR); assert (server_mon); // Connect these to the inproc endpoints so they'll get events rc = zmq_connect (client_mon, "inproc://monitor-client"); assert (rc == 0); rc = zmq_connect (server_mon, "inproc://monitor-server"); assert (rc == 0); // Now do a basic ping test rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); bounce (server, client); // Close client and server close_zero_linger (client); close_zero_linger (server); // Now collect and check events from both sockets int event = get_monitor_event (client_mon, NULL, NULL); if (event == ZMQ_EVENT_CONNECT_DELAYED) event = get_monitor_event (client_mon, NULL, NULL); assert (event == ZMQ_EVENT_CONNECTED); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event (client_mon, ZMQ_EVENT_HANDSHAKE_SUCCEEDED); #endif expect_monitor_event (client_mon, ZMQ_EVENT_MONITOR_STOPPED); // This is the flow of server events expect_monitor_event (server_mon, ZMQ_EVENT_LISTENING); expect_monitor_event (server_mon, ZMQ_EVENT_ACCEPTED); #ifdef ZMQ_BUILD_DRAFT_API expect_monitor_event (server_mon, ZMQ_EVENT_HANDSHAKE_SUCCEEDED); #endif event = get_monitor_event (server_mon, NULL, NULL); // Sometimes the server sees the client closing before it gets closed. if (event != ZMQ_EVENT_DISCONNECTED) { assert (event == ZMQ_EVENT_CLOSED); event = get_monitor_event (server_mon, NULL, NULL); } if (event != ZMQ_EVENT_DISCONNECTED) { assert (event == ZMQ_EVENT_MONITOR_STOPPED); } // Close down the sockets close_zero_linger (client_mon); close_zero_linger (server_mon); zmq_ctx_term (ctx); return 0; } zeromq-4.2.5/tests/test_hwm_pubsub.cpp0000664000372000037200000001524613255253220021030 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" // const int MAX_SENDS = 10000; int test_defaults (int send_hwm, int msgCnt) { void *ctx = zmq_ctx_new (); assert (ctx); int rc; // Set up bind socket void *pub_socket = zmq_socket (ctx, ZMQ_PUB); assert (pub_socket); rc = zmq_bind (pub_socket, "inproc://a"); assert (rc == 0); // Set up connect socket void *sub_socket = zmq_socket (ctx, ZMQ_SUB); assert (sub_socket); rc = zmq_connect (sub_socket, "inproc://a"); assert (rc == 0); //set a hwm on publisher rc = zmq_setsockopt (pub_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm)); rc = zmq_setsockopt (sub_socket, ZMQ_SUBSCRIBE, 0, 0); // Send until we block int send_count = 0; while (send_count < msgCnt && zmq_send (pub_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; msleep (SETTLE_TIME); // Now receive all sent messages int recv_count = 0; while (0 == zmq_recv (sub_socket, NULL, 0, ZMQ_DONTWAIT)) { ++recv_count; } assert (send_hwm == recv_count); // Clean up rc = zmq_close (sub_socket); assert (rc == 0); rc = zmq_close (pub_socket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return recv_count; } int receive (void *socket) { int recv_count = 0; // Now receive all sent messages while (0 == zmq_recv (socket, NULL, 0, ZMQ_DONTWAIT)) { ++recv_count; } return recv_count; } int test_blocking (int send_hwm, int msgCnt) { void *ctx = zmq_ctx_new (); assert (ctx); int rc; // Set up bind socket void *pub_socket = zmq_socket (ctx, ZMQ_PUB); assert (pub_socket); rc = zmq_bind (pub_socket, "inproc://a"); assert (rc == 0); // Set up connect socket void *sub_socket = zmq_socket (ctx, ZMQ_SUB); assert (sub_socket); rc = zmq_connect (sub_socket, "inproc://a"); assert (rc == 0); //set a hwm on publisher rc = zmq_setsockopt (pub_socket, ZMQ_SNDHWM, &send_hwm, sizeof (send_hwm)); int wait = 1; rc = zmq_setsockopt (pub_socket, ZMQ_XPUB_NODROP, &wait, sizeof (wait)); rc = zmq_setsockopt (sub_socket, ZMQ_SUBSCRIBE, 0, 0); // Send until we block int send_count = 0; int recv_count = 0; while (send_count < msgCnt) { rc = zmq_send (pub_socket, NULL, 0, ZMQ_DONTWAIT); if (rc == 0) { ++send_count; } else if (-1 == rc) { assert (EAGAIN == errno); recv_count += receive (sub_socket); assert (recv_count == send_count); } } recv_count += receive (sub_socket); // Clean up rc = zmq_close (sub_socket); assert (rc == 0); rc = zmq_close (pub_socket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return recv_count; } // with hwm 11024: send 9999 msg, receive 9999, send 1100, receive 1100 void test_reset_hwm () { int first_count = 9999; int second_count = 1100; int hwm = 11024; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); int rc; // Set up bind socket void *pub_socket = zmq_socket (ctx, ZMQ_PUB); assert (pub_socket); rc = zmq_setsockopt (pub_socket, ZMQ_SNDHWM, &hwm, sizeof (hwm)); assert (rc == 0); rc = zmq_bind (pub_socket, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (pub_socket, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Set up connect socket void *sub_socket = zmq_socket (ctx, ZMQ_SUB); assert (sub_socket); rc = zmq_setsockopt (sub_socket, ZMQ_RCVHWM, &hwm, sizeof (hwm)); assert (rc == 0); rc = zmq_connect (sub_socket, my_endpoint); assert (rc == 0); rc = zmq_setsockopt (sub_socket, ZMQ_SUBSCRIBE, 0, 0); assert (rc == 0); msleep (SETTLE_TIME); // Send messages int send_count = 0; while (send_count < first_count && zmq_send (pub_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; assert (first_count == send_count); msleep (SETTLE_TIME); // Now receive all sent messages int recv_count = 0; while (0 == zmq_recv (sub_socket, NULL, 0, ZMQ_DONTWAIT)) { ++recv_count; } assert (first_count == recv_count); msleep (SETTLE_TIME); // Send messages send_count = 0; while (send_count < second_count && zmq_send (pub_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; assert (second_count == send_count); msleep (SETTLE_TIME); // Now receive all sent messages recv_count = 0; while (0 == zmq_recv (sub_socket, NULL, 0, ZMQ_DONTWAIT)) { ++recv_count; } assert (second_count == recv_count); // Clean up rc = zmq_close (sub_socket); assert (rc == 0); rc = zmq_close (pub_socket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { setup_test_environment (); int count; // send 1000 msg on hwm 1000, receive 1000 count = test_defaults (1000, 1000); assert (count == 1000); // send 6000 msg on hwm 2000, drops above hwm, only receive hwm count = test_blocking (2000, 6000); assert (count == 6000); // hwm should apply to the messages that have already been received test_reset_hwm (); return 0; } zeromq-4.2.5/tests/test_immediate.cpp0000664000372000037200000001707413255253220020614 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_immediate_1 () { int val; int rc; char buffer[16]; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // TEST 1. // First we're going to attempt to send messages to two // pipes, one connected, the other not. We should see // the PUSH load balancing to both pipes, and hence half // of the messages getting queued, as connect() creates a // pipe immediately. void *to = test_context_socket (ZMQ_PULL); // Bind the one valid receiver val = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof (val))); bind_loopback_ipv4 (to, my_endpoint, len); // Create a socket pushing to two endpoints - only 1 message should arrive. void *from = test_context_socket (ZMQ_PUSH); val = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof (val))); // This pipe will not connect (provided the ephemeral port is not 5556) TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (from, "tcp://localhost:5556")); // This pipe will TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (from, my_endpoint)); msleep (SETTLE_TIME); // We send 10 messages, 5 should just get stuck in the queue // for the not-yet-connected pipe for (int i = 0; i < 10; ++i) { send_string_expect_success (from, "Hello", 0); } // We now consume from the connected pipe // - we should see just 5 int timeout = 250; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int))); int seen = 0; while (true) { rc = zmq_recv (to, &buffer, sizeof (buffer), 0); if (rc == -1) break; // Break when we didn't get a message seen++; } TEST_ASSERT_EQUAL_INT (5, seen); test_context_socket_close (from); test_context_socket_close (to); } void test_immediate_2 () { // This time we will do the same thing, connect two pipes, // one of which will succeed in connecting to a bound // receiver, the other of which will fail. However, we will // also set the delay attach on connect flag, which should // cause the pipe attachment to be delayed until the connection // succeeds. // Bind the valid socket void *to = test_context_socket (ZMQ_PULL); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; bind_loopback_ipv4 (to, my_endpoint, len); int val = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof (val))); // Create a socket pushing to two endpoints - all messages should arrive. void *from = test_context_socket (ZMQ_PUSH); val = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof (val))); // Set the key flag val = 1; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (from, ZMQ_IMMEDIATE, &val, sizeof (val))); // Connect to the invalid socket TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (from, "tcp://localhost:5561")); // Connect to the valid socket TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (from, my_endpoint)); // Send 10 messages, all should be routed to the connected pipe for (int i = 0; i < 10; ++i) { send_string_expect_success (from, "Hello", 0); } int timeout = 250; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int))); int seen = 0; while (true) { char buffer[16]; int rc = zmq_recv (to, &buffer, sizeof (buffer), 0); if (rc == -1) break; // Break when we didn't get a message seen++; } TEST_ASSERT_EQUAL_INT (10, seen); test_context_socket_close (from); test_context_socket_close (to); } void test_immediate_3 () { // This time we want to validate that the same blocking behaviour // occurs with an existing connection that is broken. We will send // messages to a connected pipe, disconnect and verify the messages // block. Then we reconnect and verify messages flow again. void *backend = test_context_socket (ZMQ_DEALER); void *frontend = test_context_socket (ZMQ_DEALER); int zero = 0; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero))); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (frontend, ZMQ_LINGER, &zero, sizeof (zero))); // Frontend connects to backend using IMMEDIATE int on = 1; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (frontend, ZMQ_IMMEDIATE, &on, sizeof (on))); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; bind_loopback_ipv4 (backend, my_endpoint, len); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (frontend, my_endpoint)); // Ping backend to frontend so we know when the connection is up send_string_expect_success (backend, "Hello", 0); recv_string_expect_success (frontend, "Hello", 0); // Send message from frontend to backend send_string_expect_success (frontend, "Hello", ZMQ_DONTWAIT); test_context_socket_close (backend); // Give time to process disconnect msleep (SETTLE_TIME * 10); // Send a message, should fail TEST_ASSERT_FAILURE_ERRNO (EAGAIN, zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT)); // Recreate backend socket backend = test_context_socket (ZMQ_DEALER); TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (backend, my_endpoint)); // Ping backend to frontend so we know when the connection is up send_string_expect_success (backend, "Hello", 0); recv_string_expect_success (frontend, "Hello", 0); // After the reconnect, should succeed send_string_expect_success (frontend, "Hello", ZMQ_DONTWAIT); test_context_socket_close (backend); test_context_socket_close (frontend); } int main (void) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_immediate_1); RUN_TEST (test_immediate_2); RUN_TEST (test_immediate_3); return UNITY_END (); } zeromq-4.2.5/tests/test_probe_router.cpp0000664000372000037200000000562713255253220021366 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); // Create server and bind to endpoint void *server = zmq_socket (ctx, ZMQ_ROUTER); assert (server); int rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); // Create client and connect to server, doing a probe void *client = zmq_socket (ctx, ZMQ_ROUTER); assert (client); rc = zmq_setsockopt (client, ZMQ_ROUTING_ID, "X", 1); assert (rc == 0); int probe = 1; rc = zmq_setsockopt (client, ZMQ_PROBE_ROUTER, &probe, sizeof (probe)); assert (rc == 0); rc = zmq_connect (client, my_endpoint); assert (rc == 0); // We expect a routing id=X + empty message from client unsigned char buffer[255]; rc = zmq_recv (server, buffer, 255, 0); assert (rc == 1); assert (buffer[0] == 'X'); rc = zmq_recv (server, buffer, 255, 0); assert (rc == 0); // Send a message to client now rc = zmq_send (server, "X", 1, ZMQ_SNDMORE); assert (rc == 1); rc = zmq_send (server, "Hello", 5, 0); assert (rc == 5); rc = zmq_recv (client, buffer, 255, 0); assert (rc == 5); rc = zmq_close (server); assert (rc == 0); rc = zmq_close (client); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_pair_tipc.cpp0000664000372000037200000000416313255253220020623 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } fprintf (stderr, "test_pair_tipc running...\n"); void *ctx = zmq_init (1); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); int rc = zmq_bind (sb, "tipc://{5560,0,0}"); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, "tipc://{5560,0}@0.0.0"); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_shutdown_stress_tipc.cpp0000664000372000037200000000544213255253220023147 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #define THREAD_COUNT 100 extern "C" { static void *worker (void *s) { int rc; rc = zmq_connect (s, "tipc://{5560,0}@0.0.0"); assert (rc == 0); // Start closing the socket while the connecting process is underway. rc = zmq_close (s); assert (rc == 0); return NULL; } } int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } void *ctx; void *s1; void *s2; int i; int j; int rc; pthread_t threads[THREAD_COUNT]; fprintf (stderr, "test_shutdown_stress_tipc running...\n"); for (j = 0; j != 10; j++) { // Check the shutdown with many parallel I/O threads. ctx = zmq_init (7); assert (ctx); s1 = zmq_socket (ctx, ZMQ_PUB); assert (s1); rc = zmq_bind (s1, "tipc://{5560,0,0}"); assert (rc == 0); for (i = 0; i != THREAD_COUNT; i++) { s2 = zmq_socket (ctx, ZMQ_SUB); assert (s2); rc = pthread_create (&threads[i], NULL, worker, s2); assert (rc == 0); } for (i = 0; i != THREAD_COUNT; i++) { rc = pthread_join (threads[i], NULL); assert (rc == 0); } rc = zmq_close (s1); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } return 0; } zeromq-4.2.5/tests/test_security_gssapi.cpp0000664000372000037200000003046413255253220022071 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if defined(ZMQ_HAVE_WINDOWS) #include #include #include #define close closesocket #else #include #include #include #include #endif // This test requires a KRB5 environment with the following // service principal (substitute your host.domain and REALM): // // zmqtest2/host.domain@REALM (host.domain should be host running test) // // Export keys for this principal to a keytab file and set the environment // variables KRB5_KTNAME and KRB5_CLIENT_KTNAME to FILE:/path/to/your/keytab. // The test will use it both for client and server roles. // // The test is derived in large part from test_security_curve.cpp const char *name = "zmqtest2"; static volatile int zap_deny_all = 0; // Read one event off the monitor socket; return value and address // by reference, if not null, and event number by value. Returns -1 // in case of error. #ifdef ZMQ_BUILD_DRAFT_API static int get_monitor_event (void *monitor, int *value, char **address) { // First frame in message contains event number and value zmq_msg_t msg; zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interruped, presumably assert (zmq_msg_more (&msg)); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); uint16_t event = *(uint16_t *) (data); if (value) *value = *(uint32_t *) (data + 2); zmq_msg_close (&msg); // Second frame in message contains event address zmq_msg_init (&msg); if (zmq_msg_recv (&msg, monitor, 0) == -1) return -1; // Interruped, presumably assert (!zmq_msg_more (&msg)); if (address) { uint8_t *data = (uint8_t *) zmq_msg_data (&msg); size_t size = zmq_msg_size (&msg); *address = (char *) malloc (size + 1); memcpy (*address, data, size); *address[size] = 0; } zmq_msg_close (&msg); return event; } #endif // -------------------------------------------------------------------------- // This methods receives and validates ZAP requestes (allowing or denying // each client connection). // N.B. on failure, each crypto type in keytab will be tried static void zap_handler (void *handler) { // Process ZAP requests forever while (true) { char *version = s_recv (handler); if (!version) break; // Terminating char *sequence = s_recv (handler); char *domain = s_recv (handler); char *address = s_recv (handler); char *routing_id = s_recv (handler); char *mechanism = s_recv (handler); char *principal = s_recv (handler); assert (streq (version, "1.0")); assert (streq (mechanism, "GSSAPI")); s_sendmore (handler, version); s_sendmore (handler, sequence); if (!zap_deny_all) { s_sendmore (handler, "200"); s_sendmore (handler, "OK"); s_sendmore (handler, "anonymous"); s_send (handler, ""); //fprintf (stderr, "ALLOW %s\n", principal); } else { s_sendmore (handler, "400"); s_sendmore (handler, "Denied"); s_sendmore (handler, ""); s_send (handler, ""); //fprintf (stderr, "DENY %s\n", principal); } free (version); free (sequence); free (domain); free (address); free (routing_id); free (mechanism); free (principal); } zmq_close (handler); } void test_valid_creds (void *ctx, void *server, void *server_mon, char *endpoint) { void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int rc = zmq_setsockopt (client, ZMQ_GSSAPI_SERVICE_PRINCIPAL, name, strlen (name) + 1); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_GSSAPI_PRINCIPAL, name, strlen (name) + 1); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API int name_type = ZMQ_GSSAPI_NT_HOSTBASED; rc = zmq_setsockopt (client, ZMQ_GSSAPI_PRINCIPAL_NAMETYPE, &name_type, sizeof (name_type)); assert (rc == 0); #endif rc = zmq_connect (client, endpoint); assert (rc == 0); bounce (server, client); rc = zmq_close (client); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API int event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_HANDSHAKE_SUCCEEDED); #endif } // Check security with valid but unauthorized credentials // Note: ZAP may see multiple requests - after a failure, client will // fall back to other crypto types for principal, if available. void test_unauth_creds (void *ctx, void *server, void *server_mon, char *endpoint) { void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int rc = zmq_setsockopt (client, ZMQ_GSSAPI_SERVICE_PRINCIPAL, name, strlen (name) + 1); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_GSSAPI_PRINCIPAL, name, strlen (name) + 1); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API int name_type = ZMQ_GSSAPI_NT_HOSTBASED; rc = zmq_setsockopt (client, ZMQ_GSSAPI_PRINCIPAL_NAMETYPE, &name_type, sizeof (name_type)); assert (rc == 0); #endif zap_deny_all = 1; rc = zmq_connect (client, endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); #ifdef ZMQ_BUILD_DRAFT_API int event = get_monitor_event (server_mon, NULL, NULL); assert (event == ZMQ_EVENT_HANDSHAKE_FAILED_AUTH); #endif } // Check GSSAPI security with NULL client credentials // This must be caught by the gssapi_server class, not passed to ZAP void test_null_creds (void *ctx, void *server, void *server_mon, char *endpoint) { void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int rc = zmq_connect (client, endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); #ifdef ZMQ_BUILD_DRAFT_API int error; int event = get_monitor_event (server_mon, &error, NULL); assert (event == ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL); assert (error == ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH); #endif } // Check GSSAPI security with PLAIN client credentials // This must be caught by the curve_server class, not passed to ZAP void test_plain_creds (void *ctx, void *server, void *server_mon, char *endpoint) { void *client = zmq_socket (ctx, ZMQ_DEALER); assert (client); int rc = zmq_setsockopt (client, ZMQ_PLAIN_USERNAME, "admin", 5); assert (rc == 0); rc = zmq_setsockopt (client, ZMQ_PLAIN_PASSWORD, "password", 8); assert (rc == 0); rc = zmq_connect (client, endpoint); assert (rc == 0); expect_bounce_fail (server, client); close_zero_linger (client); } // Unauthenticated messages from a vanilla socket shouldn't be received void test_vanilla_socket (void *ctx, void *server, void *server_mon, char *endpoint) { struct sockaddr_in ip4addr; int s; unsigned short int port; int rc = sscanf (endpoint, "tcp://127.0.0.1:%hu", &port); assert (rc == 1); ip4addr.sin_family = AF_INET; ip4addr.sin_port = htons (port); #if defined(ZMQ_HAVE_WINDOWS) && (_WIN32_WINNT < 0x0600) ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1"); #else inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #endif s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); rc = connect (s, (struct sockaddr *) &ip4addr, sizeof (ip4addr)); assert (rc > -1); // send anonymous ZMTP/1.0 greeting send (s, "\x01\x00", 2, 0); // send sneaky message that shouldn't be received send (s, "\x08\x00sneaky\0", 9, 0); int timeout = 250; zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (timeout)); char *buf = s_recv (server); if (buf != NULL) { printf ("Received unauthenticated message: %s\n", buf); assert (buf == NULL); } close (s); } int main (void) { if (!getenv ("KRB5_KTNAME") || !getenv ("KRB5_CLIENT_KTNAME")) { printf ("KRB5 environment unavailable, skipping test\n"); return 77; // SKIP } // Avoid entanglements with user's credential cache setenv ("KRB5CCNAME", "MEMORY", 1); setup_test_environment (); void *ctx = zmq_ctx_new (); assert (ctx); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; // Spawn ZAP handler // We create and bind ZAP socket in main thread to avoid case // where child thread does not start up fast enough. void *handler = zmq_socket (ctx, ZMQ_REP); assert (handler); int rc = zmq_bind (handler, "inproc://zeromq.zap.01"); assert (rc == 0); void *zap_thread = zmq_threadstart (&zap_handler, handler); // Server socket will accept connections void *server = zmq_socket (ctx, ZMQ_DEALER); assert (server); int as_server = 1; rc = zmq_setsockopt (server, ZMQ_GSSAPI_SERVER, &as_server, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (server, ZMQ_GSSAPI_PRINCIPAL, name, strlen (name) + 1); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API int name_type = ZMQ_GSSAPI_NT_HOSTBASED; rc = zmq_setsockopt (server, ZMQ_GSSAPI_PRINCIPAL_NAMETYPE, &name_type, sizeof (name_type)); assert (rc == 0); #endif rc = zmq_bind (server, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (server, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); #ifdef ZMQ_BUILD_DRAFT_API // Monitor handshake events on the server rc = zmq_socket_monitor (server, "inproc://monitor-server", ZMQ_EVENT_HANDSHAKE_SUCCEEDED | ZMQ_EVENT_HANDSHAKE_FAILED_AUTH | ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL); assert (rc == 0); #endif // Create socket for collecting monitor events void *server_mon = NULL; #ifdef ZMQ_BUILD_DRAFT_API server_mon = zmq_socket (ctx, ZMQ_PAIR); assert (server_mon); #endif // Connect it to the inproc endpoints so they'll get events rc = zmq_connect (server_mon, "inproc://monitor-server"); assert (rc == 0); // Attempt various connections test_valid_creds (ctx, server, server_mon, my_endpoint); test_null_creds (ctx, server, server_mon, my_endpoint); test_plain_creds (ctx, server, server_mon, my_endpoint); test_vanilla_socket (ctx, server, server_mon, my_endpoint); test_unauth_creds (ctx, server, server_mon, my_endpoint); // Shutdown #ifdef ZMQ_BUILD_DRAFT_API close_zero_linger (server_mon); #endif rc = zmq_close (server); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); // Wait until ZAP handler terminates zmq_threadclose (zap_thread); return 0; } zeromq-4.2.5/tests/test_connect_rid.cpp0000664000372000037200000001433013255253220021135 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" void test_stream_2_stream () { void *rbind, *rconn1; int ret; char buff[256]; char msg[] = "hi 1"; const char *bindip = "tcp://127.0.0.1:*"; int disabled = 0; int zero = 0; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); // Set up listener STREAM. rbind = zmq_socket (ctx, ZMQ_STREAM); assert (rbind); ret = zmq_setsockopt (rbind, ZMQ_STREAM_NOTIFY, &disabled, sizeof (disabled)); assert (ret == 0); ret = zmq_setsockopt (rbind, ZMQ_LINGER, &zero, sizeof (zero)); assert (0 == ret); ret = zmq_bind (rbind, bindip); assert (0 == ret); ret = zmq_getsockopt (rbind, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (0 == ret); // Set up connection stream. rconn1 = zmq_socket (ctx, ZMQ_STREAM); assert (rconn1); ret = zmq_setsockopt (rconn1, ZMQ_LINGER, &zero, sizeof (zero)); assert (0 == ret); // Do the connection. ret = zmq_setsockopt (rconn1, ZMQ_CONNECT_ROUTING_ID, "conn1", 6); assert (0 == ret); ret = zmq_connect (rconn1, my_endpoint); /* Uncomment to test assert on duplicate routing id. // Test duplicate connect attempt. ret = zmq_setsockopt (rconn1, ZMQ_CONNECT_ROUTING_ID, "conn1", 6); assert (0 == ret); ret = zmq_connect (rconn1, bindip); assert (0 == ret); */ // Send data to the bound stream. ret = zmq_send (rconn1, "conn1", 6, ZMQ_SNDMORE); assert (6 == ret); ret = zmq_send (rconn1, msg, 5, 0); assert (5 == ret); // Accept data on the bound stream. ret = zmq_recv (rbind, buff, 256, 0); assert (ret); assert (0 == buff[0]); ret = zmq_recv (rbind, buff + 128, 128, 0); assert (5 == ret); assert ('h' == buff[128]); // Handle close of the socket. ret = zmq_unbind (rbind, my_endpoint); assert (0 == ret); ret = zmq_close (rbind); assert (0 == ret); ret = zmq_close (rconn1); assert (0 == ret); zmq_ctx_destroy (ctx); } void test_router_2_router (bool named) { void *rbind, *rconn1; int ret; char buff[256]; char msg[] = "hi 1"; const char *bindip = "tcp://127.0.0.1:*"; int zero = 0; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); // Create bind socket. rbind = zmq_socket (ctx, ZMQ_ROUTER); assert (rbind); ret = zmq_setsockopt (rbind, ZMQ_LINGER, &zero, sizeof (zero)); assert (0 == ret); ret = zmq_bind (rbind, bindip); assert (0 == ret); ret = zmq_getsockopt (rbind, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (0 == ret); // Create connection socket. rconn1 = zmq_socket (ctx, ZMQ_ROUTER); assert (rconn1); ret = zmq_setsockopt (rconn1, ZMQ_LINGER, &zero, sizeof (zero)); assert (0 == ret); // If we're in named mode, set some identities. if (named) { ret = zmq_setsockopt (rbind, ZMQ_ROUTING_ID, "X", 1); ret = zmq_setsockopt (rconn1, ZMQ_ROUTING_ID, "Y", 1); } // Make call to connect using a connect_routing_id. ret = zmq_setsockopt (rconn1, ZMQ_CONNECT_ROUTING_ID, "conn1", 6); assert (0 == ret); ret = zmq_connect (rconn1, my_endpoint); assert (0 == ret); /* Uncomment to test assert on duplicate routing id // Test duplicate connect attempt. ret = zmq_setsockopt (rconn1, ZMQ_CONNECT_ROUTING_ID, "conn1", 6); assert (0 == ret); ret = zmq_connect (rconn1, bindip); assert (0 == ret); */ // Send some data. ret = zmq_send (rconn1, "conn1", 6, ZMQ_SNDMORE); assert (6 == ret); ret = zmq_send (rconn1, msg, 5, 0); assert (5 == ret); // Receive the name. ret = zmq_recv (rbind, buff, 256, 0); if (named) assert (ret && 'Y' == buff[0]); else assert (ret && 0 == buff[0]); // Receive the data. ret = zmq_recv (rbind, buff + 128, 128, 0); assert (5 == ret && 'h' == buff[128]); // Send some data back. if (named) { ret = zmq_send (rbind, buff, 1, ZMQ_SNDMORE); assert (1 == ret); } else { ret = zmq_send (rbind, buff, 5, ZMQ_SNDMORE); assert (5 == ret); } ret = zmq_send_const (rbind, "ok", 3, 0); assert (3 == ret); // If bound socket identity naming a problem, we'll likely see something funky here. ret = zmq_recv (rconn1, buff, 256, 0); assert ('c' == buff[0] && 6 == ret); ret = zmq_recv (rconn1, buff + 128, 128, 0); assert (3 == ret && 'o' == buff[128]); ret = zmq_unbind (rbind, my_endpoint); assert (0 == ret); ret = zmq_close (rbind); assert (0 == ret); ret = zmq_close (rconn1); assert (0 == ret); zmq_ctx_destroy (ctx); } int main (void) { setup_test_environment (); test_stream_2_stream (); test_router_2_router (false); test_router_2_router (true); return 0; } zeromq-4.2.5/tests/test_conflate.cpp0000664000372000037200000000544413255253220020447 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } void test_x () { const char *bind_to = "tcp://127.0.0.1:*"; size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; int rc; void *s_in = test_context_socket (ZMQ_PULL); int conflate = 1; TEST_ASSERT_SUCCESS_ERRNO ( zmq_setsockopt (s_in, ZMQ_CONFLATE, &conflate, sizeof (conflate))); TEST_ASSERT_SUCCESS_ERRNO (zmq_bind (s_in, bind_to)); TEST_ASSERT_SUCCESS_ERRNO ( zmq_getsockopt (s_in, ZMQ_LAST_ENDPOINT, my_endpoint, &len)); void *s_out = test_context_socket (ZMQ_PUSH); TEST_ASSERT_SUCCESS_ERRNO (zmq_connect (s_out, my_endpoint)); int message_count = 20; for (int j = 0; j < message_count; ++j) { TEST_ASSERT_SUCCESS_ERRNO ( zmq_send (s_out, (void *) &j, sizeof (int), 0)); } msleep (SETTLE_TIME); int payload_recved = 0; rc = TEST_ASSERT_SUCCESS_ERRNO ( zmq_recv (s_in, (void *) &payload_recved, sizeof (int), 0)); TEST_ASSERT_GREATER_THAN_INT (0, rc); TEST_ASSERT_EQUAL_INT (message_count - 1, payload_recved); test_context_socket_close (s_in); test_context_socket_close (s_out); } int main (int, char *[]) { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_x); return UNITY_END (); } zeromq-4.2.5/tests/test_invalid_rep.cpp0000664000372000037200000000636113255253220021147 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); // Create REQ/ROUTER wiring. void *ctx = zmq_ctx_new (); assert (ctx); void *router_socket = zmq_socket (ctx, ZMQ_ROUTER); assert (router_socket); void *req_socket = zmq_socket (ctx, ZMQ_REQ); assert (req_socket); int linger = 0; int rc = zmq_setsockopt (router_socket, ZMQ_LINGER, &linger, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (req_socket, ZMQ_LINGER, &linger, sizeof (int)); assert (rc == 0); rc = zmq_bind (router_socket, "inproc://hi"); assert (rc == 0); rc = zmq_connect (req_socket, "inproc://hi"); assert (rc == 0); // Initial request. rc = zmq_send (req_socket, "r", 1, 0); assert (rc == 1); // Receive the request. char addr[32]; int addr_size; char bottom[1]; char body[1]; addr_size = zmq_recv (router_socket, addr, sizeof (addr), 0); assert (addr_size >= 0); rc = zmq_recv (router_socket, bottom, sizeof (bottom), 0); assert (rc == 0); rc = zmq_recv (router_socket, body, sizeof (body), 0); assert (rc == 1); // Send invalid reply. rc = zmq_send (router_socket, addr, addr_size, 0); assert (rc == addr_size); // Send valid reply. rc = zmq_send (router_socket, addr, addr_size, ZMQ_SNDMORE); assert (rc == addr_size); rc = zmq_send (router_socket, bottom, 0, ZMQ_SNDMORE); assert (rc == 0); rc = zmq_send (router_socket, "b", 1, 0); assert (rc == 1); // Check whether we've got the valid reply. rc = zmq_recv (req_socket, body, sizeof (body), 0); assert (rc == 1); assert (body[0] == 'b'); // Tear down the wiring. rc = zmq_close (router_socket); assert (rc == 0); rc = zmq_close (req_socket); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_sockopt_hwm.cpp0000664000372000037200000001411413255253220021203 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #include "testutil_unity.hpp" #include void setUp () { setup_test_context (); } void tearDown () { teardown_test_context (); } const int MAX_SENDS = 10000; void test_change_before_connected () { int rc; void *bind_socket = test_context_socket (ZMQ_PUSH); void *connect_socket = test_context_socket (ZMQ_PULL); int val = 2; rc = zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); zmq_connect (connect_socket, "inproc://a"); zmq_bind (bind_socket, "inproc://a"); size_t placeholder = sizeof (val); val = 0; rc = zmq_getsockopt (bind_socket, ZMQ_SNDHWM, &val, &placeholder); TEST_ASSERT_EQUAL_INT (0, rc); TEST_ASSERT_EQUAL_INT (2, val); int send_count = 0; while (send_count < MAX_SENDS && zmq_send (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; TEST_ASSERT_EQUAL_INT (4, send_count); test_context_socket_close (bind_socket); test_context_socket_close (connect_socket); } void test_change_after_connected () { int rc; void *bind_socket = test_context_socket (ZMQ_PUSH); void *connect_socket = test_context_socket (ZMQ_PULL); int val = 1; rc = zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); zmq_connect (connect_socket, "inproc://a"); zmq_bind (bind_socket, "inproc://a"); val = 5; rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); size_t placeholder = sizeof (val); val = 0; rc = zmq_getsockopt (bind_socket, ZMQ_SNDHWM, &val, &placeholder); TEST_ASSERT_EQUAL_INT (0, rc); TEST_ASSERT_EQUAL_INT (5, val); int send_count = 0; while (send_count < MAX_SENDS && zmq_send (bind_socket, NULL, 0, ZMQ_DONTWAIT) == 0) ++send_count; TEST_ASSERT_EQUAL_INT (6, send_count); test_context_socket_close (bind_socket); test_context_socket_close (connect_socket); } int send_until_wouldblock (void *socket) { int send_count = 0; while (send_count < MAX_SENDS && zmq_send (socket, &send_count, sizeof (send_count), ZMQ_DONTWAIT) == sizeof (send_count)) { ++send_count; } return send_count; } int test_fill_up_to_hwm (void *socket, int sndhwm) { int send_count = send_until_wouldblock (socket); fprintf (stderr, "sndhwm==%i, send_count==%i\n", sndhwm, send_count); TEST_ASSERT_LESS_OR_EQUAL_INT (sndhwm + 1, send_count); TEST_ASSERT_GREATER_THAN_INT (sndhwm / 10, send_count); return send_count; } void test_decrease_when_full () { int rc; void *bind_socket = test_context_socket (ZMQ_PUSH); void *connect_socket = test_context_socket (ZMQ_PULL); int val = 1; rc = zmq_setsockopt (connect_socket, ZMQ_RCVHWM, &val, sizeof (val)); TEST_ASSERT_EQUAL_INT (0, rc); int sndhwm = 100; rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &sndhwm, sizeof (sndhwm)); TEST_ASSERT_EQUAL_INT (0, rc); zmq_bind (bind_socket, "inproc://a"); zmq_connect (connect_socket, "inproc://a"); // Fill up to hwm int send_count = test_fill_up_to_hwm (bind_socket, sndhwm); // Decrease snd hwm sndhwm = 70; rc = zmq_setsockopt (bind_socket, ZMQ_SNDHWM, &sndhwm, sizeof (sndhwm)); TEST_ASSERT_EQUAL_INT (0, rc); int sndhwm_read = 0; size_t sndhwm_read_size = sizeof (sndhwm_read); rc = zmq_getsockopt (bind_socket, ZMQ_SNDHWM, &sndhwm_read, &sndhwm_read_size); TEST_ASSERT_EQUAL_INT (0, rc); TEST_ASSERT_EQUAL_INT (sndhwm, sndhwm_read); msleep (SETTLE_TIME); // Read out all data (should get up to previous hwm worth so none were dropped) int read_count = 0; int read_data = 0; while ( read_count < MAX_SENDS && zmq_recv (connect_socket, &read_data, sizeof (read_data), ZMQ_DONTWAIT) == sizeof (read_data)) { TEST_ASSERT_EQUAL_INT (read_data, read_count); ++read_count; } TEST_ASSERT_EQUAL_INT (send_count, read_count); // Give io thread some time to catch up msleep (SETTLE_TIME); // Fill up to new hwm test_fill_up_to_hwm (bind_socket, sndhwm); test_context_socket_close (bind_socket); test_context_socket_close (connect_socket); } int main () { setup_test_environment (); UNITY_BEGIN (); RUN_TEST (test_change_before_connected); RUN_TEST (test_change_after_connected); RUN_TEST (test_decrease_when_full); return UNITY_END (); } zeromq-4.2.5/tests/test_connect_delay_tipc.cpp0000664000372000037200000001677513255253220022513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { if (!is_tipc_available ()) { printf ("TIPC environment unavailable, skipping test\n"); return 77; } int val; int rc; char buffer[16]; // TEST 1. // First we're going to attempt to send messages to two // pipes, one connected, the other not. We should see // the PUSH load balancing to both pipes, and hence half // of the messages getting queued, as connect() creates a // pipe immediately. void *context = zmq_ctx_new (); assert (context); void *to = zmq_socket (context, ZMQ_PULL); assert (to); // Bind the one valid receiver val = 0; rc = zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof (val)); assert (rc == 0); rc = zmq_bind (to, "tipc://{6555,0,0}"); assert (rc == 0); // Create a socket pushing to two endpoints - only 1 message should arrive. void *from = zmq_socket (context, ZMQ_PUSH); assert (from); val = 0; zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof (val)); // This pipe will not connect rc = zmq_connect (from, "tipc://{5556,0}@0.0.0"); assert (rc == 0); // This pipe will rc = zmq_connect (from, "tipc://{6555,0}@0.0.0"); assert (rc == 0); // We send 10 messages, 5 should just get stuck in the queue // for the not-yet-connected pipe for (int i = 0; i < 10; ++i) { rc = zmq_send (from, "Hello", 5, 0); assert (rc == 5); } // We now consume from the connected pipe // - we should see just 5 int timeout = 250; rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); int seen = 0; while (true) { rc = zmq_recv (to, &buffer, sizeof (buffer), 0); if (rc == -1) break; // Break when we didn't get a message seen++; } assert (seen == 5); rc = zmq_close (from); assert (rc == 0); rc = zmq_close (to); assert (rc == 0); rc = zmq_ctx_term (context); assert (rc == 0); // TEST 2 // This time we will do the same thing, connect two pipes, // one of which will succeed in connecting to a bound // receiver, the other of which will fail. However, we will // also set the delay attach on connect flag, which should // cause the pipe attachment to be delayed until the connection // succeeds. context = zmq_ctx_new (); // Bind the valid socket to = zmq_socket (context, ZMQ_PULL); assert (to); rc = zmq_bind (to, "tipc://{5560,0,0}"); assert (rc == 0); val = 0; rc = zmq_setsockopt (to, ZMQ_LINGER, &val, sizeof (val)); assert (rc == 0); // Create a socket pushing to two endpoints - all messages should arrive. from = zmq_socket (context, ZMQ_PUSH); assert (from); val = 0; rc = zmq_setsockopt (from, ZMQ_LINGER, &val, sizeof (val)); assert (rc == 0); // Set the key flag val = 1; rc = zmq_setsockopt (from, ZMQ_DELAY_ATTACH_ON_CONNECT, &val, sizeof (val)); assert (rc == 0); // Connect to the invalid socket rc = zmq_connect (from, "tipc://{5561,0}@0.0.0"); assert (rc == 0); // Connect to the valid socket rc = zmq_connect (from, "tipc://{5560,0}@0.0.0"); assert (rc == 0); // Send 10 messages, all should be routed to the connected pipe for (int i = 0; i < 10; ++i) { rc = zmq_send (from, "Hello", 5, 0); assert (rc == 5); } rc = zmq_setsockopt (to, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); seen = 0; while (true) { rc = zmq_recv (to, &buffer, sizeof (buffer), 0); if (rc == -1) break; // Break when we didn't get a message seen++; } assert (seen == 10); rc = zmq_close (from); assert (rc == 0); rc = zmq_close (to); assert (rc == 0); rc = zmq_ctx_term (context); assert (rc == 0); // TEST 3 // This time we want to validate that the same blocking behaviour // occurs with an existing connection that is broken. We will send // messages to a connected pipe, disconnect and verify the messages // block. Then we reconnect and verify messages flow again. context = zmq_ctx_new (); void *backend = zmq_socket (context, ZMQ_DEALER); assert (backend); void *frontend = zmq_socket (context, ZMQ_DEALER); assert (frontend); int zero = 0; rc = zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); rc = zmq_setsockopt (frontend, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); // Frontend connects to backend using DELAY_ATTACH_ON_CONNECT int on = 1; rc = zmq_setsockopt (frontend, ZMQ_DELAY_ATTACH_ON_CONNECT, &on, sizeof (on)); assert (rc == 0); rc = zmq_bind (backend, "tipc://{5560,0,0}"); assert (rc == 0); rc = zmq_connect (frontend, "tipc://{5560,0}@0.0.0"); assert (rc == 0); // Ping backend to frontend so we know when the connection is up rc = zmq_send (backend, "Hello", 5, 0); assert (rc == 5); rc = zmq_recv (frontend, buffer, 255, 0); assert (rc == 5); // Send message from frontend to backend rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT); assert (rc == 5); rc = zmq_close (backend); assert (rc == 0); // Give time to process disconnect msleep (SETTLE_TIME); // Send a message, should fail rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT); assert (rc == -1); // Recreate backend socket backend = zmq_socket (context, ZMQ_DEALER); assert (backend); rc = zmq_setsockopt (backend, ZMQ_LINGER, &zero, sizeof (zero)); assert (rc == 0); rc = zmq_bind (backend, "tipc://{5560,0,0}"); assert (rc == 0); // Ping backend to frontend so we know when the connection is up rc = zmq_send (backend, "Hello", 5, 0); assert (rc == 5); rc = zmq_recv (frontend, buffer, 255, 0); assert (rc == 5); // After the reconnect, should succeed rc = zmq_send (frontend, "Hello", 5, ZMQ_DONTWAIT); assert (rc == 5); rc = zmq_close (backend); assert (rc == 0); rc = zmq_close (frontend); assert (rc == 0); rc = zmq_ctx_term (context); assert (rc == 0); } zeromq-4.2.5/tests/test_use_fd_tcp.cpp0000664000372000037200000001324113255253220020761 0ustar00travistravis00000000000000/* Copyright (c) 2016-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" #if !defined(ZMQ_HAVE_WINDOWS) #include uint16_t pre_allocate_sock (void *zmq_socket, const char *address, const char *port) { struct addrinfo *addr, hint; hint.ai_flags = 0; hint.ai_family = AF_INET; hint.ai_socktype = SOCK_STREAM; hint.ai_protocol = IPPROTO_TCP; hint.ai_addrlen = 0; hint.ai_canonname = NULL; hint.ai_addr = NULL; hint.ai_next = NULL; int rc = getaddrinfo (address, port, &hint, &addr); assert (rc == 0); int s_pre = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); assert (s_pre != -1); int flag = 1; rc = setsockopt (s_pre, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof (int)); assert (rc == 0); rc = bind (s_pre, addr->ai_addr, addr->ai_addrlen); assert (rc == 0); rc = listen (s_pre, SOMAXCONN); assert (rc == 0); rc = zmq_setsockopt (zmq_socket, ZMQ_USE_FD, &s_pre, sizeof (s_pre)); assert (rc == 0); struct sockaddr_in sin; socklen_t len = sizeof (sin); rc = getsockname (s_pre, (struct sockaddr *) &sin, &len); assert (rc != -1); freeaddrinfo (addr); return ntohs (sin.sin_port); } void test_req_rep () { char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_REP); assert (sb); uint16_t port = pre_allocate_sock (sb, "127.0.0.1", "0"); sprintf (my_endpoint, "tcp://127.0.0.1:%u", port); int rc = zmq_bind (sb, my_endpoint); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_REQ); assert (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_pair () { char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_PAIR); assert (sb); uint16_t port = pre_allocate_sock (sb, "127.0.0.1", "0"); sprintf (my_endpoint, "tcp://127.0.0.1:%u", port); int rc = zmq_bind (sb, my_endpoint); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_PAIR); assert (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); bounce (sb, sc); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); } void test_client_server () { #if defined(ZMQ_SERVER) && defined(ZMQ_CLIENT) char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_SERVER); assert (sb); uint16_t port = pre_allocate_sock (sb, "127.0.0.1", "0"); sprintf (my_endpoint, "tcp://127.0.0.1:%u", port); int rc = zmq_bind (sb, my_endpoint); assert (rc == 0); void *sc = zmq_socket (ctx, ZMQ_CLIENT); assert (sc); rc = zmq_connect (sc, my_endpoint); assert (rc == 0); zmq_msg_t msg; rc = zmq_msg_init_size (&msg, 1); assert (rc == 0); char *data = (char *) zmq_msg_data (&msg); data[0] = 1; rc = zmq_msg_send (&msg, sc, ZMQ_SNDMORE); assert (rc == -1); rc = zmq_msg_send (&msg, sc, 0); assert (rc == 1); rc = zmq_msg_init (&msg); assert (rc == 0); rc = zmq_msg_recv (&msg, sb, 0); assert (rc == 1); uint32_t routing_id = zmq_msg_routing_id (&msg); assert (routing_id != 0); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_msg_init_size (&msg, 1); assert (rc == 0); data = (char *) zmq_msg_data (&msg); data[0] = 2; rc = zmq_msg_set_routing_id (&msg, routing_id); assert (rc == 0); rc = zmq_msg_send (&msg, sb, ZMQ_SNDMORE); assert (rc == -1); rc = zmq_msg_send (&msg, sb, 0); assert (rc == 1); rc = zmq_msg_recv (&msg, sc, 0); assert (rc == 1); routing_id = zmq_msg_routing_id (&msg); assert (routing_id == 0); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_close (sc); assert (rc == 0); rc = zmq_close (sb); assert (rc == 0); rc = zmq_ctx_term (ctx); assert (rc == 0); #endif } int main (void) { setup_test_environment (); test_req_rep (); test_pair (); test_client_server (); return 0; } #else int main (void) { return 0; } #endif zeromq-4.2.5/tests/test_req_correlate.cpp0000664000372000037200000001054113255253220021475 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" int main (void) { setup_test_environment (); size_t len = MAX_SOCKET_STRING; char my_endpoint[MAX_SOCKET_STRING]; void *ctx = zmq_ctx_new (); assert (ctx); void *req = zmq_socket (ctx, ZMQ_REQ); assert (req); void *router = zmq_socket (ctx, ZMQ_ROUTER); assert (router); int enabled = 1; int rc = zmq_setsockopt (req, ZMQ_REQ_CORRELATE, &enabled, sizeof (int)); assert (rc == 0); int rcvtimeo = 100; rc = zmq_setsockopt (req, ZMQ_RCVTIMEO, &rcvtimeo, sizeof (int)); assert (rc == 0); rc = zmq_bind (router, "tcp://127.0.0.1:*"); assert (rc == 0); rc = zmq_getsockopt (router, ZMQ_LAST_ENDPOINT, my_endpoint, &len); assert (rc == 0); rc = zmq_connect (req, my_endpoint); assert (rc == 0); // Send a multi-part request. s_send_seq (req, "ABC", "DEF", SEQ_END); zmq_msg_t msg; zmq_msg_init (&msg); // Receive peer routing id rc = zmq_msg_recv (&msg, router, 0); assert (rc != -1); assert (zmq_msg_size (&msg) > 0); zmq_msg_t peer_id_msg; zmq_msg_init (&peer_id_msg); zmq_msg_copy (&peer_id_msg, &msg); int more = 0; size_t more_size = sizeof (more); rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); assert (more); // Receive request id 1 rc = zmq_msg_recv (&msg, router, 0); assert (rc != -1); assert (zmq_msg_size (&msg) == sizeof (uint32_t)); uint32_t req_id = *static_cast (zmq_msg_data (&msg)); zmq_msg_t req_id_msg; zmq_msg_init (&req_id_msg); zmq_msg_copy (&req_id_msg, &msg); more = 0; more_size = sizeof (more); rc = zmq_getsockopt (router, ZMQ_RCVMORE, &more, &more_size); assert (rc == 0); assert (more); // Receive the rest. s_recv_seq (router, 0, "ABC", "DEF", SEQ_END); uint32_t bad_req_id = req_id + 1; // Send back a bad reply: wrong req id, 0, data zmq_msg_copy (&msg, &peer_id_msg); rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE); assert (rc != -1); zmq_msg_init_data (&msg, &bad_req_id, sizeof (uint32_t), NULL, NULL); rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE); assert (rc != -1); s_send_seq (router, 0, "DATA", SEQ_END); // Send back a good reply: good req id, 0, data zmq_msg_copy (&msg, &peer_id_msg); rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE); assert (rc != -1); zmq_msg_copy (&msg, &req_id_msg); rc = zmq_msg_send (&msg, router, ZMQ_SNDMORE); assert (rc != -1); s_send_seq (router, 0, "GHI", SEQ_END); // Receive reply. If bad reply got through, we wouldn't see // this particular data. s_recv_seq (req, "GHI", SEQ_END); rc = zmq_msg_close (&msg); assert (rc == 0); rc = zmq_msg_close (&peer_id_msg); assert (rc == 0); rc = zmq_msg_close (&req_id_msg); assert (rc == 0); close_zero_linger (req); close_zero_linger (router); rc = zmq_ctx_term (ctx); assert (rc == 0); return 0; } zeromq-4.2.5/tests/test_filter_ipc.cpp0000664000372000037200000001322413255253220020767 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "testutil.hpp" static void bounce_fail (void *server, void *client) { const char *content = "12345678ABCDEFGH12345678abcdefgh"; char buffer[32]; // Send message from client to server int rc = zmq_send (client, content, 32, ZMQ_SNDMORE); assert (rc == 32); rc = zmq_send (client, content, 32, 0); assert (rc == 32); // Receive message at server side (should not succeed) int timeout = 250; rc = zmq_setsockopt (server, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_recv (server, buffer, 32, 0); assert (rc == -1); assert (zmq_errno () == EAGAIN); // Send message from server to client to test other direction rc = zmq_setsockopt (server, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_send (server, content, 32, ZMQ_SNDMORE); assert (rc == -1); assert (zmq_errno () == EAGAIN); } template static void run_test (int opt, T optval, int expected_error, int bounce_test) { int rc; void *ctx = zmq_ctx_new (); assert (ctx); void *sb = zmq_socket (ctx, ZMQ_DEALER); assert (sb); if (opt) { rc = zmq_setsockopt (sb, opt, &optval, sizeof (optval)); if (expected_error) { assert (rc == -1); assert (zmq_errno () == expected_error); } else assert (rc == 0); } void *sc = zmq_socket (ctx, ZMQ_DEALER); assert (sc); // If a test fails, don't hang for too long int timeout = 2500; rc = zmq_setsockopt (sb, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sb, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sc, ZMQ_RCVTIMEO, &timeout, sizeof (int)); assert (rc == 0); rc = zmq_setsockopt (sc, ZMQ_SNDTIMEO, &timeout, sizeof (int)); assert (rc == 0); int interval = -1; rc = zmq_setsockopt (sc, ZMQ_RECONNECT_IVL, &interval, sizeof (int)); assert (rc == 0); if (bounce_test) { const char *endpoint = "ipc://test_filter_ipc.sock"; int rc = zmq_bind (sb, endpoint); assert (rc == 0); rc = zmq_connect (sc, endpoint); assert (rc == 0); if (bounce_test > 0) bounce (sb, sc); else bounce_fail (sb, sc); } close_zero_linger (sc); close_zero_linger (sb); rc = zmq_ctx_term (ctx); assert (rc == 0); } int main (void) { #if !defined(ZMQ_HAVE_WINDOWS) setup_test_environment (); // No filters run_test (0, 0, 0, 1); #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED // Get the group and supplimental groups of the process owner gid_t groups[100]; int ngroups = getgroups (100, groups); assert (ngroups != -1); gid_t group = getgid (), supgroup = group, notgroup = group + 1; for (int i = 0; i < ngroups; i++) { if (supgroup == group && group != groups[i]) supgroup = groups[i]; if (notgroup <= groups[i]) notgroup = groups[i] + 1; } // Test filter with UID of process owner run_test (ZMQ_IPC_FILTER_UID, getuid (), 0, 1); // Test filter with UID of another (possibly non-existent) user run_test (ZMQ_IPC_FILTER_UID, getuid () + 1, 0, -1); // Test filter with GID of process owner run_test (ZMQ_IPC_FILTER_GID, group, 0, 1); // Test filter with supplimental group of process owner run_test (ZMQ_IPC_FILTER_GID, supgroup, 0, 1); // Test filter with GID of another (possibly non-existent) group run_test (ZMQ_IPC_FILTER_GID, notgroup, 0, -1); #if defined ZMQ_HAVE_SO_PEERCRED // Test filter with PID of current process run_test (ZMQ_IPC_FILTER_PID, getpid (), 0, 1); // Test filter with PID of another (possibly non-existent) process run_test (ZMQ_IPC_FILTER_PID, getpid () + 1, 0, -1); #else // Setup of PID filter should fail with operation not supported error run_test (ZMQ_IPC_FILTER_PID, getpid (), EINVAL, 0); #endif #else run_test (ZMQ_IPC_FILTER_UID, 0, EINVAL, 0); run_test (ZMQ_IPC_FILTER_GID, 0, EINVAL, 0); run_test (ZMQ_IPC_FILTER_PID, 0, EINVAL, 0); #endif // defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED #endif return 0; } zeromq-4.2.5/external/0000775000372000037200000000000013255253302015563 5ustar00travistravis00000000000000zeromq-4.2.5/external/unity/0000775000372000037200000000000013255253302016733 5ustar00travistravis00000000000000zeromq-4.2.5/external/unity/unity.c0000664000372000037200000014033613255253220020255 0ustar00travistravis00000000000000/* ========================================================================= Unity Project - A Test Framework for C Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] ============================================================================ */ #define UNITY_INCLUDE_SETUP_STUBS #include "unity.h" #include /* If omitted from header, declare overrideable prototypes here so they're ready for use */ #ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION void UNITY_OUTPUT_CHAR(int); #endif /* Helpful macros for us to use here in Assert functions */ #define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; TEST_ABORT(); } #define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; TEST_ABORT(); } #define RETURN_IF_FAIL_OR_IGNORE if (Unity.CurrentTestFailed || Unity.CurrentTestIgnored) return struct UNITY_STORAGE_T Unity; #ifdef UNITY_OUTPUT_COLOR static const char UnityStrOk[] = "\033[42mOK\033[00m"; static const char UnityStrPass[] = "\033[42mPASS\033[00m"; static const char UnityStrFail[] = "\033[41mFAIL\033[00m"; static const char UnityStrIgnore[] = "\033[43mIGNORE\033[00m"; #else static const char UnityStrOk[] = "OK"; static const char UnityStrPass[] = "PASS"; static const char UnityStrFail[] = "FAIL"; static const char UnityStrIgnore[] = "IGNORE"; #endif static const char UnityStrNull[] = "NULL"; static const char UnityStrSpacer[] = ". "; static const char UnityStrExpected[] = " Expected "; static const char UnityStrWas[] = " Was "; static const char UnityStrGt[] = " to be greater than "; static const char UnityStrLt[] = " to be less than "; static const char UnityStrOrEqual[] = "or equal to "; static const char UnityStrElement[] = " Element "; static const char UnityStrByte[] = " Byte "; static const char UnityStrMemory[] = " Memory Mismatch."; static const char UnityStrDelta[] = " Values Not Within Delta "; static const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless."; static const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL"; static const char UnityStrNullPointerForActual[] = " Actual pointer was NULL"; #ifndef UNITY_EXCLUDE_FLOAT static const char UnityStrNot[] = "Not "; static const char UnityStrInf[] = "Infinity"; static const char UnityStrNegInf[] = "Negative Infinity"; static const char UnityStrNaN[] = "NaN"; static const char UnityStrDet[] = "Determinate"; static const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait"; #endif const char UnityStrErrFloat[] = "Unity Floating Point Disabled"; const char UnityStrErrDouble[] = "Unity Double Precision Disabled"; const char UnityStrErr64[] = "Unity 64-bit Support Disabled"; static const char UnityStrBreaker[] = "-----------------------"; static const char UnityStrResultsTests[] = " Tests "; static const char UnityStrResultsFailures[] = " Failures "; static const char UnityStrResultsIgnored[] = " Ignored "; static const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " "; static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " "; /*----------------------------------------------- * Pretty Printers & Test Result Output Handlers *-----------------------------------------------*/ void UnityPrint(const char* string) { const char* pch = string; if (pch != NULL) { while (*pch) { /* printable characters plus CR & LF are printed */ if ((*pch <= 126) && (*pch >= 32)) { UNITY_OUTPUT_CHAR(*pch); } /* write escaped carriage returns */ else if (*pch == 13) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('r'); } /* write escaped line feeds */ else if (*pch == 10) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('n'); } #ifdef UNITY_OUTPUT_COLOR /* print ANSI escape code */ else if (*pch == 27 && *(pch + 1) == '[') { while (*pch && *pch != 'm') { UNITY_OUTPUT_CHAR(*pch); pch++; } UNITY_OUTPUT_CHAR('m'); } #endif /* unprintable characters are shown as codes */ else { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('x'); UnityPrintNumberHex((UNITY_UINT)*pch, 2); } pch++; } } } void UnityPrintLen(const char* string, const UNITY_UINT32 length) { const char* pch = string; if (pch != NULL) { while (*pch && (UNITY_UINT32)(pch - string) < length) { /* printable characters plus CR & LF are printed */ if ((*pch <= 126) && (*pch >= 32)) { UNITY_OUTPUT_CHAR(*pch); } /* write escaped carriage returns */ else if (*pch == 13) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('r'); } /* write escaped line feeds */ else if (*pch == 10) { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('n'); } /* unprintable characters are shown as codes */ else { UNITY_OUTPUT_CHAR('\\'); UNITY_OUTPUT_CHAR('x'); UnityPrintNumberHex((UNITY_UINT)*pch, 2); } pch++; } } } /*-----------------------------------------------*/ void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style) { if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { UnityPrintNumber(number); } else if ((style & UNITY_DISPLAY_RANGE_UINT) == UNITY_DISPLAY_RANGE_UINT) { UnityPrintNumberUnsigned((UNITY_UINT)number); } else { UNITY_OUTPUT_CHAR('0'); UNITY_OUTPUT_CHAR('x'); UnityPrintNumberHex((UNITY_UINT)number, (char)((style & 0xF) * 2)); } } /*-----------------------------------------------*/ void UnityPrintNumber(const UNITY_INT number_to_print) { UNITY_UINT number = (UNITY_UINT)number_to_print; if (number_to_print < 0) { /* A negative number, including MIN negative */ UNITY_OUTPUT_CHAR('-'); number = (UNITY_UINT)(-number_to_print); } UnityPrintNumberUnsigned(number); } /*----------------------------------------------- * basically do an itoa using as little ram as possible */ void UnityPrintNumberUnsigned(const UNITY_UINT number) { UNITY_UINT divisor = 1; /* figure out initial divisor */ while (number / divisor > 9) { divisor *= 10; } /* now mod and print, then divide divisor */ do { UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10))); divisor /= 10; } while (divisor > 0); } /*-----------------------------------------------*/ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print) { int nibble; char nibbles = nibbles_to_print; if ((unsigned)nibbles > (2 * sizeof(number))) nibbles = 2 * sizeof(number); while (nibbles > 0) { nibbles--; nibble = (int)(number >> (nibbles * 4)) & 0x0F; if (nibble <= 9) { UNITY_OUTPUT_CHAR((char)('0' + nibble)); } else { UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble)); } } } /*-----------------------------------------------*/ void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number) { UNITY_UINT current_bit = (UNITY_UINT)1 << (UNITY_INT_WIDTH - 1); UNITY_INT32 i; for (i = 0; i < UNITY_INT_WIDTH; i++) { if (current_bit & mask) { if (current_bit & number) { UNITY_OUTPUT_CHAR('1'); } else { UNITY_OUTPUT_CHAR('0'); } } else { UNITY_OUTPUT_CHAR('X'); } current_bit = current_bit >> 1; } } /*-----------------------------------------------*/ #ifndef UNITY_EXCLUDE_FLOAT_PRINT /* This function prints a floating-point value in a format similar to * printf("%.6g"). It can work with either single- or double-precision, * but for simplicity, it prints only 6 significant digits in either case. * Printing more than 6 digits accurately is hard (at least in the single- * precision case) and isn't attempted here. */ void UnityPrintFloat(const UNITY_DOUBLE input_number) { UNITY_DOUBLE number = input_number; /* print minus sign (including for negative zero) */ if (number < 0.0f || (number == 0.0f && 1.0f / number < 0.0f)) { UNITY_OUTPUT_CHAR('-'); number = -number; } /* handle zero, NaN, and +/- infinity */ if (number == 0.0f) UnityPrint("0"); else if (isnan(number)) UnityPrint("nan"); else if (isinf(number)) UnityPrint("inf"); else { int exponent = 0; int decimals, digits; UNITY_INT32 n; char buf[16]; /* scale up or down by powers of 10 */ while (number < 100000.0f / 1e6f) { number *= 1e6f; exponent -= 6; } while (number < 100000.0f) { number *= 10.0f; exponent--; } while (number > 1000000.0f * 1e6f) { number /= 1e6f; exponent += 6; } while (number > 1000000.0f) { number /= 10.0f; exponent++; } /* round to nearest integer */ n = ((UNITY_INT32)(number + number) + 1) / 2; if (n > 999999) { n = 100000; exponent++; } /* determine where to place decimal point */ decimals = (exponent <= 0 && exponent >= -9) ? -exponent : 5; exponent += decimals; /* truncate trailing zeroes after decimal point */ while (decimals > 0 && n % 10 == 0) { n /= 10; decimals--; } /* build up buffer in reverse order */ digits = 0; while (n != 0 || digits < decimals + 1) { buf[digits++] = (char)('0' + n % 10); n /= 10; } while (digits > 0) { if(digits == decimals) UNITY_OUTPUT_CHAR('.'); UNITY_OUTPUT_CHAR(buf[--digits]); } /* print exponent if needed */ if (exponent != 0) { UNITY_OUTPUT_CHAR('e'); if(exponent < 0) { UNITY_OUTPUT_CHAR('-'); exponent = -exponent; } else { UNITY_OUTPUT_CHAR('+'); } digits = 0; while (exponent != 0 || digits < 2) { buf[digits++] = (char)('0' + exponent % 10); exponent /= 10; } while (digits > 0) { UNITY_OUTPUT_CHAR(buf[--digits]); } } } } #endif /* ! UNITY_EXCLUDE_FLOAT_PRINT */ /*-----------------------------------------------*/ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line) { UnityPrint(file); UNITY_OUTPUT_CHAR(':'); UnityPrintNumber((UNITY_INT)line); UNITY_OUTPUT_CHAR(':'); UnityPrint(Unity.CurrentTestName); UNITY_OUTPUT_CHAR(':'); } /*-----------------------------------------------*/ static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line) { UnityTestResultsBegin(Unity.TestFile, line); UnityPrint(UnityStrFail); UNITY_OUTPUT_CHAR(':'); } /*-----------------------------------------------*/ void UnityConcludeTest(void) { if (Unity.CurrentTestIgnored) { Unity.TestIgnores++; } else if (!Unity.CurrentTestFailed) { UnityTestResultsBegin(Unity.TestFile, Unity.CurrentTestLineNumber); UnityPrint(UnityStrPass); } else { Unity.TestFailures++; } Unity.CurrentTestFailed = 0; Unity.CurrentTestIgnored = 0; UNITY_PRINT_EOL(); UNITY_FLUSH_CALL(); } /*-----------------------------------------------*/ static void UnityAddMsgIfSpecified(const char* msg) { if (msg) { UnityPrint(UnityStrSpacer); #ifndef UNITY_EXCLUDE_DETAILS if (Unity.CurrentDetail1) { UnityPrint(UnityStrDetail1Name); UnityPrint(Unity.CurrentDetail1); if (Unity.CurrentDetail2) { UnityPrint(UnityStrDetail2Name); UnityPrint(Unity.CurrentDetail2); } UnityPrint(UnityStrSpacer); } #endif UnityPrint(msg); } } /*-----------------------------------------------*/ static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual) { UnityPrint(UnityStrExpected); if (expected != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrint(expected); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } UnityPrint(UnityStrWas); if (actual != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrint(actual); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } } /*-----------------------------------------------*/ static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const UNITY_UINT32 length) { UnityPrint(UnityStrExpected); if (expected != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrintLen(expected, length); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } UnityPrint(UnityStrWas); if (actual != NULL) { UNITY_OUTPUT_CHAR('\''); UnityPrintLen(actual, length); UNITY_OUTPUT_CHAR('\''); } else { UnityPrint(UnityStrNull); } } /*----------------------------------------------- * Assertion & Control Helpers *-----------------------------------------------*/ static int UnityIsOneArrayNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_LINE_TYPE lineNumber, const char* msg) { if (expected == actual) return 0; /* Both are NULL or same pointer */ /* print and return true if just expected is NULL */ if (expected == NULL) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrNullPointerForExpected); UnityAddMsgIfSpecified(msg); return 1; } /* print and return true if just actual is NULL */ if (actual == NULL) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrNullPointerForActual); UnityAddMsgIfSpecified(msg); return 1; } return 0; /* return false if neither is NULL */ } /*----------------------------------------------- * Assertion Functions *-----------------------------------------------*/ void UnityAssertBits(const UNITY_INT mask, const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { RETURN_IF_FAIL_OR_IGNORE; if ((mask & expected) != (mask & actual)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)expected); UnityPrint(UnityStrWas); UnityPrintMask((UNITY_UINT)mask, (UNITY_UINT)actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualNumber(const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { RETURN_IF_FAIL_OR_IGNORE; if (expected != actual) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(expected, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, const UNITY_INT actual, const UNITY_COMPARISON_T compare, const char *msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { int failed = 0; RETURN_IF_FAIL_OR_IGNORE; if (threshold == actual && compare & UNITY_EQUAL_TO) return; if (threshold == actual) failed = 1; if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { if (actual > threshold && compare & UNITY_SMALLER_THAN) failed = 1; if (actual < threshold && compare & UNITY_GREATER_THAN) failed = 1; } else /* UINT or HEX */ { if ((UNITY_UINT)actual > (UNITY_UINT)threshold && compare & UNITY_SMALLER_THAN) failed = 1; if ((UNITY_UINT)actual < (UNITY_UINT)threshold && compare & UNITY_GREATER_THAN) failed = 1; } if (failed) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(actual, style); if (compare & UNITY_GREATER_THAN) UnityPrint(UnityStrGt); if (compare & UNITY_SMALLER_THAN) UnityPrint(UnityStrLt); if (compare & UNITY_EQUAL_TO) UnityPrint(UnityStrOrEqual); UnityPrintNumberByStyle(threshold, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #define UnityPrintPointlessAndBail() \ { \ UnityTestResultsFailBegin(lineNumber); \ UnityPrint(UnityStrPointless); \ UnityAddMsgIfSpecified(msg); \ UNITY_FAIL_AND_BAIL; } /*-----------------------------------------------*/ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style, const UNITY_FLAGS_T flags) { UNITY_UINT32 elements = num_elements; unsigned int length = style & 0xF; RETURN_IF_FAIL_OR_IGNORE; if (num_elements == 0) { UnityPrintPointlessAndBail(); } if (expected == actual) return; /* Both are NULL or same pointer */ if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; while ((elements > 0) && elements--) { UNITY_INT expect_val; UNITY_INT actual_val; switch (length) { case 1: expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)expected; actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT8*)actual; break; case 2: expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)expected; actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT16*)actual; break; #ifdef UNITY_SUPPORT_64 case 8: expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)expected; actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT64*)actual; break; #endif default: /* length 4 bytes */ expect_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)expected; actual_val = *(UNITY_PTR_ATTRIBUTE const UNITY_INT32*)actual; length = 4; break; } if (expect_val != actual_val) { if (style & UNITY_DISPLAY_RANGE_UINT && length < sizeof(expect_val)) { /* For UINT, remove sign extension (padding 1's) from signed type casts above */ UNITY_INT mask = 1; mask = (mask << 8 * length) - 1; expect_val &= mask; actual_val &= mask; } UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(expect_val, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(actual_val, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } if (flags == UNITY_ARRAY_TO_ARRAY) { expected = (UNITY_INTERNAL_PTR)(length + (const char*)expected); } actual = (UNITY_INTERNAL_PTR)(length + (const char*)actual); } } /*-----------------------------------------------*/ #ifndef UNITY_EXCLUDE_FLOAT /* Wrap this define in a function with variable types as float or double */ #define UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff) \ if (isinf(expected) && isinf(actual) && ((expected < 0) == (actual < 0))) return 1; \ if (UNITY_NAN_CHECK) return 1; \ diff = actual - expected; \ if (diff < 0) diff = -diff; \ if (delta < 0) delta = -delta; \ return !(isnan(diff) || isinf(diff) || (diff > delta)) /* This first part of this condition will catch any NaN or Infinite values */ #ifndef UNITY_NAN_NOT_EQUAL_NAN #define UNITY_NAN_CHECK isnan(expected) && isnan(actual) #else #define UNITY_NAN_CHECK 0 #endif #ifndef UNITY_EXCLUDE_FLOAT_PRINT #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ { \ UnityPrint(UnityStrExpected); \ UnityPrintFloat(expected); \ UnityPrint(UnityStrWas); \ UnityPrintFloat(actual); } #else #define UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual) \ UnityPrint(UnityStrDelta) #endif /* UNITY_EXCLUDE_FLOAT_PRINT */ static int UnityFloatsWithin(UNITY_FLOAT delta, UNITY_FLOAT expected, UNITY_FLOAT actual) { UNITY_FLOAT diff; UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); } void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected, UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags) { UNITY_UINT32 elements = num_elements; UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_expected = expected; UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* ptr_actual = actual; RETURN_IF_FAIL_OR_IGNORE; if (elements == 0) { UnityPrintPointlessAndBail(); } if (expected == actual) return; /* Both are NULL or same pointer */ if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; while (elements--) { if (!UnityFloatsWithin(*ptr_expected * UNITY_FLOAT_PRECISION, *ptr_expected, *ptr_actual)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)*ptr_expected, (UNITY_DOUBLE)*ptr_actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } if (flags == UNITY_ARRAY_TO_ARRAY) { ptr_expected++; } ptr_actual++; } } /*-----------------------------------------------*/ void UnityAssertFloatsWithin(const UNITY_FLOAT delta, const UNITY_FLOAT expected, const UNITY_FLOAT actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { RETURN_IF_FAIL_OR_IGNORE; if (!UnityFloatsWithin(delta, expected, actual)) { UnityTestResultsFailBegin(lineNumber); UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT((UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertFloatSpecial(const UNITY_FLOAT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style) { const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; UNITY_INT should_be_trait = ((UNITY_INT)style & 1); UNITY_INT is_trait = !should_be_trait; UNITY_INT trait_index = (UNITY_INT)(style >> 1); RETURN_IF_FAIL_OR_IGNORE; switch (style) { case UNITY_FLOAT_IS_INF: case UNITY_FLOAT_IS_NOT_INF: is_trait = isinf(actual) && (actual > 0); break; case UNITY_FLOAT_IS_NEG_INF: case UNITY_FLOAT_IS_NOT_NEG_INF: is_trait = isinf(actual) && (actual < 0); break; case UNITY_FLOAT_IS_NAN: case UNITY_FLOAT_IS_NOT_NAN: is_trait = isnan(actual) ? 1 : 0; break; case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ case UNITY_FLOAT_IS_NOT_DET: is_trait = !isinf(actual) && !isnan(actual); break; default: trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; } if (is_trait != should_be_trait) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); if (!should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); UnityPrint(UnityStrWas); #ifndef UNITY_EXCLUDE_FLOAT_PRINT UnityPrintFloat((UNITY_DOUBLE)actual); #else if (should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #endif /* not UNITY_EXCLUDE_FLOAT */ /*-----------------------------------------------*/ #ifndef UNITY_EXCLUDE_DOUBLE static int UnityDoublesWithin(UNITY_DOUBLE delta, UNITY_DOUBLE expected, UNITY_DOUBLE actual) { UNITY_DOUBLE diff; UNITY_FLOAT_OR_DOUBLE_WITHIN(delta, expected, actual, diff); } void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags) { UNITY_UINT32 elements = num_elements; UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_expected = expected; UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* ptr_actual = actual; RETURN_IF_FAIL_OR_IGNORE; if (elements == 0) { UnityPrintPointlessAndBail(); } if (expected == actual) return; /* Both are NULL or same pointer */ if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; while (elements--) { if (!UnityDoublesWithin(*ptr_expected * UNITY_DOUBLE_PRECISION, *ptr_expected, *ptr_actual)) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(*ptr_expected, *ptr_actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } if (flags == UNITY_ARRAY_TO_ARRAY) { ptr_expected++; } ptr_actual++; } } /*-----------------------------------------------*/ void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, const UNITY_DOUBLE expected, const UNITY_DOUBLE actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { RETURN_IF_FAIL_OR_IGNORE; if (!UnityDoublesWithin(delta, expected, actual)) { UnityTestResultsFailBegin(lineNumber); UNITY_PRINT_EXPECTED_AND_ACTUAL_FLOAT(expected, actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style) { const char* trait_names[] = {UnityStrInf, UnityStrNegInf, UnityStrNaN, UnityStrDet}; UNITY_INT should_be_trait = ((UNITY_INT)style & 1); UNITY_INT is_trait = !should_be_trait; UNITY_INT trait_index = (UNITY_INT)(style >> 1); RETURN_IF_FAIL_OR_IGNORE; switch (style) { case UNITY_FLOAT_IS_INF: case UNITY_FLOAT_IS_NOT_INF: is_trait = isinf(actual) && (actual > 0); break; case UNITY_FLOAT_IS_NEG_INF: case UNITY_FLOAT_IS_NOT_NEG_INF: is_trait = isinf(actual) && (actual < 0); break; case UNITY_FLOAT_IS_NAN: case UNITY_FLOAT_IS_NOT_NAN: is_trait = isnan(actual) ? 1 : 0; break; case UNITY_FLOAT_IS_DET: /* A determinate number is non infinite and not NaN. */ case UNITY_FLOAT_IS_NOT_DET: is_trait = !isinf(actual) && !isnan(actual); break; default: trait_index = 0; trait_names[0] = UnityStrInvalidFloatTrait; break; } if (is_trait != should_be_trait) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrExpected); if (!should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); UnityPrint(UnityStrWas); #ifndef UNITY_EXCLUDE_FLOAT_PRINT UnityPrintFloat(actual); #else if (should_be_trait) UnityPrint(UnityStrNot); UnityPrint(trait_names[trait_index]); #endif UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } #endif /* not UNITY_EXCLUDE_DOUBLE */ /*-----------------------------------------------*/ void UnityAssertNumbersWithin(const UNITY_UINT delta, const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style) { RETURN_IF_FAIL_OR_IGNORE; if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT) { if (actual > expected) Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(actual - expected) > delta); else Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(expected - actual) > delta); } else { if ((UNITY_UINT)actual > (UNITY_UINT)expected) Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(actual - expected) > delta); else Unity.CurrentTestFailed = (UNITY_UINT)((UNITY_UINT)(expected - actual) > delta); } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrDelta); UnityPrintNumberByStyle((UNITY_INT)delta, style); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(expected, style); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(actual, style); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualString(const char* expected, const char* actual, const char* msg, const UNITY_LINE_TYPE lineNumber) { UNITY_UINT32 i; RETURN_IF_FAIL_OR_IGNORE; /* if both pointers not null compare the strings */ if (expected && actual) { for (i = 0; expected[i] || actual[i]; i++) { if (expected[i] != actual[i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expected != actual) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrintExpectedAndActualStrings(expected, actual); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualStringLen(const char* expected, const char* actual, const UNITY_UINT32 length, const char* msg, const UNITY_LINE_TYPE lineNumber) { UNITY_UINT32 i; RETURN_IF_FAIL_OR_IGNORE; /* if both pointers not null compare the strings */ if (expected && actual) { for (i = 0; (i < length) && (expected[i] || actual[i]); i++) { if (expected[i] != actual[i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expected != actual) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); UnityPrintExpectedAndActualStringsLen(expected, actual, length); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } /*-----------------------------------------------*/ void UnityAssertEqualStringArray(UNITY_INTERNAL_PTR expected, const char** actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags) { UNITY_UINT32 i = 0; UNITY_UINT32 j = 0; const char* expd = NULL; const char* act = NULL; RETURN_IF_FAIL_OR_IGNORE; /* if no elements, it's an error */ if (num_elements == 0) { UnityPrintPointlessAndBail(); } if ((const void*)expected == (const void*)actual) { return; /* Both are NULL or same pointer */ } if (UnityIsOneArrayNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg)) { UNITY_FAIL_AND_BAIL; } if (flags != UNITY_ARRAY_TO_ARRAY) { expd = (const char*)expected; } do { act = actual[j]; if (flags == UNITY_ARRAY_TO_ARRAY) { expd = ((const char* const*)expected)[j]; } /* if both pointers not null compare the strings */ if (expd && act) { for (i = 0; expd[i] || act[i]; i++) { if (expd[i] != act[i]) { Unity.CurrentTestFailed = 1; break; } } } else { /* handle case of one pointers being null (if both null, test should pass) */ if (expd != act) { Unity.CurrentTestFailed = 1; } } if (Unity.CurrentTestFailed) { UnityTestResultsFailBegin(lineNumber); if (num_elements > 1) { UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(j); } UnityPrintExpectedAndActualStrings(expd, act); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } } while (++j < num_elements); } /*-----------------------------------------------*/ void UnityAssertEqualMemory(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_UINT32 length, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags) { UNITY_PTR_ATTRIBUTE const unsigned char* ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; UNITY_PTR_ATTRIBUTE const unsigned char* ptr_act = (UNITY_PTR_ATTRIBUTE const unsigned char*)actual; UNITY_UINT32 elements = num_elements; UNITY_UINT32 bytes; RETURN_IF_FAIL_OR_IGNORE; if ((elements == 0) || (length == 0)) { UnityPrintPointlessAndBail(); } if (expected == actual) return; /* Both are NULL or same pointer */ if (UnityIsOneArrayNull(expected, actual, lineNumber, msg)) UNITY_FAIL_AND_BAIL; while (elements--) { bytes = length; while (bytes--) { if (*ptr_exp != *ptr_act) { UnityTestResultsFailBegin(lineNumber); UnityPrint(UnityStrMemory); if (num_elements > 1) { UnityPrint(UnityStrElement); UnityPrintNumberUnsigned(num_elements - elements - 1); } UnityPrint(UnityStrByte); UnityPrintNumberUnsigned(length - bytes - 1); UnityPrint(UnityStrExpected); UnityPrintNumberByStyle(*ptr_exp, UNITY_DISPLAY_STYLE_HEX8); UnityPrint(UnityStrWas); UnityPrintNumberByStyle(*ptr_act, UNITY_DISPLAY_STYLE_HEX8); UnityAddMsgIfSpecified(msg); UNITY_FAIL_AND_BAIL; } ptr_exp++; ptr_act++; } if (flags == UNITY_ARRAY_TO_VAL) { ptr_exp = (UNITY_PTR_ATTRIBUTE const unsigned char*)expected; } } } /*-----------------------------------------------*/ static union { UNITY_INT8 i8; UNITY_INT16 i16; UNITY_INT32 i32; #ifdef UNITY_SUPPORT_64 UNITY_INT64 i64; #endif #ifndef UNITY_EXCLUDE_FLOAT float f; #endif #ifndef UNITY_EXCLUDE_DOUBLE double d; #endif } UnityQuickCompare; UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size) { switch(size) { case 1: UnityQuickCompare.i8 = (UNITY_INT8)num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i8); case 2: UnityQuickCompare.i16 = (UNITY_INT16)num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i16); #ifdef UNITY_SUPPORT_64 case 8: UnityQuickCompare.i64 = (UNITY_INT64)num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i64); #endif default: /* 4 bytes */ UnityQuickCompare.i32 = (UNITY_INT32)num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.i32); } } #ifndef UNITY_EXCLUDE_FLOAT UNITY_INTERNAL_PTR UnityFloatToPtr(const float num) { UnityQuickCompare.f = num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.f); } #endif #ifndef UNITY_EXCLUDE_DOUBLE UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num) { UnityQuickCompare.d = num; return (UNITY_INTERNAL_PTR)(&UnityQuickCompare.d); } #endif /*----------------------------------------------- * Control Functions *-----------------------------------------------*/ void UnityFail(const char* msg, const UNITY_LINE_TYPE line) { RETURN_IF_FAIL_OR_IGNORE; UnityTestResultsBegin(Unity.TestFile, line); UnityPrint(UnityStrFail); if (msg != NULL) { UNITY_OUTPUT_CHAR(':'); #ifndef UNITY_EXCLUDE_DETAILS if (Unity.CurrentDetail1) { UnityPrint(UnityStrDetail1Name); UnityPrint(Unity.CurrentDetail1); if (Unity.CurrentDetail2) { UnityPrint(UnityStrDetail2Name); UnityPrint(Unity.CurrentDetail2); } UnityPrint(UnityStrSpacer); } #endif if (msg[0] != ' ') { UNITY_OUTPUT_CHAR(' '); } UnityPrint(msg); } UNITY_FAIL_AND_BAIL; } /*-----------------------------------------------*/ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line) { RETURN_IF_FAIL_OR_IGNORE; UnityTestResultsBegin(Unity.TestFile, line); UnityPrint(UnityStrIgnore); if (msg != NULL) { UNITY_OUTPUT_CHAR(':'); UNITY_OUTPUT_CHAR(' '); UnityPrint(msg); } UNITY_IGNORE_AND_BAIL; } /*-----------------------------------------------*/ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum) { Unity.CurrentTestName = FuncName; Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum; Unity.NumberOfTests++; UNITY_CLR_DETAILS(); if (TEST_PROTECT()) { setUp(); Func(); } if (TEST_PROTECT()) { tearDown(); } UnityConcludeTest(); } /*-----------------------------------------------*/ void UnityBegin(const char* filename) { Unity.TestFile = filename; Unity.CurrentTestName = NULL; Unity.CurrentTestLineNumber = 0; Unity.NumberOfTests = 0; Unity.TestFailures = 0; Unity.TestIgnores = 0; Unity.CurrentTestFailed = 0; Unity.CurrentTestIgnored = 0; UNITY_CLR_DETAILS(); UNITY_OUTPUT_START(); } /*-----------------------------------------------*/ int UnityEnd(void) { UNITY_PRINT_EOL(); UnityPrint(UnityStrBreaker); UNITY_PRINT_EOL(); UnityPrintNumber((UNITY_INT)(Unity.NumberOfTests)); UnityPrint(UnityStrResultsTests); UnityPrintNumber((UNITY_INT)(Unity.TestFailures)); UnityPrint(UnityStrResultsFailures); UnityPrintNumber((UNITY_INT)(Unity.TestIgnores)); UnityPrint(UnityStrResultsIgnored); UNITY_PRINT_EOL(); if (Unity.TestFailures == 0U) { UnityPrint(UnityStrOk); } else { UnityPrint(UnityStrFail); #ifdef UNITY_DIFFERENTIATE_FINAL_FAIL UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D'); #endif } UNITY_PRINT_EOL(); UNITY_FLUSH_CALL(); UNITY_OUTPUT_COMPLETE(); return (int)(Unity.TestFailures); } /*----------------------------------------------- * Command Line Argument Support *-----------------------------------------------*/ #ifdef UNITY_USE_COMMAND_LINE_ARGS char* UnityOptionIncludeNamed = NULL; char* UnityOptionExcludeNamed = NULL; int UnityVerbosity = 1; int UnityParseOptions(int argc, char** argv) { UnityOptionIncludeNamed = NULL; UnityOptionExcludeNamed = NULL; for (int i = 1; i < argc; i++) { if (argv[i][0] == '-') { switch (argv[i][1]) { case 'l': /* list tests */ return -1; case 'n': /* include tests with name including this string */ case 'f': /* an alias for -n */ if (argv[i][2] == '=') UnityOptionIncludeNamed = &argv[i][3]; else if (++i < argc) UnityOptionIncludeNamed = argv[i]; else { UnityPrint("ERROR: No Test String to Include Matches For"); UNITY_PRINT_EOL(); return 1; } break; case 'q': /* quiet */ UnityVerbosity = 0; break; case 'v': /* verbose */ UnityVerbosity = 2; break; case 'x': /* exclude tests with name including this string */ if (argv[i][2] == '=') UnityOptionExcludeNamed = &argv[i][3]; else if (++i < argc) UnityOptionExcludeNamed = argv[i]; else { UnityPrint("ERROR: No Test String to Exclude Matches For"); UNITY_PRINT_EOL(); return 1; } break; default: UnityPrint("ERROR: Unknown Option "); UNITY_OUTPUT_CHAR(argv[i][1]); UNITY_PRINT_EOL(); return 1; } } } return 0; } int IsStringInBiggerString(const char* longstring, const char* shortstring) { const char* lptr = longstring; const char* sptr = shortstring; const char* lnext = lptr; if (*sptr == '*') return 1; while (*lptr) { lnext = lptr + 1; /* If they current bytes match, go on to the next bytes */ while (*lptr && *sptr && (*lptr == *sptr)) { lptr++; sptr++; /* We're done if we match the entire string or up to a wildcard */ if (*sptr == '*') return 1; if (*sptr == ',') return 1; if (*sptr == '"') return 1; if (*sptr == '\'') return 1; if (*sptr == ':') return 2; if (*sptr == 0) return 1; } /* Otherwise we start in the long pointer 1 character further and try again */ lptr = lnext; sptr = shortstring; } return 0; } int UnityStringArgumentMatches(const char* str) { int retval; const char* ptr1; const char* ptr2; const char* ptrf; /* Go through the options and get the substrings for matching one at a time */ ptr1 = str; while (ptr1[0] != 0) { if ((ptr1[0] == '"') || (ptr1[0] == '\'')) ptr1++; /* look for the start of the next partial */ ptr2 = ptr1; ptrf = 0; do { ptr2++; if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')) ptrf = &ptr2[1]; } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ',')); while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ','))) ptr2++; /* done if complete filename match */ retval = IsStringInBiggerString(Unity.TestFile, ptr1); if (retval == 1) return retval; /* done if testname match after filename partial match */ if ((retval == 2) && (ptrf != 0)) { if (IsStringInBiggerString(Unity.CurrentTestName, ptrf)) return 1; } /* done if complete testname match */ if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1) return 1; ptr1 = ptr2; } /* we couldn't find a match for any substrings */ return 0; } int UnityTestMatches(void) { /* Check if this test name matches the included test pattern */ int retval; if (UnityOptionIncludeNamed) { retval = UnityStringArgumentMatches(UnityOptionIncludeNamed); } else retval = 1; /* Check if this test name matches the excluded test pattern */ if (UnityOptionExcludeNamed) { if (UnityStringArgumentMatches(UnityOptionExcludeNamed)) retval = 0; } return retval; } #endif /* UNITY_USE_COMMAND_LINE_ARGS */ /*-----------------------------------------------*/ zeromq-4.2.5/external/unity/unity_internals.h0000664000372000037200000020771113255253220022342 0ustar00travistravis00000000000000/* ========================================== Unity Project - A Test Framework for C Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] ========================================== */ #ifndef UNITY_INTERNALS_H #define UNITY_INTERNALS_H #ifdef UNITY_INCLUDE_CONFIG_H #include "unity_config.h" #endif #ifndef UNITY_EXCLUDE_SETJMP_H #include #endif #ifndef UNITY_EXCLUDE_MATH_H #include #endif /* Unity Attempts to Auto-Detect Integer Types * Attempt 1: UINT_MAX, ULONG_MAX in , or default to 32 bits * Attempt 2: UINTPTR_MAX in , or default to same size as long * The user may override any of these derived constants: * UNITY_INT_WIDTH, UNITY_LONG_WIDTH, UNITY_POINTER_WIDTH */ #ifndef UNITY_EXCLUDE_STDINT_H #include #endif #ifndef UNITY_EXCLUDE_LIMITS_H #include #endif /*------------------------------------------------------- * Guess Widths If Not Specified *-------------------------------------------------------*/ /* Determine the size of an int, if not already specified. * We cannot use sizeof(int), because it is not yet defined * at this stage in the translation of the C program. * Therefore, infer it from UINT_MAX if possible. */ #ifndef UNITY_INT_WIDTH #ifdef UINT_MAX #if (UINT_MAX == 0xFFFF) #define UNITY_INT_WIDTH (16) #elif (UINT_MAX == 0xFFFFFFFF) #define UNITY_INT_WIDTH (32) #elif (UINT_MAX == 0xFFFFFFFFFFFFFFFF) #define UNITY_INT_WIDTH (64) #endif #else /* Set to default */ #define UNITY_INT_WIDTH (32) #endif /* UINT_MAX */ #endif /* Determine the size of a long, if not already specified. */ #ifndef UNITY_LONG_WIDTH #ifdef ULONG_MAX #if (ULONG_MAX == 0xFFFF) #define UNITY_LONG_WIDTH (16) #elif (ULONG_MAX == 0xFFFFFFFF) #define UNITY_LONG_WIDTH (32) #elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF) #define UNITY_LONG_WIDTH (64) #endif #else /* Set to default */ #define UNITY_LONG_WIDTH (32) #endif /* ULONG_MAX */ #endif /* Determine the size of a pointer, if not already specified. */ #ifndef UNITY_POINTER_WIDTH #ifdef UINTPTR_MAX #if (UINTPTR_MAX <= 0xFFFF) #define UNITY_POINTER_WIDTH (16) #elif (UINTPTR_MAX <= 0xFFFFFFFF) #define UNITY_POINTER_WIDTH (32) #elif (UINTPTR_MAX <= 0xFFFFFFFFFFFFFFFF) #define UNITY_POINTER_WIDTH (64) #endif #else /* Set to default */ #define UNITY_POINTER_WIDTH UNITY_LONG_WIDTH #endif /* UINTPTR_MAX */ #endif /*------------------------------------------------------- * Int Support (Define types based on detected sizes) *-------------------------------------------------------*/ #if (UNITY_INT_WIDTH == 32) typedef unsigned char UNITY_UINT8; typedef unsigned short UNITY_UINT16; typedef unsigned int UNITY_UINT32; typedef signed char UNITY_INT8; typedef signed short UNITY_INT16; typedef signed int UNITY_INT32; #elif (UNITY_INT_WIDTH == 16) typedef unsigned char UNITY_UINT8; typedef unsigned int UNITY_UINT16; typedef unsigned long UNITY_UINT32; typedef signed char UNITY_INT8; typedef signed int UNITY_INT16; typedef signed long UNITY_INT32; #else #error Invalid UNITY_INT_WIDTH specified! (16 or 32 are supported) #endif /*------------------------------------------------------- * 64-bit Support *-------------------------------------------------------*/ #ifndef UNITY_SUPPORT_64 #if UNITY_LONG_WIDTH == 64 || UNITY_POINTER_WIDTH == 64 #define UNITY_SUPPORT_64 #endif #endif #ifndef UNITY_SUPPORT_64 /* No 64-bit Support */ typedef UNITY_UINT32 UNITY_UINT; typedef UNITY_INT32 UNITY_INT; #else /* 64-bit Support */ #if (UNITY_LONG_WIDTH == 32) typedef unsigned long long UNITY_UINT64; typedef signed long long UNITY_INT64; #elif (UNITY_LONG_WIDTH == 64) typedef unsigned long UNITY_UINT64; typedef signed long UNITY_INT64; #else #error Invalid UNITY_LONG_WIDTH specified! (32 or 64 are supported) #endif typedef UNITY_UINT64 UNITY_UINT; typedef UNITY_INT64 UNITY_INT; #endif /*------------------------------------------------------- * Pointer Support *-------------------------------------------------------*/ #if (UNITY_POINTER_WIDTH == 32) #define UNITY_PTR_TO_INT UNITY_INT32 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32 #elif (UNITY_POINTER_WIDTH == 64) #define UNITY_PTR_TO_INT UNITY_INT64 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX64 #elif (UNITY_POINTER_WIDTH == 16) #define UNITY_PTR_TO_INT UNITY_INT16 #define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX16 #else #error Invalid UNITY_POINTER_WIDTH specified! (16, 32 or 64 are supported) #endif #ifndef UNITY_PTR_ATTRIBUTE #define UNITY_PTR_ATTRIBUTE #endif #ifndef UNITY_INTERNAL_PTR #define UNITY_INTERNAL_PTR UNITY_PTR_ATTRIBUTE const void* #endif /*------------------------------------------------------- * Float Support *-------------------------------------------------------*/ #ifdef UNITY_EXCLUDE_FLOAT /* No Floating Point Support */ #ifndef UNITY_EXCLUDE_DOUBLE #define UNITY_EXCLUDE_DOUBLE /* Remove double when excluding float support */ #endif #ifndef UNITY_EXCLUDE_FLOAT_PRINT #define UNITY_EXCLUDE_FLOAT_PRINT #endif #else /* Floating Point Support */ #ifndef UNITY_FLOAT_PRECISION #define UNITY_FLOAT_PRECISION (0.00001f) #endif #ifndef UNITY_FLOAT_TYPE #define UNITY_FLOAT_TYPE float #endif typedef UNITY_FLOAT_TYPE UNITY_FLOAT; /* isinf & isnan macros should be provided by math.h */ #ifndef isinf /* The value of Inf - Inf is NaN */ #define isinf(n) (isnan((n) - (n)) && !isnan(n)) #endif #ifndef isnan /* NaN is the only floating point value that does NOT equal itself. * Therefore if n != n, then it is NaN. */ #define isnan(n) ((n != n) ? 1 : 0) #endif #endif /*------------------------------------------------------- * Double Float Support *-------------------------------------------------------*/ /* unlike float, we DON'T include by default */ #if defined(UNITY_EXCLUDE_DOUBLE) || !defined(UNITY_INCLUDE_DOUBLE) /* No Floating Point Support */ #ifndef UNITY_EXCLUDE_DOUBLE #define UNITY_EXCLUDE_DOUBLE #else #undef UNITY_INCLUDE_DOUBLE #endif #ifndef UNITY_EXCLUDE_FLOAT #ifndef UNITY_DOUBLE_TYPE #define UNITY_DOUBLE_TYPE double #endif typedef UNITY_FLOAT UNITY_DOUBLE; /* For parameter in UnityPrintFloat(UNITY_DOUBLE), which aliases to double or float */ #endif #else /* Double Floating Point Support */ #ifndef UNITY_DOUBLE_PRECISION #define UNITY_DOUBLE_PRECISION (1e-12) #endif #ifndef UNITY_DOUBLE_TYPE #define UNITY_DOUBLE_TYPE double #endif typedef UNITY_DOUBLE_TYPE UNITY_DOUBLE; #endif /*------------------------------------------------------- * Output Method: stdout (DEFAULT) *-------------------------------------------------------*/ #ifndef UNITY_OUTPUT_CHAR /* Default to using putchar, which is defined in stdio.h */ #include #define UNITY_OUTPUT_CHAR(a) (void)putchar(a) #else /* If defined as something else, make sure we declare it here so it's ready for use */ #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION; #endif #endif #ifndef UNITY_OUTPUT_FLUSH #ifdef UNITY_USE_FLUSH_STDOUT /* We want to use the stdout flush utility */ #include #define UNITY_OUTPUT_FLUSH() (void)fflush(stdout) #else /* We've specified nothing, therefore flush should just be ignored */ #define UNITY_OUTPUT_FLUSH() #endif #else /* We've defined flush as something else, so make sure we declare it here so it's ready for use */ #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION; #endif #endif #ifndef UNITY_OUTPUT_FLUSH #define UNITY_FLUSH_CALL() #else #define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH() #endif #ifndef UNITY_PRINT_EOL #define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n') #endif #ifndef UNITY_OUTPUT_START #define UNITY_OUTPUT_START() #endif #ifndef UNITY_OUTPUT_COMPLETE #define UNITY_OUTPUT_COMPLETE() #endif /*------------------------------------------------------- * Footprint *-------------------------------------------------------*/ #ifndef UNITY_LINE_TYPE #define UNITY_LINE_TYPE UNITY_UINT #endif #ifndef UNITY_COUNTER_TYPE #define UNITY_COUNTER_TYPE UNITY_UINT #endif /*------------------------------------------------------- * Language Features Available *-------------------------------------------------------*/ #if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA) # if defined(__GNUC__) || defined(__ghs__) /* __GNUC__ includes clang */ # if !(defined(__WIN32__) && defined(__clang__)) && !defined(__TMS470__) # define UNITY_WEAK_ATTRIBUTE __attribute__((weak)) # endif # endif #endif #ifdef UNITY_NO_WEAK # undef UNITY_WEAK_ATTRIBUTE # undef UNITY_WEAK_PRAGMA #endif /*------------------------------------------------------- * Internal Structs Needed *-------------------------------------------------------*/ typedef void (*UnityTestFunction)(void); #define UNITY_DISPLAY_RANGE_INT (0x10) #define UNITY_DISPLAY_RANGE_UINT (0x20) #define UNITY_DISPLAY_RANGE_HEX (0x40) typedef enum { UNITY_DISPLAY_STYLE_INT = sizeof(int)+ UNITY_DISPLAY_RANGE_INT, UNITY_DISPLAY_STYLE_INT8 = 1 + UNITY_DISPLAY_RANGE_INT, UNITY_DISPLAY_STYLE_INT16 = 2 + UNITY_DISPLAY_RANGE_INT, UNITY_DISPLAY_STYLE_INT32 = 4 + UNITY_DISPLAY_RANGE_INT, #ifdef UNITY_SUPPORT_64 UNITY_DISPLAY_STYLE_INT64 = 8 + UNITY_DISPLAY_RANGE_INT, #endif UNITY_DISPLAY_STYLE_UINT = sizeof(unsigned) + UNITY_DISPLAY_RANGE_UINT, UNITY_DISPLAY_STYLE_UINT8 = 1 + UNITY_DISPLAY_RANGE_UINT, UNITY_DISPLAY_STYLE_UINT16 = 2 + UNITY_DISPLAY_RANGE_UINT, UNITY_DISPLAY_STYLE_UINT32 = 4 + UNITY_DISPLAY_RANGE_UINT, #ifdef UNITY_SUPPORT_64 UNITY_DISPLAY_STYLE_UINT64 = 8 + UNITY_DISPLAY_RANGE_UINT, #endif UNITY_DISPLAY_STYLE_HEX8 = 1 + UNITY_DISPLAY_RANGE_HEX, UNITY_DISPLAY_STYLE_HEX16 = 2 + UNITY_DISPLAY_RANGE_HEX, UNITY_DISPLAY_STYLE_HEX32 = 4 + UNITY_DISPLAY_RANGE_HEX, #ifdef UNITY_SUPPORT_64 UNITY_DISPLAY_STYLE_HEX64 = 8 + UNITY_DISPLAY_RANGE_HEX, #endif UNITY_DISPLAY_STYLE_UNKNOWN } UNITY_DISPLAY_STYLE_T; typedef enum { UNITY_EQUAL_TO = 1, UNITY_GREATER_THAN = 2, UNITY_GREATER_OR_EQUAL = 2 + UNITY_EQUAL_TO, UNITY_SMALLER_THAN = 4, UNITY_SMALLER_OR_EQUAL = 4 + UNITY_EQUAL_TO } UNITY_COMPARISON_T; #ifndef UNITY_EXCLUDE_FLOAT typedef enum UNITY_FLOAT_TRAIT { UNITY_FLOAT_IS_NOT_INF = 0, UNITY_FLOAT_IS_INF, UNITY_FLOAT_IS_NOT_NEG_INF, UNITY_FLOAT_IS_NEG_INF, UNITY_FLOAT_IS_NOT_NAN, UNITY_FLOAT_IS_NAN, UNITY_FLOAT_IS_NOT_DET, UNITY_FLOAT_IS_DET, UNITY_FLOAT_INVALID_TRAIT } UNITY_FLOAT_TRAIT_T; #endif typedef enum { UNITY_ARRAY_TO_VAL = 0, UNITY_ARRAY_TO_ARRAY } UNITY_FLAGS_T; struct UNITY_STORAGE_T { const char* TestFile; const char* CurrentTestName; #ifndef UNITY_EXCLUDE_DETAILS const char* CurrentDetail1; const char* CurrentDetail2; #endif UNITY_LINE_TYPE CurrentTestLineNumber; UNITY_COUNTER_TYPE NumberOfTests; UNITY_COUNTER_TYPE TestFailures; UNITY_COUNTER_TYPE TestIgnores; UNITY_COUNTER_TYPE CurrentTestFailed; UNITY_COUNTER_TYPE CurrentTestIgnored; #ifndef UNITY_EXCLUDE_SETJMP_H jmp_buf AbortFrame; #endif }; extern struct UNITY_STORAGE_T Unity; /*------------------------------------------------------- * Test Suite Management *-------------------------------------------------------*/ void UnityBegin(const char* filename); int UnityEnd(void); void UnityConcludeTest(void); void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum); /*------------------------------------------------------- * Details Support *-------------------------------------------------------*/ #ifdef UNITY_EXCLUDE_DETAILS #define UNITY_CLR_DETAILS() #define UNITY_SET_DETAIL(d1) #define UNITY_SET_DETAILS(d1,d2) #else #define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; } #define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = 0; } #define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = d2; } #ifndef UNITY_DETAIL1_NAME #define UNITY_DETAIL1_NAME "Function" #endif #ifndef UNITY_DETAIL2_NAME #define UNITY_DETAIL2_NAME "Argument" #endif #endif /*------------------------------------------------------- * Test Output *-------------------------------------------------------*/ void UnityPrint(const char* string); void UnityPrintLen(const char* string, const UNITY_UINT32 length); void UnityPrintMask(const UNITY_UINT mask, const UNITY_UINT number); void UnityPrintNumberByStyle(const UNITY_INT number, const UNITY_DISPLAY_STYLE_T style); void UnityPrintNumber(const UNITY_INT number); void UnityPrintNumberUnsigned(const UNITY_UINT number); void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles); #ifndef UNITY_EXCLUDE_FLOAT_PRINT void UnityPrintFloat(const UNITY_DOUBLE input_number); #endif /*------------------------------------------------------- * Test Assertion Functions *------------------------------------------------------- * Use the macros below this section instead of calling * these directly. The macros have a consistent naming * convention and will pull in file and line information * for you. */ void UnityAssertEqualNumber(const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style); void UnityAssertGreaterOrLessOrEqualNumber(const UNITY_INT threshold, const UNITY_INT actual, const UNITY_COMPARISON_T compare, const char *msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style); void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style, const UNITY_FLAGS_T flags); void UnityAssertBits(const UNITY_INT mask, const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber); void UnityAssertEqualString(const char* expected, const char* actual, const char* msg, const UNITY_LINE_TYPE lineNumber); void UnityAssertEqualStringLen(const char* expected, const char* actual, const UNITY_UINT32 length, const char* msg, const UNITY_LINE_TYPE lineNumber); void UnityAssertEqualStringArray( UNITY_INTERNAL_PTR expected, const char** actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags); void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_UINT32 length, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags); void UnityAssertNumbersWithin(const UNITY_UINT delta, const UNITY_INT expected, const UNITY_INT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_DISPLAY_STYLE_T style); void UnityFail(const char* message, const UNITY_LINE_TYPE line); void UnityIgnore(const char* message, const UNITY_LINE_TYPE line); #ifndef UNITY_EXCLUDE_FLOAT void UnityAssertFloatsWithin(const UNITY_FLOAT delta, const UNITY_FLOAT expected, const UNITY_FLOAT actual, const char* msg, const UNITY_LINE_TYPE lineNumber); void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* expected, UNITY_PTR_ATTRIBUTE const UNITY_FLOAT* actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags); void UnityAssertFloatSpecial(const UNITY_FLOAT actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style); #endif #ifndef UNITY_EXCLUDE_DOUBLE void UnityAssertDoublesWithin(const UNITY_DOUBLE delta, const UNITY_DOUBLE expected, const UNITY_DOUBLE actual, const char* msg, const UNITY_LINE_TYPE lineNumber); void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* expected, UNITY_PTR_ATTRIBUTE const UNITY_DOUBLE* actual, const UNITY_UINT32 num_elements, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLAGS_T flags); void UnityAssertDoubleSpecial(const UNITY_DOUBLE actual, const char* msg, const UNITY_LINE_TYPE lineNumber, const UNITY_FLOAT_TRAIT_T style); #endif /*------------------------------------------------------- * Helpers *-------------------------------------------------------*/ UNITY_INTERNAL_PTR UnityNumToPtr(const UNITY_INT num, const UNITY_UINT8 size); #ifndef UNITY_EXCLUDE_FLOAT UNITY_INTERNAL_PTR UnityFloatToPtr(const float num); #endif #ifndef UNITY_EXCLUDE_DOUBLE UNITY_INTERNAL_PTR UnityDoubleToPtr(const double num); #endif /*------------------------------------------------------- * Error Strings We Might Need *-------------------------------------------------------*/ extern const char UnityStrErrFloat[]; extern const char UnityStrErrDouble[]; extern const char UnityStrErr64[]; /*------------------------------------------------------- * Test Running Macros *-------------------------------------------------------*/ #ifndef UNITY_EXCLUDE_SETJMP_H #define TEST_PROTECT() (setjmp(Unity.AbortFrame) == 0) #define TEST_ABORT() longjmp(Unity.AbortFrame, 1) #else #define TEST_PROTECT() 1 #define TEST_ABORT() return #endif /* This tricky series of macros gives us an optional line argument to treat it as RUN_TEST(func, num=__LINE__) */ #ifndef RUN_TEST #ifdef __STDC_VERSION__ #if __STDC_VERSION__ >= 199901L #define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__)) #define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway) #define RUN_TEST_FIRST_HELPER(first, ...) (first), #first #define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway) #define RUN_TEST_SECOND_HELPER(first, second, ...) (second) #endif #endif #endif /* If we can't do the tricky version, we'll just have to require them to always include the line number */ #ifndef RUN_TEST #ifdef CMOCK #define RUN_TEST(func, num) UnityDefaultTestRun(func, #func, num) #else #define RUN_TEST(func) UnityDefaultTestRun(func, #func, __LINE__) #endif #endif #define TEST_LINE_NUM (Unity.CurrentTestLineNumber) #define TEST_IS_IGNORED (Unity.CurrentTestIgnored) #define UNITY_NEW_TEST(a) \ Unity.CurrentTestName = (a); \ Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)(__LINE__); \ Unity.NumberOfTests++; #ifndef UNITY_BEGIN #define UNITY_BEGIN() UnityBegin(__FILE__) #endif #ifndef UNITY_END #define UNITY_END() UnityEnd() #endif /*----------------------------------------------- * Command Line Argument Support *-----------------------------------------------*/ #ifdef UNITY_USE_COMMAND_LINE_ARGS int UnityParseOptions(int argc, char** argv); int UnityTestMatches(void); #endif /*------------------------------------------------------- * Basic Fail and Ignore *-------------------------------------------------------*/ #define UNITY_TEST_FAIL(line, message) UnityFail( (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_IGNORE(line, message) UnityIgnore( (message), (UNITY_LINE_TYPE)(line)) /*------------------------------------------------------- * Test Asserts *-------------------------------------------------------*/ #define UNITY_TEST_ASSERT(condition, line, message) if (condition) {} else {UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), (message));} #define UNITY_TEST_ASSERT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) == NULL), (UNITY_LINE_TYPE)(line), (message)) #define UNITY_TEST_ASSERT_NOT_NULL(pointer, line, message) UNITY_TEST_ASSERT(((pointer) != NULL), (UNITY_LINE_TYPE)(line), (message)) #define UNITY_TEST_ASSERT_EQUAL_INT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_EQUAL_INT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_EQUAL_INT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_EQUAL_INT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_EQUAL_UINT(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_EQUAL_UINT8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_EQUAL_UINT16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_EQUAL_UINT32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_EQUAL_HEX8(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_EQUAL_HEX16(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_EQUAL_HEX32(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_BITS(mask, expected, actual, line, message) UnityAssertBits((UNITY_INT)(mask), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_GREATER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_GREATER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_GREATER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_GREATER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT8 )(threshold), (UNITY_INT)(UNITY_INT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT16)(threshold), (UNITY_INT)(UNITY_INT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_INT32)(threshold), (UNITY_INT)(UNITY_INT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT8 )(threshold), (UNITY_INT)(UNITY_UINT8 )(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT16)(threshold), (UNITY_INT)(UNITY_UINT16)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(UNITY_UINT32)(threshold), (UNITY_INT)(UNITY_UINT32)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_INT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT) #define UNITY_TEST_ASSERT_INT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_INT8 )(expected), (UNITY_INT)(UNITY_INT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8) #define UNITY_TEST_ASSERT_INT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_INT16)(expected), (UNITY_INT)(UNITY_INT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16) #define UNITY_TEST_ASSERT_INT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_INT32)(expected), (UNITY_INT)(UNITY_INT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32) #define UNITY_TEST_ASSERT_UINT_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT) #define UNITY_TEST_ASSERT_UINT8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8) #define UNITY_TEST_ASSERT_UINT16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16) #define UNITY_TEST_ASSERT_UINT32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32) #define UNITY_TEST_ASSERT_HEX8_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT8 )(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT8 )(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8) #define UNITY_TEST_ASSERT_HEX16_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT16)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT16)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16) #define UNITY_TEST_ASSERT_HEX32_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((UNITY_UINT32)(delta), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(expected), (UNITY_INT)(UNITY_UINT)(UNITY_UINT32)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32) #define UNITY_TEST_ASSERT_EQUAL_PTR(expected, actual, line, message) UnityAssertEqualNumber((UNITY_PTR_TO_INT)(expected), (UNITY_PTR_TO_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER) #define UNITY_TEST_ASSERT_EQUAL_STRING(expected, actual, line, message) UnityAssertEqualString((const char*)(expected), (const char*)(actual), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len, line, message) UnityAssertEqualStringLen((const char*)(expected), (const char*)(actual), (UNITY_UINT32)(len), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_EQUAL_MEMORY(expected, actual, len, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), 1, (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) expected, sizeof(int)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT8, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT16, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT32, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT) expected, sizeof(unsigned int)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT8, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT16)expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT16, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT32)expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT32, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT8 )expected, 1), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX8, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT16 )expected, 2), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX16, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT32 )expected, 4), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX32, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_PTR_TO_INT) expected, sizeof(int*)), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_POINTER, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements, line, message) UnityAssertEqualStringArray((UNITY_INTERNAL_PTR)(expected), (const char**)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements, line, message) UnityAssertEqualMemory((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(len), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) #ifdef UNITY_SUPPORT_64 #define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UnityAssertEqualNumber((UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualIntArray((UNITY_INTERNAL_PTR)(expected), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_UINT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements, line, message) UnityAssertEqualIntArray(UnityNumToPtr((UNITY_INT)(UNITY_INT64)expected, 8), (UNITY_INTERNAL_PTR)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UnityAssertNumbersWithin((delta), (UNITY_INT)(expected), (UNITY_INT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_THAN, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_INT64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_SMALLER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_HEX64) #else #define UNITY_TEST_ASSERT_EQUAL_INT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_EQUAL_UINT64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_EQUAL_HEX64(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_INT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_UINT64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_HEX64_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_THAN_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_THAN_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_THAN_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #define UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64(threshold, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErr64) #endif #ifdef UNITY_EXCLUDE_FLOAT #define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrFloat) #else #define UNITY_TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual, line, message) UnityAssertFloatsWithin((UNITY_FLOAT)(delta), (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line)) #define UNITY_TEST_ASSERT_EQUAL_FLOAT(expected, actual, line, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((UNITY_FLOAT)(expected) * (UNITY_FLOAT)UNITY_FLOAT_PRECISION, (UNITY_FLOAT)(expected), (UNITY_FLOAT)(actual), (UNITY_LINE_TYPE)(line), (message)) #define UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray((UNITY_FLOAT*)(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements, line, message) UnityAssertEqualFloatArray(UnityFloatToPtr(expected), (UNITY_FLOAT*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)(line), UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_FLOAT_IS_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) #define UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) #define UNITY_TEST_ASSERT_FLOAT_IS_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) #define UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) #define UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual, line, message) UnityAssertFloatSpecial((UNITY_FLOAT)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) #endif #ifdef UNITY_EXCLUDE_DOUBLE #define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UNITY_TEST_FAIL((UNITY_LINE_TYPE)(line), UnityStrErrDouble) #else #define UNITY_TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual, line, message) UnityAssertDoublesWithin((UNITY_DOUBLE)(delta), (UNITY_DOUBLE)(expected), (UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)line) #define UNITY_TEST_ASSERT_EQUAL_DOUBLE(expected, actual, line, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((UNITY_DOUBLE)(expected) * (UNITY_DOUBLE)UNITY_DOUBLE_PRECISION, (UNITY_DOUBLE)expected, (UNITY_DOUBLE)actual, (UNITY_LINE_TYPE)(line), message) #define UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray((UNITY_DOUBLE*)(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_ARRAY_TO_ARRAY) #define UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements, line, message) UnityAssertEqualDoubleArray(UnityDoubleToPtr(expected), (UNITY_DOUBLE*)(actual), (UNITY_UINT32)(num_elements), (message), (UNITY_LINE_TYPE)line, UNITY_ARRAY_TO_VAL) #define UNITY_TEST_ASSERT_DOUBLE_IS_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_INF) #define UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NEG_INF) #define UNITY_TEST_ASSERT_DOUBLE_IS_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NAN) #define UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_DET) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_INF) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NEG_INF) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_NAN) #define UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual, line, message) UnityAssertDoubleSpecial((UNITY_DOUBLE)(actual), (message), (UNITY_LINE_TYPE)(line), UNITY_FLOAT_IS_NOT_DET) #endif /* End of UNITY_INTERNALS_H */ #endif zeromq-4.2.5/external/unity/license.txt0000664000372000037200000000214313255253220021115 0ustar00travistravis00000000000000The MIT License (MIT) Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. zeromq-4.2.5/external/unity/unity.h0000664000372000037200000020166513255253220020265 0ustar00travistravis00000000000000/* ========================================== Unity Project - A Test Framework for C Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] ========================================== */ #ifndef UNITY_FRAMEWORK_H #define UNITY_FRAMEWORK_H #define UNITY #ifdef __cplusplus extern "C" { #endif #include "unity_internals.h" /*------------------------------------------------------- * Test Setup / Teardown *-------------------------------------------------------*/ /* These functions are intended to be called before and after each test. */ void setUp(void); void tearDown(void); /* These functions are intended to be called at the beginning and end of an * entire test suite. suiteTearDown() is passed the number of tests that * failed, and its return value becomes the exit code of main(). */ void suiteSetUp(void); int suiteTearDown(int num_failures); /* If the compiler supports it, the following block provides stub * implementations of the above functions as weak symbols. Note that on * some platforms (MinGW for example), weak function implementations need * to be in the same translation unit they are called from. This can be * achieved by defining UNITY_INCLUDE_SETUP_STUBS before including unity.h. */ #ifdef UNITY_INCLUDE_SETUP_STUBS #ifdef UNITY_WEAK_ATTRIBUTE UNITY_WEAK_ATTRIBUTE void setUp(void) { } UNITY_WEAK_ATTRIBUTE void tearDown(void) { } UNITY_WEAK_ATTRIBUTE void suiteSetUp(void) { } UNITY_WEAK_ATTRIBUTE int suiteTearDown(int num_failures) { return num_failures; } #elif defined(UNITY_WEAK_PRAGMA) #pragma weak setUp void setUp(void) { } #pragma weak tearDown void tearDown(void) { } #pragma weak suiteSetUp void suiteSetUp(void) { } #pragma weak suiteTearDown int suiteTearDown(int num_failures) { return num_failures; } #endif #endif /*------------------------------------------------------- * Configuration Options *------------------------------------------------------- * All options described below should be passed as a compiler flag to all files using Unity. If you must add #defines, place them BEFORE the #include above. * Integers/longs/pointers * - Unity attempts to automatically discover your integer sizes * - define UNITY_EXCLUDE_STDINT_H to stop attempting to look in * - define UNITY_EXCLUDE_LIMITS_H to stop attempting to look in * - If you cannot use the automatic methods above, you can force Unity by using these options: * - define UNITY_SUPPORT_64 * - set UNITY_INT_WIDTH * - set UNITY_LONG_WIDTH * - set UNITY_POINTER_WIDTH * Floats * - define UNITY_EXCLUDE_FLOAT to disallow floating point comparisons * - define UNITY_FLOAT_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_FLOAT * - define UNITY_FLOAT_TYPE to specify doubles instead of single precision floats * - define UNITY_INCLUDE_DOUBLE to allow double floating point comparisons * - define UNITY_EXCLUDE_DOUBLE to disallow double floating point comparisons (default) * - define UNITY_DOUBLE_PRECISION to specify the precision to use when doing TEST_ASSERT_EQUAL_DOUBLE * - define UNITY_DOUBLE_TYPE to specify something other than double * - define UNITY_EXCLUDE_FLOAT_PRINT to trim binary size, won't print floating point values in errors * Output * - by default, Unity prints to standard out with putchar. define UNITY_OUTPUT_CHAR(a) with a different function if desired * - define UNITY_DIFFERENTIATE_FINAL_FAIL to print FAILED (vs. FAIL) at test end summary - for automated search for failure * Optimization * - by default, line numbers are stored in unsigned shorts. Define UNITY_LINE_TYPE with a different type if your files are huge * - by default, test and failure counters are unsigned shorts. Define UNITY_COUNTER_TYPE with a different type if you want to save space or have more than 65535 Tests. * Test Cases * - define UNITY_SUPPORT_TEST_CASES to include the TEST_CASE macro, though really it's mostly about the runner generator script * Parameterized Tests * - you'll want to create a define of TEST_CASE(...) which basically evaluates to nothing * Tests with Arguments * - you'll want to define UNITY_USE_COMMAND_LINE_ARGS if you have the test runner passing arguments to Unity *------------------------------------------------------- * Basic Fail and Ignore *-------------------------------------------------------*/ #define TEST_FAIL_MESSAGE(message) UNITY_TEST_FAIL(__LINE__, (message)) #define TEST_FAIL() UNITY_TEST_FAIL(__LINE__, NULL) #define TEST_IGNORE_MESSAGE(message) UNITY_TEST_IGNORE(__LINE__, (message)) #define TEST_IGNORE() UNITY_TEST_IGNORE(__LINE__, NULL) #define TEST_ONLY() /* It is not necessary for you to call PASS. A PASS condition is assumed if nothing fails. * This method allows you to abort a test immediately with a PASS state, ignoring the remainder of the test. */ #define TEST_PASS() TEST_ABORT() /* This macro does nothing, but it is useful for build tools (like Ceedling) to make use of this to figure out * which files should be linked to in order to perform a test. Use it like TEST_FILE("sandwiches.c") */ #define TEST_FILE(a) /*------------------------------------------------------- * Test Asserts (simple) *-------------------------------------------------------*/ /* Boolean */ #define TEST_ASSERT(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expression Evaluated To FALSE") #define TEST_ASSERT_TRUE(condition) UNITY_TEST_ASSERT( (condition), __LINE__, " Expected TRUE Was FALSE") #define TEST_ASSERT_UNLESS(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expression Evaluated To TRUE") #define TEST_ASSERT_FALSE(condition) UNITY_TEST_ASSERT( !(condition), __LINE__, " Expected FALSE Was TRUE") #define TEST_ASSERT_NULL(pointer) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, " Expected NULL") #define TEST_ASSERT_NOT_NULL(pointer) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, " Expected Non-NULL") /* Integers (of all sizes) */ #define TEST_ASSERT_EQUAL_INT(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL(expected, actual) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_NOT_EQUAL(expected, actual) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, " Expected Not-Equal") #define TEST_ASSERT_EQUAL_UINT(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT8(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT16(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT32(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT64(expected, actual) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX8(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX16(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX32(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX64(expected, actual) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS(mask, expected, actual) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS_HIGH(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, NULL) #define TEST_ASSERT_BITS_LOW(mask, actual) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, NULL) #define TEST_ASSERT_BIT_HIGH(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, NULL) #define TEST_ASSERT_BIT_LOW(bit, actual) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, NULL) /* Integer Greater Than/ Less Than (of all sizes) */ #define TEST_ASSERT_GREATER_THAN(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_THAN_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_INT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_UINT(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_UINT8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_UINT16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_UINT32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_UINT64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX8(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX16(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX32(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, NULL) #define TEST_ASSERT_LESS_OR_EQUAL_HEX64(threshold, actual) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, NULL) /* Integer Ranges (of all sizes) */ #define TEST_ASSERT_INT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_INT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_INT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_INT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_INT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_UINT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_UINT8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_UINT16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_UINT32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_UINT64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX8_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX16_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX32_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_HEX64_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, NULL) /* Structs and Strings */ #define TEST_ASSERT_EQUAL_PTR(expected, actual) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_STRING(expected, actual) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_STRING_LEN(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, NULL) #define TEST_ASSERT_EQUAL_MEMORY(expected, actual, len) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, NULL) /* Arrays */ #define TEST_ASSERT_EQUAL_INT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_INT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_UINT64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX16_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX32_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_HEX64_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_PTR_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_STRING_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EQUAL_MEMORY_ARRAY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, NULL) /* Arrays Compared To Single Value */ #define TEST_ASSERT_EACH_EQUAL_INT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_INT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_INT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_INT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_INT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_UINT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_UINT8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_UINT16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_UINT32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_UINT64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_HEX(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_HEX8(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_HEX16(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_HEX32(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_HEX64(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_PTR(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_STRING(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_MEMORY(expected, actual, len, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, NULL) /* Floating Point (If Enabled) */ #define TEST_ASSERT_FLOAT_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_FLOAT(expected, actual) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_FLOAT_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_FLOAT(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NOT_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, NULL) #define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, NULL) /* Double (If Enabled) */ #define TEST_ASSERT_DOUBLE_WITHIN(delta, expected, actual) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_DOUBLE(expected, actual) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, NULL) #define TEST_ASSERT_EQUAL_DOUBLE_ARRAY(expected, actual, num_elements) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_EACH_EQUAL_DOUBLE(expected, actual, num_elements) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NOT_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NOT_NAN(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, NULL) #define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE(actual) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, NULL) /*------------------------------------------------------- * Test Asserts (with additional messages) *-------------------------------------------------------*/ /* Boolean */ #define TEST_ASSERT_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) #define TEST_ASSERT_TRUE_MESSAGE(condition, message) UNITY_TEST_ASSERT( (condition), __LINE__, (message)) #define TEST_ASSERT_UNLESS_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) #define TEST_ASSERT_FALSE_MESSAGE(condition, message) UNITY_TEST_ASSERT( !(condition), __LINE__, (message)) #define TEST_ASSERT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NULL( (pointer), __LINE__, (message)) #define TEST_ASSERT_NOT_NULL_MESSAGE(pointer, message) UNITY_TEST_ASSERT_NOT_NULL((pointer), __LINE__, (message)) /* Integers (of all sizes) */ #define TEST_ASSERT_EQUAL_INT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT8((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT16((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT32((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT64((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_INT((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_NOT_EQUAL_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT(((expected) != (actual)), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT8( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT16( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT32( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_UINT64( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX8_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX8( (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX16_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX16((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX32_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX32((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX64_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_HEX64((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_BITS_MESSAGE(mask, expected, actual, message) UNITY_TEST_ASSERT_BITS((mask), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_BITS_HIGH_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) #define TEST_ASSERT_BITS_LOW_MESSAGE(mask, actual, message) UNITY_TEST_ASSERT_BITS((mask), (UNITY_UINT32)(0), (actual), __LINE__, (message)) #define TEST_ASSERT_BIT_HIGH_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(-1), (actual), __LINE__, (message)) #define TEST_ASSERT_BIT_LOW_MESSAGE(bit, actual, message) UNITY_TEST_ASSERT_BITS(((UNITY_UINT32)1 << (bit)), (UNITY_UINT32)(0), (actual), __LINE__, (message)) /* Integer Greater Than/ Less Than (of all sizes) */ #define TEST_ASSERT_GREATER_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_INT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_UINT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_THAN_HEX64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_INT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_UINT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_THAN_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_GREATER_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_INT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_INT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_UINT_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_UINT8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_UINT16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_UINT32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_UINT64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_UINT64((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX8_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX8((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX16_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_OR_EQUAL_HEX16((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX32_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX32((threshold), (actual), __LINE__, (message)) #define TEST_ASSERT_LESS_OR_EQUAL_HEX64_MESSAGE(threshold, actual, message) UNITY_TEST_ASSERT_SMALLER_THAN_HEX64((threshold), (actual), __LINE__, (message)) /* Integer Ranges (of all sizes) */ #define TEST_ASSERT_INT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_INT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_INT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_INT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_INT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_INT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_UINT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_UINT8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT8_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_UINT16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT16_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_UINT32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT32_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_UINT64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_UINT64_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX8_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX8_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX16_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX16_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX32_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX32_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_HEX64_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_HEX64_WITHIN((delta), (expected), (actual), __LINE__, (message)) /* Structs and Strings */ #define TEST_ASSERT_EQUAL_PTR_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_PTR((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_STRING_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_STRING((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_STRING_LEN_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_STRING_LEN((expected), (actual), (len), __LINE__, (message)) #define TEST_ASSERT_EQUAL_MEMORY_MESSAGE(expected, actual, len, message) UNITY_TEST_ASSERT_EQUAL_MEMORY((expected), (actual), (len), __LINE__, (message)) /* Arrays */ #define TEST_ASSERT_EQUAL_INT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_INT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_INT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_UINT64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_UINT64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX8_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX16_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX16_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX32_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_HEX64_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_HEX64_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_PTR_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_PTR_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_STRING_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EQUAL_MEMORY_ARRAY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((expected), (actual), (len), (num_elements), __LINE__, (message)) /* Arrays Compared To Single Value*/ #define TEST_ASSERT_EACH_EQUAL_INT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_INT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT8((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_INT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT16((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_INT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT32((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_INT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_INT64((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_UINT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_UINT8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT8((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_UINT16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT16((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_UINT32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT32((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_UINT64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_UINT64((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_HEX_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_HEX8_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX8((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_HEX16_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX16((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_HEX32_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX32((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_HEX64_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_HEX64((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_PTR_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_PTR((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_STRING_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_STRING((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_MEMORY_MESSAGE(expected, actual, len, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_MEMORY((expected), (actual), (len), (num_elements), __LINE__, (message)) /* Floating Point (If Enabled) */ #define TEST_ASSERT_FLOAT_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_FLOAT_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_FLOAT_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_FLOAT((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_FLOAT_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_FLOAT_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_FLOAT_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_FLOAT((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_INF((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NEG_INF((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NAN((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_DETERMINATE((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_INF((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE((actual), __LINE__, (message)) /* Double (If Enabled) */ #define TEST_ASSERT_DOUBLE_WITHIN_MESSAGE(delta, expected, actual, message) UNITY_TEST_ASSERT_DOUBLE_WITHIN((delta), (expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_DOUBLE_MESSAGE(expected, actual, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE((expected), (actual), __LINE__, (message)) #define TEST_ASSERT_EQUAL_DOUBLE_ARRAY_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EQUAL_DOUBLE_ARRAY((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_EACH_EQUAL_DOUBLE_MESSAGE(expected, actual, num_elements, message) UNITY_TEST_ASSERT_EACH_EQUAL_DOUBLE((expected), (actual), (num_elements), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_INF((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NEG_INF((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NAN((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_DETERMINATE((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NOT_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_INF((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NEG_INF((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_NAN((actual), __LINE__, (message)) #define TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE_MESSAGE(actual, message) UNITY_TEST_ASSERT_DOUBLE_IS_NOT_DETERMINATE((actual), __LINE__, (message)) /* end of UNITY_FRAMEWORK_H */ #ifdef __cplusplus } #endif #endif zeromq-4.2.5/external/unity/version.txt0000664000372000037200000000013013255253220021152 0ustar00travistravis00000000000000https://github.com/ThrowTheSwitch/Unity/commit/b4aca70fd9e0ddf0afbdafb1b826f5edcfc1049b zeromq-4.2.5/configure0000775000372000037200000301465713255253272015676 0ustar00travistravis00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for zeromq 4.2.5. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: zeromq-dev@lists.zeromq.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='zeromq' PACKAGE_TARNAME='zeromq' PACKAGE_VERSION='4.2.5' PACKAGE_STRING='zeromq 4.2.5' PACKAGE_BUGREPORT='zeromq-dev@lists.zeromq.org' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS pkgconfigdir pkg_config_libs_private LIBZMQ_VMCI_LDFLAGS LIBZMQ_VMCI_CXXFLAGS LIBZMQ_EXTRA_LDFLAGS LIBZMQ_EXTRA_CXXFLAGS LIBZMQ_EXTRA_CFLAGS ENABLE_STATIC_FALSE ENABLE_STATIC_TRUE WITH_CLANG_FORMAT_FALSE WITH_CLANG_FORMAT_TRUE WITH_CLANG_FORMAT CLANG_FORMAT LIBUNWIND_LIBS LIBUNWIND_CFLAGS pkg_config_defines ENABLE_DRAFTS_FALSE ENABLE_DRAFTS_TRUE HAVE_FORK_FALSE HAVE_FORK_TRUE ON_GNU_FALSE ON_GNU_TRUE ON_LINUX_FALSE ON_LINUX_TRUE ON_ANDROID_FALSE ON_ANDROID_TRUE ON_CYGWIN_FALSE ON_CYGWIN_TRUE ON_MINGW_FALSE ON_MINGW_TRUE BUILD_TIPC_FALSE BUILD_TIPC_TRUE HAVE_VMCI_FALSE HAVE_VMCI_TRUE HAVE_NORM_FALSE HAVE_NORM_TRUE norm_LIBS norm_CFLAGS HAVE_PGM_FALSE HAVE_PGM_TRUE pgm_LIBS pgm_CFLAGS HAVE_CURVE_FALSE HAVE_CURVE_TRUE USE_TWEETNACL_FALSE USE_TWEETNACL_TRUE USE_LIBSODIUM_FALSE USE_LIBSODIUM_TRUE ENABLE_CURVE_KEYGEN_FALSE ENABLE_CURVE_KEYGEN_TRUE sodium_LIBS sodium_CFLAGS BUILD_GSSAPI_FALSE BUILD_GSSAPI_TRUE gssapi_krb5_LIBS gssapi_krb5_CFLAGS HAVE_IPC_PEERCRED_FALSE HAVE_IPC_PEERCRED_TRUE ENABLE_PERF_FALSE ENABLE_PERF_TRUE INSTALL_MAN_FALSE INSTALL_MAN_TRUE BUILD_DOC_FALSE BUILD_DOC_TRUE libzmq_have_xmlto libzmq_have_asciidoc ENABLE_ASAN_FALSE ENABLE_ASAN_TRUE VALGRIND_CHECK_RULES VALGRIND_HAVE_TOOL_exp_sgcheck VALGRIND_HAVE_TOOL_drd VALGRIND_HAVE_TOOL_helgrind VALGRIND_HAVE_TOOL_memcheck VALGRIND_ENABLED VALGRIND_ENABLED_FALSE VALGRIND_ENABLED_TRUE VALGRIND CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP LIBTOOL OBJDUMP DLLTOOL AS host_os host_vendor host_cpu host build_os build_vendor build_cpu build ASCIIDOC XMLTO PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CODE_COVERAGE_RULES CODE_COVERAGE_LDFLAGS CODE_COVERAGE_LIBS CODE_COVERAGE_CXXFLAGS CODE_COVERAGE_CFLAGS CODE_COVERAGE_CPPFLAGS GENHTML LCOV GCOV CODE_COVERAGE_ENABLED CODE_COVERAGE_ENABLED_FALSE CODE_COVERAGE_ENABLED_TRUE SED HAVE_CXX11 am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LTVER AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_gcov enable_code_coverage enable_static enable_shared with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_valgrind enable_debug enable_pedantic with_militant enable_address_sanitizer enable_Werror with_docs with_documentation with_poller enable_eventfd enable_perf enable_curve_keygen with_libgssapi_krb5 with_libsodium enable_curve with_pgm with_norm with_vmci enable_drafts enable_libunwind with_pkgconfigdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR XMLTO ASCIIDOC CPP CXXCPP gssapi_krb5_CFLAGS gssapi_krb5_LIBS sodium_CFLAGS sodium_LIBS pgm_CFLAGS pgm_LIBS norm_CFLAGS norm_LIBS LIBUNWIND_CFLAGS LIBUNWIND_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures zeromq 4.2.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/zeromq] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of zeromq 4.2.5:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-code-coverage Whether to enable code coverage support --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-valgrind Whether to enable Valgrind on the unit tests --enable-debug enable debugging information [default=disabled] --disable-pedantic disable pedantic compiler checks [default=enabled] --enable-address-sanitizer=yes/no Build with GCC Address Sanitizer instrumentation --disable-Werror disable Werror compiler flag [default=enabled] --disable-eventfd disable eventfd [default=enabled] --disable-perf don't build performance measurement tools [default=build] --disable-curve-keygen don't build curve-keygen tool [default=build] --disable-curve disable CURVE security [default=no] --enable-drafts Build and install draft classes and methods [default=yes] --enable-libunwind enable libunwind [default=auto] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-gcov=yes/no with GCC Code Coverage reporting. --with-militant enable militant API assertions --without-docs Don't build and install man pages [default=build] --without-documentation Don't build and install man pages [default=build] DEPRECATED: use --without-docs --with-poller choose polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'pollset', 'poll', 'select', or 'auto'. [default=auto] --with-libgssapi_krb5 require libzmq build with libgssapi_krb5 [default=no] --with-libsodium use libsodium instead of built-in tweetnacl [default=no] --with-pgm build libzmq with PGM extension. Requires pkg-config [default=no] --with-norm build libzmq with NORM protocol extension, optionally specifying norm path [default=no] --with-vmci build libzmq with VMCI transport [default=no] --with-pkgconfigdir=PATH Path to the pkgconfig directory [[LIBDIR/pkgconfig]] Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path XMLTO path to xmlto command ASCIIDOC path to asciidoc command CPP C preprocessor CXXCPP C++ preprocessor gssapi_krb5_CFLAGS C compiler flags for gssapi_krb5, overriding pkg-config gssapi_krb5_LIBS linker flags for gssapi_krb5, overriding pkg-config sodium_CFLAGS C compiler flags for sodium, overriding pkg-config sodium_LIBS linker flags for sodium, overriding pkg-config pgm_CFLAGS C compiler flags for pgm, overriding pkg-config pgm_LIBS linker flags for pgm, overriding pkg-config norm_CFLAGS C compiler flags for norm, overriding pkg-config norm_LIBS linker flags for norm, overriding pkg-config LIBUNWIND_CFLAGS C compiler flags for LIBUNWIND, overriding pkg-config LIBUNWIND_LIBS linker flags for LIBUNWIND, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF zeromq configure 4.2.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------ ## ## Report this to zeromq-dev@lists.zeromq.org ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES # ----------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_cxx_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_decl # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------ ## ## Report this to zeromq-dev@lists.zeromq.org ## ## ------------------------------------------ ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by zeromq $as_me 4.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers src/platform.hpp" am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='zeromq' VERSION='4.2.5' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' # The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 $as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 $as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } _am_tools=none fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_ustar-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_ustar}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: cat conftest.dir/file" >&5 (cat conftest.dir/file) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # # Check whether the given FLAG works with the current language's compiler # or gives an error. (Warnings, however, are ignored) # # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on # success/failure. # # If EXTRA-FLAGS is defined, it is added to the current language's default # flags (e.g. CFLAGS) when the check is done. The check is thus made with # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to # force the compiler to issue an error when a bad flag is given. # # INPUT gives an alternative input source to AC_COMPILE_IFELSE. # # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 4 # ============================================================================ # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html # ============================================================================ # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the C++11 # standard; if necessary, add switches to CXX and CXXCPP to enable # support. # # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX # macro with the version set to C++11. The two optional arguments are # forwarded literally as the second and third argument respectively. # Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for # more information. If you want to use this macro, you also need to # download the ax_cxx_compile_stdcxx.m4 file. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 16 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS # # AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) # # DESCRIPTION # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and # CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) # or '14' (for the C++14 standard). # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with # preference for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is # required and that the macro should error out if no mode with that # support is found. If specified 'optional', then configuration proceeds # regardless, after defining HAVE_CXX${VERSION} if and only if a # supporting mode is found. # # LICENSE # # Copyright (c) 2008 Benjamin Kosnik # Copyright (c) 2012 Zack Weinberg # Copyright (c) 2013 Roy Stogner # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov # Copyright (c) 2015 Paul Norman # Copyright (c) 2015 Moritz Klammler # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 4 # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html # =========================================================================== # # SYNOPSIS # # AX_CODE_COVERAGE() # # DESCRIPTION # # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, # CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included # in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every # build target (program or library) which should be built with code # coverage support. Also defines CODE_COVERAGE_RULES which should be # substituted in your Makefile; and $enable_code_coverage which can be # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined # and substituted, and corresponds to the value of the # --enable-code-coverage option, which defaults to being disabled. # # Test also for gcov program and create GCOV variable that could be # substituted. # # Note that all optimization flags in CFLAGS must be disabled when code # coverage is enabled. # # Usage example: # # configure.ac: # # AX_CODE_COVERAGE # # Makefile.am: # # @CODE_COVERAGE_RULES@ # my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... # # This results in a "check-code-coverage" rule being added to any # Makefile.am which includes "@CODE_COVERAGE_RULES@" (assuming the module # has been configured with --enable-code-coverage). Running `make # check-code-coverage` in that directory will run the module's test suite # (`make check`) and build a code coverage report detailing the code which # was touched, then print the URI for the report. # # In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined # instead of CODE_COVERAGE_LIBS. They are both still defined, but use of # CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is # deprecated. They have the same value. # # This code was derived from Makefile.decl in GLib, originally licenced # under LGPLv2.1+. # # LICENSE # # Copyright (c) 2012, 2016 Philip Withnall # Copyright (c) 2012 Xan Lopez # Copyright (c) 2012 Christian Persch # Copyright (c) 2012 Paolo Borelli # Copyright (c) 2012 Dan Winship # Copyright (c) 2015 Bastien ROUCARIES # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or (at # your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see . #serial 25 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html # =========================================================================== # # SYNOPSIS # # AX_VALGRIND_CHECK() # # DESCRIPTION # # Checks whether Valgrind is present and, if so, allows running `make # check` under a variety of Valgrind tools to check for memory and # threading errors. # # Defines VALGRIND_CHECK_RULES which should be substituted in your # Makefile; and $enable_valgrind which can be used in subsequent configure # output. VALGRIND_ENABLED is defined and substituted, and corresponds to # the value of the --enable-valgrind option, which defaults to being # enabled if Valgrind is installed and disabled otherwise. # # If unit tests are written using a shell script and automake's # LOG_COMPILER system, the $(VALGRIND) variable can be used within the # shell scripts to enable Valgrind, as described here: # # https://www.gnu.org/software/gnulib/manual/html_node/Running-self_002dtests-under-valgrind.html # # Usage example: # # configure.ac: # # AX_VALGRIND_CHECK # # Makefile.am: # # @VALGRIND_CHECK_RULES@ # VALGRIND_SUPPRESSIONS_FILES = my-project.supp # EXTRA_DIST = my-project.supp # # This results in a "check-valgrind" rule being added to any Makefile.am # which includes "@VALGRIND_CHECK_RULES@" (assuming the module has been # configured with --enable-valgrind). Running `make check-valgrind` in # that directory will run the module's test suite (`make check`) once for # each of the available Valgrind tools (out of memcheck, helgrind, drd and # sgcheck), and will output results to test-suite-$toolname.log for each. # The target will succeed if there are zero errors and fail otherwise. # # Alternatively, a "check-valgrind-$TOOL" rule will be added, for $TOOL in # memcheck, helgrind, drd and sgcheck. These are useful because often only # some of those tools can be ran cleanly on a codebase. # # The macro supports running with and without libtool. # # LICENSE # # Copyright (c) 2014, 2015, 2016 Philip Withnall # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. #serial 9 # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' # This lets us use PACKAGE_VERSION in Makefiles # Libtool -version-info (ABI version) # # Don't change this unless you know exactly what you're doing and have read and # understand: # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # # Changes: # # ZeroMQ versions prior to 2.1.0 use 0:0:0 (undefined) # ZeroMQ versions 2.1.x: 1:0:0 (ABI version 1) # ZeroMQ version 3.0: 2:0:0 (ABI version 2) # ZeroMQ version 3.1: 3:0:0 (ABI version 3) # ZeroMQ version 4.0: 4:0:0 (ABI version 4) # ZeroMQ version 4.1: 5:0:0 (ABI version 5) # ZeroMQ version 4.2.0: 6:0:1 (ABI version 5) # ZeroMQ version 4.2.1: 6:1:1 (ABI version 5) # ZeroMQ version 4.2.2: 6:2:1 (ABI version 5) # ZeroMQ version 4.2.3: 6:3:1 (ABI version 5) # ZeroMQ version 4.2.4: 6:4:1 (ABI version 5) # ZeroMQ version 4.2.5: 6:5:1 (ABI version 5) # # libzmq -version-info current:revision:age LTVER="6:5:1" # Take a copy of original flags ZMQ_ORIG_CFLAGS="${CFLAGS:-none}" ZMQ_ORIG_CPPFLAGS="${CPPFLAGS:-none}" ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -std=gnu11" >&5 $as_echo_n "checking whether C compiler accepts -std=gnu11... " >&6; } if ${ax_cv_check_cflags___std_gnu11+:} false; then : $as_echo_n "(cached) " >&6 else ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -std=gnu11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_check_cflags___std_gnu11=yes else ax_cv_check_cflags___std_gnu11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___std_gnu11" >&5 $as_echo "$ax_cv_check_cflags___std_gnu11" >&6; } if test "x$ax_cv_check_cflags___std_gnu11" = xyes; then : CFLAGS+=" -std=gnu11" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ax_cxx_compile_cxx11_required=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 $as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } if ${ax_cv_cxx_compile_cxx11+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_cxx_compile_cxx11=yes else ax_cv_cxx_compile_cxx11=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } if test x$ax_cv_cxx_compile_cxx11 = xyes; then ac_success=yes fi if test x$ac_success = xno; then for switch in -std=gnu++11 -std=gnu++0x; do cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" CXX="$CXX $switch" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ // If the compiler admits that it is not ready for C++11, why torture it? // Hopefully, this will speed up the test. #ifndef __cplusplus #error "This is not a C++ compiler" #elif __cplusplus < 201103L #error "This is not a C++11 compiler" #else namespace cxx11 { namespace test_static_assert { template struct check { static_assert(sizeof(int) <= sizeof(T), "not big enough"); }; } namespace test_final_override { struct Base { virtual void f() {} }; struct Derived : public Base { virtual void f() override {} }; } namespace test_double_right_angle_brackets { template < typename T > struct check {}; typedef check single_type; typedef check> double_type; typedef check>> triple_type; typedef check>>> quadruple_type; } namespace test_decltype { int f() { int a = 1; decltype(a) b = 2; return a + b; } } namespace test_type_deduction { template < typename T1, typename T2 > struct is_same { static const bool value = false; }; template < typename T > struct is_same { static const bool value = true; }; template < typename T1, typename T2 > auto add(T1 a1, T2 a2) -> decltype(a1 + a2) { return a1 + a2; } int test(const int c, volatile int v) { static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == false, ""); auto ac = c; auto av = v; auto sumi = ac + av + 'x'; auto sumf = ac + av + 1.0; static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == true, ""); static_assert(is_same::value == false, ""); static_assert(is_same::value == true, ""); return (sumf > 0.0) ? sumi : add(c, v); } } namespace test_noexcept { int f() { return 0; } int g() noexcept { return 0; } static_assert(noexcept(f()) == false, ""); static_assert(noexcept(g()) == true, ""); } namespace test_constexpr { template < typename CharT > unsigned long constexpr strlen_c_r(const CharT *const s, const unsigned long acc) noexcept { return *s ? strlen_c_r(s + 1, acc + 1) : acc; } template < typename CharT > unsigned long constexpr strlen_c(const CharT *const s) noexcept { return strlen_c_r(s, 0UL); } static_assert(strlen_c("") == 0UL, ""); static_assert(strlen_c("1") == 1UL, ""); static_assert(strlen_c("example") == 7UL, ""); static_assert(strlen_c("another\0example") == 7UL, ""); } namespace test_rvalue_references { template < int N > struct answer { static constexpr int value = N; }; answer<1> f(int&) { return answer<1>(); } answer<2> f(const int&) { return answer<2>(); } answer<3> f(int&&) { return answer<3>(); } void test() { int i = 0; const int c = 0; static_assert(decltype(f(i))::value == 1, ""); static_assert(decltype(f(c))::value == 2, ""); static_assert(decltype(f(0))::value == 3, ""); } } namespace test_uniform_initialization { struct test { static const int zero {}; static const int one {1}; }; static_assert(test::zero == 0, ""); static_assert(test::one == 1, ""); } namespace test_lambdas { void test1() { auto lambda1 = [](){}; auto lambda2 = lambda1; lambda1(); lambda2(); } int test2() { auto a = [](int i, int j){ return i + j; }(1, 2); auto b = []() -> int { return '0'; }(); auto c = [=](){ return a + b; }(); auto d = [&](){ return c; }(); auto e = [a, &b](int x) mutable { const auto identity = [](int y){ return y; }; for (auto i = 0; i < a; ++i) a += b--; return x + identity(a + b); }(0); return a + b + c + d + e; } int test3() { const auto nullary = [](){ return 0; }; const auto unary = [](int x){ return x; }; using nullary_t = decltype(nullary); using unary_t = decltype(unary); const auto higher1st = [](nullary_t f){ return f(); }; const auto higher2nd = [unary](nullary_t f1){ return [unary, f1](unary_t f2){ return f2(unary(f1())); }; }; return higher1st(nullary) + higher2nd(nullary)(unary); } } namespace test_variadic_templates { template struct sum; template struct sum { static constexpr auto value = N0 + sum::value; }; template <> struct sum<> { static constexpr auto value = 0; }; static_assert(sum<>::value == 0, ""); static_assert(sum<1>::value == 1, ""); static_assert(sum<23>::value == 23, ""); static_assert(sum<1, 2>::value == 3, ""); static_assert(sum<5, 5, 11>::value == 21, ""); static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); } // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function // because of this. namespace test_template_alias_sfinae { struct foo {}; template using member = typename T::member_type; template void func(...) {} template void func(member*) {} void test(); void test() { func(0); } } } // namespace cxx11 #endif // __cplusplus >= 201103L _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval $cachevar=yes else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" if test -n "$CXXCPP" ; then CXXCPP="$CXXCPP $switch" fi ac_success=yes break fi done fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test x$ax_cxx_compile_cxx11_required = xtrue; then if test x$ac_success = xno; then as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 fi fi if test x$ac_success = xno; then HAVE_CXX11=0 { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 $as_echo "$as_me: No compiler with C++11 support was found" >&6;} else HAVE_CXX11=1 $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # allow to override gcov location # Check whether --with-gcov was given. if test "${with_gcov+set}" = set; then : withval=$with_gcov; _AX_CODE_COVERAGE_GCOV_PROG_WITH=$with_gcov else _AX_CODE_COVERAGE_GCOV_PROG_WITH=gcov fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with code coverage support" >&5 $as_echo_n "checking whether to build with code coverage support... " >&6; } # Check whether --enable-code-coverage was given. if test "${enable_code_coverage+set}" = set; then : enableval=$enable_code_coverage; else enable_code_coverage=no fi if test x$enable_code_coverage = xyes; then CODE_COVERAGE_ENABLED_TRUE= CODE_COVERAGE_ENABLED_FALSE='#' else CODE_COVERAGE_ENABLED_TRUE='#' CODE_COVERAGE_ENABLED_FALSE= fi CODE_COVERAGE_ENABLED=$enable_code_coverage { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_code_coverage" >&5 $as_echo "$enable_code_coverage" >&6; } if test "$enable_code_coverage" = "yes" ; then : # check for gcov if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. set dummy ${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GCOV+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GCOV"; then ac_cv_prog_GCOV="$GCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GCOV="${ac_tool_prefix}$_AX_CODE_COVERAGE_GCOV_PROG_WITH" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GCOV=$ac_cv_prog_GCOV if test -n "$GCOV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCOV" >&5 $as_echo "$GCOV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_GCOV"; then ac_ct_GCOV=$GCOV # Extract the first word of "$_AX_CODE_COVERAGE_GCOV_PROG_WITH", so it can be a program name with args. set dummy $_AX_CODE_COVERAGE_GCOV_PROG_WITH; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_GCOV+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_GCOV"; then ac_cv_prog_ac_ct_GCOV="$ac_ct_GCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_GCOV="$_AX_CODE_COVERAGE_GCOV_PROG_WITH" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_GCOV=$ac_cv_prog_ac_ct_GCOV if test -n "$ac_ct_GCOV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCOV" >&5 $as_echo "$ac_ct_GCOV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_GCOV" = x; then GCOV=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac GCOV=$ac_ct_GCOV fi else GCOV="$ac_cv_prog_GCOV" fi if test "X$GCOV" = "X:"; then : as_fn_error $? "gcov is needed to do coverage" "$LINENO" 5 fi if test "$GCC" = "no" ; then : as_fn_error $? "not compiling with gcc, which is required for gcov code coverage" "$LINENO" 5 fi # Extract the first word of "lcov", so it can be a program name with args. set dummy lcov; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LCOV+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LCOV"; then ac_cv_prog_LCOV="$LCOV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LCOV="lcov" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LCOV=$ac_cv_prog_LCOV if test -n "$LCOV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LCOV" >&5 $as_echo "$LCOV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "genhtml", so it can be a program name with args. set dummy genhtml; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GENHTML+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GENHTML"; then ac_cv_prog_GENHTML="$GENHTML" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GENHTML="genhtml" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GENHTML=$ac_cv_prog_GENHTML if test -n "$GENHTML"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENHTML" >&5 $as_echo "$GENHTML" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$LCOV" ; then : as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 fi if test -z "$GENHTML" ; then : as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 fi CODE_COVERAGE_CPPFLAGS="-DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_LIBS="-lgcov" CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" CODE_COVERAGE_RULES_CHECK=' -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture ' CODE_COVERAGE_RULES_CAPTURE=' $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" ' CODE_COVERAGE_RULES_CLEAN=' clean: code-coverage-clean distclean: code-coverage-clean code-coverage-clean: -$(LCOV) --directory $(top_builddir) -z -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete ' else CODE_COVERAGE_RULES_CHECK=' @echo "Need to reconfigure with --enable-code-coverage" ' CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" CODE_COVERAGE_RULES_CLEAN='' fi CODE_COVERAGE_RULES=' # Code coverage # # Optional: # - CODE_COVERAGE_DIRECTORY: Top-level directory for code coverage reporting. # Multiple directories may be specified, separated by whitespace. # (Default: $(top_builddir)) # - CODE_COVERAGE_OUTPUT_FILE: Filename and path for the .info file generated # by lcov for code coverage. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info) # - CODE_COVERAGE_OUTPUT_DIRECTORY: Directory for generated code coverage # reports to be created. (Default: # $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage) # - CODE_COVERAGE_BRANCH_COVERAGE: Set to 1 to enforce branch coverage, # set to 0 to disable it and leave empty to stay with the default. # (Default: empty) # - CODE_COVERAGE_LCOV_SHOPTS_DEFAULT: Extra options shared between both lcov # instances. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_LCOV_SHOPTS: Extra options to shared between both lcov # instances. (Default: $CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) # - CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH: --gcov-tool pathtogcov # - CODE_COVERAGE_LCOV_OPTIONS_DEFAULT: Extra options to pass to the # collecting lcov instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) # - CODE_COVERAGE_LCOV_OPTIONS: Extra options to pass to the collecting lcov # instance. (Default: $CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) # - CODE_COVERAGE_LCOV_RMOPTS_DEFAULT: Extra options to pass to the filtering # lcov instance. (Default: empty) # - CODE_COVERAGE_LCOV_RMOPTS: Extra options to pass to the filtering lcov # instance. (Default: $CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) # - CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT: Extra options to pass to the # genhtml instance. (Default: based on $CODE_COVERAGE_BRANCH_COVERAGE) # - CODE_COVERAGE_GENHTML_OPTIONS: Extra options to pass to the genhtml # instance. (Default: $CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) # - CODE_COVERAGE_IGNORE_PATTERN: Extra glob pattern of files to ignore # # The generated report will be titled using the $(PACKAGE_NAME) and # $(PACKAGE_VERSION). In order to add the current git hash to the title, # use the git-version-gen script, available online. # Optional variables CODE_COVERAGE_DIRECTORY ?= $(top_builddir) CODE_COVERAGE_OUTPUT_FILE ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage.info CODE_COVERAGE_OUTPUT_DIRECTORY ?= $(PACKAGE_NAME)-$(PACKAGE_VERSION)-coverage CODE_COVERAGE_BRANCH_COVERAGE ?= CODE_COVERAGE_LCOV_SHOPTS_DEFAULT ?= $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc lcov_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_LCOV_SHOPTS ?= $(CODE_COVERAGE_LCOV_SHOPTS_DEFAULT) CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH ?= --gcov-tool "$(GCOV)" CODE_COVERAGE_LCOV_OPTIONS_DEFAULT ?= $(CODE_COVERAGE_LCOV_OPTIONS_GCOVPATH) CODE_COVERAGE_LCOV_OPTIONS ?= $(CODE_COVERAGE_LCOV_OPTIONS_DEFAULT) CODE_COVERAGE_LCOV_RMOPTS_DEFAULT ?= CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) CODE_COVERAGE_IGNORE_PATTERN ?= GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) code_coverage_v_lcov_cap_ = $(code_coverage_v_lcov_cap_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_cap_0 = @echo " LCOV --capture"\ $(CODE_COVERAGE_OUTPUT_FILE); code_coverage_v_lcov_ign = $(code_coverage_v_lcov_ign_$(V)) code_coverage_v_lcov_ign_ = $(code_coverage_v_lcov_ign_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_lcov_ign_0 = @echo " LCOV --remove /tmp/*"\ $(CODE_COVERAGE_IGNORE_PATTERN); code_coverage_v_genhtml = $(code_coverage_v_genhtml_$(V)) code_coverage_v_genhtml_ = $(code_coverage_v_genhtml_$(AM_DEFAULT_VERBOSITY)) code_coverage_v_genhtml_0 = @echo " GEN " $(CODE_COVERAGE_OUTPUT_DIRECTORY); code_coverage_quiet = $(code_coverage_quiet_$(V)) code_coverage_quiet_ = $(code_coverage_quiet_$(AM_DEFAULT_VERBOSITY)) code_coverage_quiet_0 = --quiet # sanitizes the test-name: replaces with underscores: dashes and dots code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: '"$CODE_COVERAGE_RULES_CLEAN"' A''M_DISTCHECK_CONFIGURE_FLAGS ?= A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage .PHONY: check-code-coverage code-coverage-capture code-coverage-capture-hook code-coverage-clean ' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi # Libtool configuration for different targets. See acinclude.m4 # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XMLTO+:} false; then : $as_echo_n "(cached) " >&6 else case $XMLTO in [\\/]* | ?:[\\/]*) ac_cv_path_XMLTO="$XMLTO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XMLTO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi XMLTO=$ac_cv_path_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "asciidoc", so it can be a program name with args. set dummy asciidoc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ASCIIDOC+:} false; then : $as_echo_n "(cached) " >&6 else case $ASCIIDOC in [\\/]* | ?:[\\/]*) ac_cv_path_ASCIIDOC="$ASCIIDOC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ASCIIDOC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ASCIIDOC=$ac_cv_path_ASCIIDOC if test -n "$ASCIIDOC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASCIIDOC" >&5 $as_echo "$ASCIIDOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { # Libtool configuration for different targets case "${host_os}" in *mingw*|*cygwin*|*msys*) # Disable static build by default # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=no fi ;; *) # Everything else with static enabled # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi ;; esac } enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi link_all_deplibs=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: # Check whether --enable-valgrind was given. if test "${enable_valgrind+set}" = set; then : enableval=$enable_valgrind; enable_valgrind=$enableval else enable_valgrind= fi if test "$enable_valgrind" != "no"; then : # Check for Valgrind. # Extract the first word of "valgrind", so it can be a program name with args. set dummy valgrind; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_VALGRIND+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$VALGRIND"; then ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_VALGRIND="valgrind" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi VALGRIND=$ac_cv_prog_VALGRIND if test -n "$VALGRIND"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 $as_echo "$VALGRIND" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$VALGRIND" = ""; then : if test "$enable_valgrind" = "yes"; then : as_fn_error $? "Could not find valgrind; either install it or reconfigure with --disable-valgrind" "$LINENO" 5 else enable_valgrind=no fi else enable_valgrind=yes fi fi if test "$enable_valgrind" = "yes"; then VALGRIND_ENABLED_TRUE= VALGRIND_ENABLED_FALSE='#' else VALGRIND_ENABLED_TRUE='#' VALGRIND_ENABLED_FALSE= fi VALGRIND_ENABLED=$enable_valgrind # Check for Valgrind tools we care about. if test "$VALGRIND" != ""; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool memcheck" >&5 $as_echo_n "checking for Valgrind tool memcheck... " >&6; } if ${ax_cv_valgrind_tool_memcheck+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_valgrind_tool_memcheck= if `$VALGRIND --tool=memcheck --help >/dev/null 2>&1`; then : ax_cv_valgrind_tool_memcheck="memcheck" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_memcheck" >&5 $as_echo "$ax_cv_valgrind_tool_memcheck" >&6; } VALGRIND_HAVE_TOOL_memcheck=$ax_cv_valgrind_tool_memcheck { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool helgrind" >&5 $as_echo_n "checking for Valgrind tool helgrind... " >&6; } if ${ax_cv_valgrind_tool_helgrind+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_valgrind_tool_helgrind= if `$VALGRIND --tool=helgrind --help >/dev/null 2>&1`; then : ax_cv_valgrind_tool_helgrind="helgrind" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_helgrind" >&5 $as_echo "$ax_cv_valgrind_tool_helgrind" >&6; } VALGRIND_HAVE_TOOL_helgrind=$ax_cv_valgrind_tool_helgrind { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool drd" >&5 $as_echo_n "checking for Valgrind tool drd... " >&6; } if ${ax_cv_valgrind_tool_drd+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_valgrind_tool_drd= if `$VALGRIND --tool=drd --help >/dev/null 2>&1`; then : ax_cv_valgrind_tool_drd="drd" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_drd" >&5 $as_echo "$ax_cv_valgrind_tool_drd" >&6; } VALGRIND_HAVE_TOOL_drd=$ax_cv_valgrind_tool_drd { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool exp-sgcheck" >&5 $as_echo_n "checking for Valgrind tool exp-sgcheck... " >&6; } if ${ax_cv_valgrind_tool_exp_sgcheck+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_valgrind_tool_exp_sgcheck= if `$VALGRIND --tool=exp-sgcheck --help >/dev/null 2>&1`; then : ax_cv_valgrind_tool_exp_sgcheck="exp-sgcheck" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_exp_sgcheck" >&5 $as_echo "$ax_cv_valgrind_tool_exp_sgcheck" >&6; } VALGRIND_HAVE_TOOL_exp_sgcheck=$ax_cv_valgrind_tool_exp_sgcheck fi VALGRIND_CHECK_RULES=' # Valgrind check # # Optional: # - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions # files to load. (Default: empty) # - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. # (Default: --num-callers=30) # - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: # memcheck, helgrind, drd, sgcheck). (Default: various) # Optional variables VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) VALGRIND_FLAGS ?= --num-callers=30 VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no VALGRIND_helgrind_FLAGS ?= --history-level=approx VALGRIND_drd_FLAGS ?= VALGRIND_sgcheck_FLAGS ?= # Internal use valgrind_tools = memcheck helgrind drd sgcheck valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) valgrind_quiet = $(valgrind_quiet_$(V)) valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) valgrind_quiet_0 = --quiet # Support running with and without libtool. ifneq ($(LIBTOOL),) valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute else valgrind_lt = endif # Use recursive makes in order to ignore errors during check check-valgrind: ifeq ($(VALGRIND_ENABLED),yes) -$(foreach tool,$(valgrind_tools), \ $(if $(VALGRIND_HAVE_TOOL_$(tool))$(VALGRIND_HAVE_TOOL_exp_$(tool)), \ $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-tool VALGRIND_TOOL=$(tool); \ ) \ ) else @echo "Need to reconfigure with --enable-valgrind" endif # Valgrind running VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env VALGRIND=$(VALGRIND) \ G_SLICE=always-malloc,debug-blocks \ G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly VALGRIND_LOG_COMPILER = \ $(valgrind_lt) \ $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) check-valgrind-tool: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_$(VALGRIND_TOOL)_flags)" \ TEST_SUITE_LOG=test-suite-$(VALGRIND_TOOL).log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-memcheck: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_memcheck_flags)" \ TEST_SUITE_LOG=test-suite-memcheck.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-helgrind: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_helgrind_flags)" \ TEST_SUITE_LOG=test-suite-helgrind.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-drd: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_drd_flags)" \ TEST_SUITE_LOG=test-suite-drd.log else @echo "Need to reconfigure with --enable-valgrind" endif check-valgrind-sgcheck: ifeq ($(VALGRIND_ENABLED),yes) $(MAKE) check-TESTS \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" \ LOG_COMPILER="$(VALGRIND_LOG_COMPILER)" \ LOG_FLAGS="$(valgrind_sgcheck_flags)" \ TEST_SUITE_LOG=test-suite-sgcheck.log else @echo "Need to reconfigure with --enable-valgrind" endif A''M_DISTCHECK_CONFIGURE_FLAGS ?= A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind MOSTLYCLEANFILES ?= MOSTLYCLEANFILES += $(valgrind_log_files) .PHONY: check-valgrind check-valgrind-tool ' # Check whether to build a with debug symbols { # For that the compiler works and try to come up with the type ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { # Test that compiler for the current language actually works { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } if ${libzmq_cv_c_compiler_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : libzmq_cv_c_compiler_works="yes" ; else libzmq_cv_c_compiler_works="no" ; fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_c_compiler_works" >&5 $as_echo "$libzmq_cv_c_compiler_works" >&6; } if test "x$libzmq_cv_c_compiler_works" != "xyes"; then as_fn_error $? "Unable to find a working C compiler" "$LINENO" 5 fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C compiler" >&5 $as_echo_n "checking whether we are using Intel C compiler... " >&6; } if ${libzmq_cv_c_intel_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __INTEL_COMPILER error if not ICC #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libzmq_cv_c_intel_compiler="yes" ; else libzmq_cv_c_intel_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_c_intel_compiler" >&5 $as_echo "$libzmq_cv_c_intel_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Sun Studio C compiler" >&5 $as_echo_n "checking whether we are using Sun Studio C compiler... " >&6; } if ${libzmq_cv_c_sun_studio_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) error if not sun studio #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libzmq_cv_c_sun_studio_compiler="yes" ; else libzmq_cv_c_sun_studio_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_c_sun_studio_compiler" >&5 $as_echo "$libzmq_cv_c_sun_studio_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using clang C compiler" >&5 $as_echo_n "checking whether we are using clang C compiler... " >&6; } if ${libzmq_cv_c_clang_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __clang__ error if not clang #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libzmq_cv_c_clang_compiler="yes" ; else libzmq_cv_c_clang_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_c_clang_compiler" >&5 $as_echo "$libzmq_cv_c_clang_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using gcc >= 4 C compiler" >&5 $as_echo_n "checking whether we are using gcc >= 4 C compiler... " >&6; } if ${libzmq_cv_c_gcc4_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if (!defined __GNUC__ || __GNUC__ < 4) error if not gcc4 or higher #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : libzmq_cv_c_gcc4_compiler="yes" ; else libzmq_cv_c_gcc4_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_c_gcc4_compiler" >&5 $as_echo "$libzmq_cv_c_gcc4_compiler" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { # Test that compiler for the current language actually works { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } if ${libzmq_cv_cxx_compiler_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : libzmq_cv_cxx_compiler_works="yes" ; else libzmq_cv_cxx_compiler_works="no" ; fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_compiler_works" >&5 $as_echo "$libzmq_cv_cxx_compiler_works" >&6; } if test "x$libzmq_cv_cxx_compiler_works" != "xyes"; then as_fn_error $? "Unable to find a working C++ compiler" "$LINENO" 5 fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Intel C++ compiler" >&5 $as_echo_n "checking whether we are using Intel C++ compiler... " >&6; } if ${libzmq_cv_cxx_intel_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __INTEL_COMPILER error if not ICC #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : libzmq_cv_cxx_intel_compiler="yes" ; else libzmq_cv_cxx_intel_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_intel_compiler" >&5 $as_echo "$libzmq_cv_cxx_intel_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using Sun Studio C++ compiler" >&5 $as_echo_n "checking whether we are using Sun Studio C++ compiler... " >&6; } if ${libzmq_cv_cxx_sun_studio_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if !defined(__SUNPRO_CC) && !defined(__SUNPRO_C) error if not sun studio #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : libzmq_cv_cxx_sun_studio_compiler="yes" ; else libzmq_cv_cxx_sun_studio_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_sun_studio_compiler" >&5 $as_echo "$libzmq_cv_cxx_sun_studio_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using clang C++ compiler" >&5 $as_echo_n "checking whether we are using clang C++ compiler... " >&6; } if ${libzmq_cv_cxx_clang_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __clang__ error if not clang #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : libzmq_cv_cxx_clang_compiler="yes" ; else libzmq_cv_cxx_clang_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_clang_compiler" >&5 $as_echo "$libzmq_cv_cxx_clang_compiler" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using gcc >= 4 C++ compiler" >&5 $as_echo_n "checking whether we are using gcc >= 4 C++ compiler... " >&6; } if ${libzmq_cv_cxx_gcc4_compiler+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if (!defined __GNUC__ || __GNUC__ < 4) error if not gcc4 or higher #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : libzmq_cv_cxx_gcc4_compiler="yes" ; else libzmq_cv_cxx_gcc4_compiler="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_gcc4_compiler" >&5 $as_echo "$libzmq_cv_cxx_gcc4_compiler" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Set GCC and GXX variables correctly if test "x$GCC" = "xyes"; then if test "xyes" = "x$libzmq_cv_c_intel_compiler"; then GCC="no" fi fi if test "x$GXX" = "xyes"; then if test "xyes" = "x$libzmq_cv_cxx_intel_compiler"; then GXX="no" fi fi } { # Require compiler specifics # This flag is checked also in # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging information" >&5 $as_echo_n "checking whether to enable debugging information... " >&6; } if test "x$enable_debug" = "xyes"; then # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ "x$libzmq_cv_c_intel_compiler" = "xyes" -o \ "x$libzmq_cv_c_clang_compiler" = "xyes"; then CFLAGS="-g -O0 " elif test "x$libzmq_cv_c_sun_studio_compiler" = "xyes"; then CFLAGS="-g0 " fi # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then CPPFLAGS="-g -O0 " CXXFLAGS="-g -O0 " # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then CPPFLAGS="-g0 " CXXFLAGS="-g0 " fi if test "x$ZMQ_ORIG_CFLAGS" != "xnone"; then CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" fi if test "x$ZMQ_ORIG_CPPFLAGS" != "xnone"; then CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" fi if test "x$ZMQ_ORIG_CXXFLAGS" != "xnone"; then CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi } # Check whether to enable code coverage { # Require compiler specifics # Check whether --with-gcov was given. if test "${with_gcov+set}" = set; then : withval=$with_gcov; ZMQ_GCOV="$withval" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable code coverage" >&5 $as_echo_n "checking whether to enable code coverage... " >&6; } if test "x$ZMQ_GCOV" = "xyes"; then if test "x$GXX" != "xyes"; then as_fn_error $? "--with-gcov=yes works only with GCC" "$LINENO" 5 fi CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}" fi CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage" if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}" fi CXXFLAGS="-fprofile-arcs" if test "x${ZMQ_ORIG_CXXFLAGS}" != "xnone"; then CXXFLAGS="${CXXFLAGS} ${ZMQ_ORIG_CXXFLAGS}" fi LIBS="-lgcov ${LIBS}" fi if test "x$ZMQ_GCOV" = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if TIPC is available and supports nonblocking connect" >&5 $as_echo_n "checking if TIPC is available and supports nonblocking connect... " >&6; } if test "$cross_compiling" = yes; then : libzmq_tipc_support=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include #include int main () { struct sockaddr_tipc topsrv; int sd = socket(AF_TIPC, SOCK_SEQPACKET, 0); memset(&topsrv, 0, sizeof(topsrv)); topsrv.family = AF_TIPC; topsrv.addrtype = TIPC_ADDR_NAME; topsrv.addr.name.name.type = TIPC_TOP_SRV; topsrv.addr.name.name.instance = TIPC_TOP_SRV; fcntl(sd, F_SETFL, O_NONBLOCK); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libzmq_tipc_support=yes else libzmq_tipc_support=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_tipc_support" >&5 $as_echo "$libzmq_tipc_support" >&6; } # Check whether --enable-pedantic was given. if test "${enable_pedantic+set}" = set; then : enableval=$enable_pedantic; libzmq_pedantic=$enableval else libzmq_pedantic=yes fi # Check whether --with-militant was given. if test "${with_militant+set}" = set; then : withval=$with_militant; zmq_militant="yes" fi if test "x$zmq_militant" = "xyes"; then $as_echo "#define ZMQ_ACT_MILITANT 1" >>confdefs.h fi # Memory mis-use detection { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ASan" >&5 $as_echo_n "checking whether to enable ASan... " >&6; } # Check whether --enable-address-sanitizer was given. if test "${enable_address_sanitizer+set}" = set; then : enableval=$enable_address_sanitizer; ZMQ_ASAN="$enableval" fi if test "x${ZMQ_ASAN}" == "xyes"; then CFLAGS="${CFLAGS} -fsanitize=address" CXXFLAGS="${CXXFLAGS} -fsanitize=address" if true; then ENABLE_ASAN_TRUE= ENABLE_ASAN_FALSE='#' else ENABLE_ASAN_TRUE='#' ENABLE_ASAN_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else if false; then ENABLE_ASAN_TRUE= ENABLE_ASAN_FALSE='#' else ENABLE_ASAN_TRUE='#' ENABLE_ASAN_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # By default compiling with -Werror except OSX and on Solaris when building # with libsodium. # Check whether --enable-Werror was given. if test "${enable_Werror+set}" = set; then : enableval=$enable_Werror; libzmq_werror=$enableval else libzmq_werror=yes fi # By default use DSO visibility libzmq_dso_visibility="yes" # Platform specific checks libzmq_on_mingw="no" libzmq_on_cygwin="no" libzmq_on_android="no" libzmq_on_linux="no" libzmq_on_gnu="no" # Set some default features required by ZeroMQ code CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -Wno-long-long $CPPFLAGS" # Will be used to add flags to pkg-config useful when apps want to statically link PKGCFG_LIBS_PRIVATE="" # For host type checks # OS-specific tests case "${host_os}" in *linux*) # Define on Linux to enable all library features. Define if using a gnu compiler if test "x$GXX" = "xyes"; then CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" fi $as_echo "#define ZMQ_HAVE_LINUX 1" >>confdefs.h libzmq_on_linux="yes" # dladdr/dlopen is in libdl on glibc { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dladdr" >&5 $as_echo_n "checking for library containing dladdr... " >&6; } if ${ac_cv_search_dladdr+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dladdr (); int main () { return dladdr (); ; return 0; } _ACEOF for ac_lib in '' dl dld; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_dladdr=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dladdr+:} false; then : break fi done if ${ac_cv_search_dladdr+:} false; then : else ac_cv_search_dladdr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dladdr" >&5 $as_echo "$ac_cv_search_dladdr" >&6; } ac_res=$ac_cv_search_dladdr if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else as_fn_error $? "unable to find the dladdr() function" "$LINENO" 5 fi if test "x$libzmq_tipc_support" = "xyes"; then $as_echo "#define ZMQ_HAVE_TIPC 1" >>confdefs.h fi case "${host_os}" in *android*) $as_echo "#define ZMQ_HAVE_ANDROID 1" >>confdefs.h libzmq_on_android="yes" ;; esac ;; *solaris*) # Define on Solaris to enable all library features CPPFLAGS="-Wno-sign-compare -D_PTHREADS $CPPFLAGS" $as_echo "#define ZMQ_HAVE_SOLARIS 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic operations can be used" >&5 $as_echo_n "checking whether atomic operations can be used... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { uint32_t value; atomic_cas_32 (&value, 0, 0); return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : solaris_has_atomic=yes else solaris_has_atomic=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $solaris_has_atomic" >&5 $as_echo "$solaris_has_atomic" >&6; } # Solaris 8 does not have atomic operations exported to user space. if test "x$solaris_has_atomic" = "xno"; then $as_echo "#define ZMQ_FORCE_MUTEXES 1" >>confdefs.h fi ;; *freebsd*) # Define on FreeBSD to enable all library features CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" $as_echo "#define ZMQ_HAVE_FREEBSD 1" >>confdefs.h ;; *dragonfly*) CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" $as_echo "#define ZMQ_HAVE_DRAGONFLY 1" >>confdefs.h ;; *darwin*) # Define on Darwin to enable all library features CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS" libzmq_pedantic="no" libzmq_werror="no" $as_echo "#define ZMQ_HAVE_OSX 1" >>confdefs.h ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler supports -Wno-uninitialized" >&5 $as_echo_n "checking whether C++ compiler supports -Wno-uninitialized... " >&6; } libzmq_cv_cxx_werror_flag_save=$ac_cxx_werror_flag ac_cxx_werror_flag="yes" case "xcxx" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-uninitialized" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Wno-uninitialized" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: testing compiler characteristic on an unknown language" >&5 $as_echo "$as_me: WARNING: testing compiler characteristic on an unknown language" >&2;} ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval libzmq_cv_cxx_supports_flag__Wno_uninitialized="no" else eval libzmq_cv_cxx_supports_flag__Wno_uninitialized="yes" fi else eval libzmq_cv_cxx_supports_flag__Wno_uninitialized="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "xcxx" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_cxx_werror_flag=$libzmq_cv_cxx_werror_flag_save # Call the action as the flags are restored if eval test x$libzmq_cv_cxx_supports_flag__Wno_uninitialized = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } case "xcxx" in xc) if eval test x$libzmq_cv_cxx_supports_flag__Wno_uninitialized = "xyes"; then : CFLAGS="-Wno-uninitialized $CFLAGS"; fi ;; xcxx) if eval test x$libzmq_cv_cxx_supports_flag__Wno_uninitialized = "xyes"; then : CPPFLAGS="-Wno-uninitialized $CPPFLAGS"; fi ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; *haiku*) $as_echo "#define ZMQ_HAVE_HAIKU 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lnetwork" >&5 $as_echo_n "checking for socket in -lnetwork... " >&6; } if ${ac_cv_lib_network_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_network_socket=yes else ac_cv_lib_network_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_socket" >&5 $as_echo "$ac_cv_lib_network_socket" >&6; } if test "x$ac_cv_lib_network_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNETWORK 1 _ACEOF LIBS="-lnetwork $LIBS" fi ;; *netbsd*) # Define on NetBSD to enable all library features CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS" $as_echo "#define ZMQ_HAVE_NETBSD 1" >>confdefs.h # NetBSD 5.0 and newer provides atomic operations but we can # only use these on systems where PR #42842 has been fixed so # we must try and link a test program using C++. libzmq_netbsd_has_atomic=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic operations can be used" >&5 $as_echo_n "checking whether atomic operations can be used... " >&6; } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { uint32_t value; atomic_cas_32 (&value, 0, 0); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : libzmq_netbsd_has_atomic=yes else libzmq_netbsd_has_atomic=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_netbsd_has_atomic" >&5 $as_echo "$libzmq_netbsd_has_atomic" >&6; } if test "x$libzmq_netbsd_has_atomic" = "xno"; then $as_echo "#define ZMQ_FORCE_MUTEXES 1" >>confdefs.h fi ;; *openbsd*|*bitrig*) # Define on OpenBSD to enable all library features CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS" $as_echo "#define ZMQ_HAVE_OPENBSD 1" >>confdefs.h ;; *nto-qnx*) libzmq_pedantic="no" $as_echo "#define ZMQ_HAVE_QNXNTO 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ;; *aix*) $as_echo "#define ZMQ_HAVE_AIX 1" >>confdefs.h ;; *hpux*) # Define on HP-UX to enable all library features CPPFLAGS="-D_POSIX_C_SOURCE=200112L $CPPFLAGS" $as_echo "#define ZMQ_HAVE_HPUX 1" >>confdefs.h { { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler supports -Ae" >&5 $as_echo_n "checking whether C compiler supports -Ae... " >&6; } libzmq_cv_c_werror_flag_save=$ac_c_werror_flag ac_c_werror_flag="yes" case "xc" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Ae" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -Ae" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: testing compiler characteristic on an unknown language" >&5 $as_echo "$as_me: WARNING: testing compiler characteristic on an unknown language" >&2;} ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval libzmq_cv_c_supports_flag__Ae="no" else eval libzmq_cv_c_supports_flag__Ae="yes" fi else eval libzmq_cv_c_supports_flag__Ae="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "xc" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_c_werror_flag=$libzmq_cv_c_werror_flag_save # Call the action as the flags are restored if eval test x$libzmq_cv_c_supports_flag__Ae = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } case "xc" in xc) if eval test x$libzmq_cv_c_supports_flag__Ae = "xyes"; then : CFLAGS="-Ae $CFLAGS"; fi ;; xcxx) if eval test x$libzmq_cv_c_supports_flag__Ae = "xyes"; then : CPPFLAGS="-Ae $CPPFLAGS"; fi ;; esac } for ac_func in gethrtime do : ac_fn_c_check_func "$LINENO" "gethrtime" "ac_cv_func_gethrtime" if test "x$ac_cv_func_gethrtime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETHRTIME 1 _ACEOF fi done ;; *mingw*|*msys*) $as_echo "#define ZMQ_HAVE_WINDOWS 1" >>confdefs.h $as_echo "#define ZMQ_HAVE_MINGW 1" >>confdefs.h for ac_header in windows.h do : ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" if test "x$ac_cv_header_windows_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 $as_echo_n "checking for main in -lws2_32... " >&6; } if ${ac_cv_lib_ws2_32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lws2_32 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ws2_32_main=yes else ac_cv_lib_ws2_32_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 $as_echo "$ac_cv_lib_ws2_32_main" >&6; } if test "x$ac_cv_lib_ws2_32_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF LIBS="-lws2_32 $LIBS" else as_fn_error $? "cannot link with ws2_32.dll." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lrpcrt4" >&5 $as_echo_n "checking for main in -lrpcrt4... " >&6; } if ${ac_cv_lib_rpcrt4_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrpcrt4 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rpcrt4_main=yes else ac_cv_lib_rpcrt4_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rpcrt4_main" >&5 $as_echo "$ac_cv_lib_rpcrt4_main" >&6; } if test "x$ac_cv_lib_rpcrt4_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRPCRT4 1 _ACEOF LIBS="-lrpcrt4 $LIBS" else as_fn_error $? "cannot link with rpcrt4.dll." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -liphlpapi" >&5 $as_echo_n "checking for main in -liphlpapi... " >&6; } if ${ac_cv_lib_iphlpapi_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liphlpapi $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iphlpapi_main=yes else ac_cv_lib_iphlpapi_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iphlpapi_main" >&5 $as_echo "$ac_cv_lib_iphlpapi_main" >&6; } if test "x$ac_cv_lib_iphlpapi_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBIPHLPAPI 1 _ACEOF LIBS="-liphlpapi $LIBS" else as_fn_error $? "cannot link with iphlpapi.dll." "$LINENO" 5 fi libzmq_on_mingw="yes" libzmq_dso_visibility="no" if test "x$enable_static" = "xyes"; then CPPFLAGS="-DZMQ_STATIC $CPPFLAGS" PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -liphlpapi" fi # Set FD_SETSIZE to 16384 CPPFLAGS=" -DFD_SETSIZE=16384 $CPPFLAGS" ;; *cygwin*) # Define on Cygwin to enable all library features CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" $as_echo "#define ZMQ_HAVE_CYGWIN 1" >>confdefs.h libzmq_on_cygwin="yes" libzmq_dso_visibility="no" if test "x$enable_static" = "xyes"; then as_fn_error $? "Building static libraries is not supported under Cygwin" "$LINENO" 5 fi ;; gnu*) # Define on GNU/Hurd to enable all library features. Define if using a gnu compiler if test "x$GXX" = "xyes"; then CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" fi $as_echo "#define ZMQ_HAVE_GNU 1" >>confdefs.h libzmq_on_gnu="yes" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_init in -lrt" >&5 $as_echo_n "checking for sem_init in -lrt... " >&6; } if ${ac_cv_lib_rt_sem_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sem_init (); int main () { return sem_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_sem_init=yes else ac_cv_lib_rt_sem_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sem_init" >&5 $as_echo "$ac_cv_lib_rt_sem_init" >&6; } if test "x$ac_cv_lib_rt_sem_init" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi ;; *) as_fn_error $? "unsupported system: ${host_os}." "$LINENO" 5 ;; esac # Checks for libraries { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_create=yes else ac_cv_lib_pthread_pthread_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } if ${ac_cv_lib_rt_clock_gettime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_clock_gettime=yes else ac_cv_lib_rt_clock_gettime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi # # Check if the compiler supports -fvisibility=hidden flag. MinGW uses __declspec # if test "x$libzmq_dso_visibility" = "xyes"; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { libzmq_cv_cxx_visibility_flag="" if test "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_clang_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_gcc4_compiler" = "xyes"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler supports -fvisibility=hidden" >&5 $as_echo_n "checking whether C++ compiler supports -fvisibility=hidden... " >&6; } libzmq_cv_cxx_werror_flag_save=$ac_cxx_werror_flag ac_cxx_werror_flag="yes" case "xcxx" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -fvisibility=hidden" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: testing compiler characteristic on an unknown language" >&5 $as_echo "$as_me: WARNING: testing compiler characteristic on an unknown language" >&2;} ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval libzmq_cv_cxx_supports_flag__fvisibility_hidden="no" else eval libzmq_cv_cxx_supports_flag__fvisibility_hidden="yes" fi else eval libzmq_cv_cxx_supports_flag__fvisibility_hidden="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "xcxx" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_cxx_werror_flag=$libzmq_cv_cxx_werror_flag_save # Call the action as the flags are restored if eval test x$libzmq_cv_cxx_supports_flag__fvisibility_hidden = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; libzmq_cv_cxx_visibility_flag="-fvisibility=hidden" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler supports -xldscope=hidden" >&5 $as_echo_n "checking whether C++ compiler supports -xldscope=hidden... " >&6; } libzmq_cv_cxx_werror_flag_save=$ac_cxx_werror_flag ac_cxx_werror_flag="yes" case "xcxx" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -xldscope=hidden" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -xldscope=hidden" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: testing compiler characteristic on an unknown language" >&5 $as_echo "$as_me: WARNING: testing compiler characteristic on an unknown language" >&2;} ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval libzmq_cv_cxx_supports_flag__xldscope_hidden="no" else eval libzmq_cv_cxx_supports_flag__xldscope_hidden="yes" fi else eval libzmq_cv_cxx_supports_flag__xldscope_hidden="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "xcxx" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_cxx_werror_flag=$libzmq_cv_cxx_werror_flag_save # Call the action as the flags are restored if eval test x$libzmq_cv_cxx_supports_flag__xldscope_hidden = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; libzmq_cv_cxx_visibility_flag="-xldscope=hidden" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler supports dso visibility" >&5 $as_echo_n "checking whether C++ compiler supports dso visibility... " >&6; } if test "x$libzmq_cv_cxx_visibility_flag" != "x"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; LIBZMQ_EXTRA_CXXFLAGS="$libzmq_cv_cxx_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi # CPU-specific optimizations case "${host_cpu}" in *sparc64*) ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler supports -mcpu=v9" >&5 $as_echo_n "checking whether C++ compiler supports -mcpu=v9... " >&6; } libzmq_cv_cxx_werror_flag_save=$ac_cxx_werror_flag ac_cxx_werror_flag="yes" case "xcxx" in xc) libzmq_cv_check_lang_flag_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mcpu=v9" ;; xcxx) libzmq_cv_check_lang_flag_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -mcpu=v9" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: testing compiler characteristic on an unknown language" >&5 $as_echo "$as_me: WARNING: testing compiler characteristic on an unknown language" >&2;} ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # This hack exist for ICC, which outputs unknown options as remarks # Remarks are not turned into errors even with -Werror on if ($GREP 'ignoring unknown' conftest.err || $GREP 'not supported' conftest.err) >/dev/null 2>&1; then eval libzmq_cv_cxx_supports_flag__mcpu_v9="no" else eval libzmq_cv_cxx_supports_flag__mcpu_v9="yes" fi else eval libzmq_cv_cxx_supports_flag__mcpu_v9="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext case "xcxx" in xc) CFLAGS="$libzmq_cv_check_lang_flag_save_CFLAGS" ;; xcxx) CPPFLAGS="$libzmq_cv_check_lang_flag_save_CPPFLAGS" ;; *) # nothing to restore ;; esac # Restore the werror flag ac_cxx_werror_flag=$libzmq_cv_cxx_werror_flag_save # Call the action as the flags are restored if eval test x$libzmq_cv_cxx_supports_flag__mcpu_v9 = "xyes"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; fi } case "xcxx" in xc) if eval test x$libzmq_cv_cxx_supports_flag__mcpu_v9 = "xyes"; then : CFLAGS="-mcpu=v9 $CFLAGS"; fi ;; xcxx) if eval test x$libzmq_cv_cxx_supports_flag__mcpu_v9 = "xyes"; then : CPPFLAGS="-mcpu=v9 $CPPFLAGS"; fi ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ;; *) ;; esac # Check whether to build docs / install man pages { # Man pages are built/installed if asciidoc and xmlto are present # --with-docs=no overrides this # Check whether --with-docs was given. if test "${with_docs+set}" = set; then : withval=$with_docs; with_docs=$withval fi # Check whether --with-documentation was given. if test "${with_documentation+set}" = set; then : withval=$with_documentation; fi if test "x$with_documentation" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --without-documentation is DEPRECATED and will be removed in the next release, use --without-docs" >&5 $as_echo "$as_me: WARNING: --without-documentation is DEPRECATED and will be removed in the next release, use --without-docs" >&2;} fi if test "x$with_docs" = "xno" || test "x$with_documentation" = "xno"; then libzmq_build_doc="no" libzmq_install_man="no" else # Determine whether or not documentation should be built and installed. libzmq_build_doc="yes" libzmq_install_man="yes" # Check for asciidoc and xmlto and don't build the docs if these are not installed. # Extract the first word of "asciidoc", so it can be a program name with args. set dummy asciidoc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_libzmq_have_asciidoc+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$libzmq_have_asciidoc"; then ac_cv_prog_libzmq_have_asciidoc="$libzmq_have_asciidoc" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_libzmq_have_asciidoc="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_libzmq_have_asciidoc" && ac_cv_prog_libzmq_have_asciidoc="no" fi fi libzmq_have_asciidoc=$ac_cv_prog_libzmq_have_asciidoc if test -n "$libzmq_have_asciidoc"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_have_asciidoc" >&5 $as_echo "$libzmq_have_asciidoc" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xmlto", so it can be a program name with args. set dummy xmlto; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_libzmq_have_xmlto+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$libzmq_have_xmlto"; then ac_cv_prog_libzmq_have_xmlto="$libzmq_have_xmlto" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_libzmq_have_xmlto="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_libzmq_have_xmlto" && ac_cv_prog_libzmq_have_xmlto="no" fi fi libzmq_have_xmlto=$ac_cv_prog_libzmq_have_xmlto if test -n "$libzmq_have_xmlto"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_have_xmlto" >&5 $as_echo "$libzmq_have_xmlto" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$libzmq_have_asciidoc" = "xno" -o "x$libzmq_have_xmlto" = "xno"; then libzmq_build_doc="no" # Tarballs built with 'make dist' ship with prebuilt documentation. if ! test -f doc/zmq.7; then libzmq_install_man="no" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed." >&5 $as_echo "$as_me: WARNING: You are building an unreleased version of 0MQ and asciidoc or xmlto are not installed." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Documentation will not be built and manual pages will not be installed." >&5 $as_echo "$as_me: WARNING: Documentation will not be built and manual pages will not be installed." >&2;} fi fi # Do not install man pages if on mingw if test "x$libzmq_on_mingw" = "xyes"; then libzmq_install_man="no" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build documentation" >&5 $as_echo_n "checking whether to build documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_build_doc" >&5 $as_echo "$libzmq_build_doc" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install manpages" >&5 $as_echo_n "checking whether to install manpages... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_install_man" >&5 $as_echo "$libzmq_install_man" >&6; } if test "x$libzmq_build_doc" = "xyes"; then BUILD_DOC_TRUE= BUILD_DOC_FALSE='#' else BUILD_DOC_TRUE='#' BUILD_DOC_FALSE= fi if test "x$libzmq_install_man" = "xyes"; then INSTALL_MAN_TRUE= INSTALL_MAN_FALSE='#' else INSTALL_MAN_TRUE='#' INSTALL_MAN_FALSE= fi } # Check polling system, set appropriate macro in src/platform.hpp { # Allow user to override poller autodetection # Check whether --with-poller was given. if test "${with_poller+set}" = set; then : withval=$with_poller; fi if test "x$with_poller" == "x"; then pollers=auto else pollers=$with_poller fi if test "$pollers" == "auto"; then # We search for pollers in this order pollers="kqueue epoll devpoll pollset poll select" fi # try to find suitable polling system. the order of testing is: { $as_echo "$as_me:${as_lineno-$LINENO}: Choosing polling system from '$pollers'..." >&5 $as_echo "$as_me: Choosing polling system from '$pollers'..." >&6;} poller_found=0 for poller in $pollers; do case "$poller" in kqueue) { cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { struct kevent t_kev; kqueue(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'kqueue' polling system" >&5 $as_echo "$as_me: Using 'kqueue' polling system" >&6;} $as_echo "#define ZMQ_USE_KQUEUE 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext } ;; epoll) case "$host_os" in solaris*|sunos*) # Recent illumos and Solaris systems did add epoll() # syntax, but it does not fully satisfy expectations # that ZMQ has from Linux systems. Unless you undertake # to fix the integration, do not disable this exception # and use select() or poll() on Solarish OSes for now. { $as_echo "$as_me:${as_lineno-$LINENO}: NOT using 'epoll' polling system on '$host_os'" >&5 $as_echo "$as_me: NOT using 'epoll' polling system on '$host_os'" >&6;} ;; *) { if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; epoll_create1(EPOLL_CLOEXEC); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h $as_echo "#define ZMQ_USE_EPOLL_CLOEXEC 1" >>confdefs.h poller_found=1 else { if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; epoll_create(10); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; int r; r = epoll_create(10); return(r < 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h poller_found=1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; int r; r = epoll_create1(EPOLL_CLOEXEC); return(r < 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h $as_echo "#define ZMQ_USE_EPOLL_CLOEXEC 1" >>confdefs.h poller_found=1 else { if test "$cross_compiling" = yes; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; epoll_create(10); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct epoll_event t_ev; int r; r = epoll_create(10); return(r < 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'epoll' polling system with CLOEXEC" >&5 $as_echo "$as_me: Using 'epoll' polling system with CLOEXEC" >&6;} $as_echo "#define ZMQ_USE_EPOLL 1" >>confdefs.h poller_found=1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi } fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi } ;; esac ;; devpoll) { cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct pollfd t_devpoll; int fd = open("/dev/poll", O_RDWR); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'devpoll' polling system" >&5 $as_echo "$as_me: Using 'devpoll' polling system" >&6;} $as_echo "#define ZMQ_USE_DEVPOLL 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext } ;; pollset) { cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { pollset_t ps = pollset_create(-1); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'pollset' polling system" >&5 $as_echo "$as_me: Using 'pollset' polling system" >&6;} $as_echo "#define ZMQ_USE_POLLSET 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext } ;; poll) { cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct pollfd t_poll; poll(&t_poll, 1, 1); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'poll' polling system" >&5 $as_echo "$as_me: Using 'poll' polling system" >&6;} $as_echo "#define ZMQ_USE_POLL 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext } ;; select) { cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef ZMQ_HAVE_WINDOWS #include "winsock2.h" #elif defined ZMQ_HAVE_OPENVMS #include #include #else #include #endif int main () { fd_set t_rfds; struct timeval tv; FD_ZERO(&t_rfds); FD_SET(0, &t_rfds); tv.tv_sec = 5; tv.tv_usec = 0; select(1, &t_rfds, 0, 0, &tv); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: Using 'select' polling system" >&5 $as_echo "$as_me: Using 'select' polling system" >&6;} $as_echo "#define ZMQ_USE_SELECT 1" >>confdefs.h poller_found=1 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext } ;; esac test $poller_found -eq 1 && break done if test $poller_found -eq 0; then as_fn_error $? "None of '$pollers' are valid pollers on this platform" "$LINENO" 5 fi } # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in \ errno.h \ time.h \ unistd.h \ limits.h \ stddef.h \ stdlib.h \ string.h \ arpa/inet.h \ netinet/tcp.h \ netinet/in.h \ sys/socket.h \ sys/time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check if we have ifaddrs.h header file. for ac_header in ifaddrs.h do : ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default" if test "x$ac_cv_header_ifaddrs_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IFADDRS_H 1 _ACEOF $as_echo "#define ZMQ_HAVE_IFADDRS 1" >>confdefs.h fi done # Check if we have sys/uio.h header file. for ac_header in sys/uio.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_uio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_UIO_H 1 _ACEOF $as_echo "#define ZMQ_HAVE_UIO 1" >>confdefs.h fi done # Force not to use eventfd # Check whether --enable-eventfd was given. if test "${enable_eventfd+set}" = set; then : enableval=$enable_eventfd; zmq_enable_eventfd=$enableval else zmq_enable_eventfd=yes fi if test "x$zmq_enable_eventfd" = "xyes"; then # Check if we have eventfd.h header file. for ac_header in sys/eventfd.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" if test "x$ac_cv_header_sys_eventfd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_EVENTFD_H 1 _ACEOF $as_echo "#define ZMQ_HAVE_EVENTFD 1" >>confdefs.h { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether EFD_CLOEXEC is supported" >&5 $as_echo_n "checking whether EFD_CLOEXEC is supported... " >&6; } if ${libzmq_cv_efd_cloexec+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_efd_cloexec="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* EFD_CLOEXEC test */ #include int main (int argc, char *argv []) { int s = eventfd (0, EFD_CLOEXEC); return (s == -1); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : libzmq_cv_efd_cloexec="yes" else libzmq_cv_efd_cloexec="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_efd_cloexec" >&5 $as_echo "$libzmq_cv_efd_cloexec" >&6; } if test "x$libzmq_cv_efd_cloexec" = "xyes"; then : $as_echo "#define ZMQ_HAVE_EVENTFD_CLOEXEC 1" >>confdefs.h fi } fi done fi # Conditionally build performance measurement tools # Check whether --enable-perf was given. if test "${enable_perf+set}" = set; then : enableval=$enable_perf; zmq_enable_perf=$enableval else zmq_enable_perf=yes fi if test "x$zmq_enable_perf" = "xyes"; then ENABLE_PERF_TRUE= ENABLE_PERF_FALSE='#' else ENABLE_PERF_TRUE='#' ENABLE_PERF_FALSE= fi # Conditionally build curve key generation tool # Check whether --enable-curve-keygen was given. if test "${enable_curve_keygen+set}" = set; then : enableval=$enable_curve_keygen; zmq_enable_curve_keygen=$enableval else zmq_enable_curve_keygen=yes fi # Use c++ in subsequent tests ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_decl "$LINENO" "SO_PEERCRED" "ac_cv_have_decl_SO_PEERCRED" "#include " if test "x$ac_cv_have_decl_SO_PEERCRED" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SO_PEERCRED $ac_have_decl _ACEOF if test $ac_have_decl = 1; then : $as_echo "#define ZMQ_HAVE_SO_PEERCRED 1" >>confdefs.h fi ac_fn_cxx_check_decl "$LINENO" "LOCAL_PEERCRED" "ac_cv_have_decl_LOCAL_PEERCRED" "#include " if test "x$ac_cv_have_decl_LOCAL_PEERCRED" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_LOCAL_PEERCRED $ac_have_decl _ACEOF if test $ac_have_decl = 1; then : $as_echo "#define ZMQ_HAVE_LOCAL_PEERCRED 1" >>confdefs.h fi if test "x$ac_cv_have_decl_SO_PEERCRED" = "xyes" || test "x$ac_cv_have_decl_LOCAL_PEERCRED" = "xyes"; then HAVE_IPC_PEERCRED_TRUE= HAVE_IPC_PEERCRED_FALSE='#' else HAVE_IPC_PEERCRED_TRUE='#' HAVE_IPC_PEERCRED_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac # Checks for typedefs, structures, and compiler characteristics. if test "x$libzmq_cv_cxx_intel_compiler" = "xyes"; then { libzmq_check_with_flag_save_CFLAGS="$CFLAGS" libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS -wd279" CPPFLAGS="$CPPFLAGS -wd279" # Execute the macro ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi CFLAGS="$libzmq_check_with_flag_save_CFLAGS" CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS" } { libzmq_check_with_flag_save_CFLAGS="$CFLAGS" libzmq_check_with_flag_save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS -wd279" CPPFLAGS="$CPPFLAGS -wd279" # Execute the macro ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi CFLAGS="$libzmq_check_with_flag_save_CFLAGS" CPPFLAGS="$libzmq_check_with_flag_save_CPPFLAGS" } else ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi # build using libgssapi_krb5 # Check whether --with-libgssapi_krb5 was given. if test "${with_libgssapi_krb5+set}" = set; then : withval=$with_libgssapi_krb5; require_libgssapi_krb5_ext=$withval else require_libgssapi_krb5_ext=no fi # conditionally require libgssapi_krb5 if test "x$require_libgssapi_krb5_ext" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gssapi_krb5" >&5 $as_echo_n "checking for gssapi_krb5... " >&6; } if test -n "$gssapi_krb5_CFLAGS"; then pkg_cv_gssapi_krb5_CFLAGS="$gssapi_krb5_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"krb5-gssapi\""; } >&5 ($PKG_CONFIG --exists --print-errors "krb5-gssapi") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_gssapi_krb5_CFLAGS=`$PKG_CONFIG --cflags "krb5-gssapi" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$gssapi_krb5_LIBS"; then pkg_cv_gssapi_krb5_LIBS="$gssapi_krb5_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"krb5-gssapi\""; } >&5 ($PKG_CONFIG --exists --print-errors "krb5-gssapi") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_gssapi_krb5_LIBS=`$PKG_CONFIG --libs "krb5-gssapi" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then gssapi_krb5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "krb5-gssapi" 2>&1` else gssapi_krb5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "krb5-gssapi" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$gssapi_krb5_PKG_ERRORS" >&5 for ac_header in gssapi/gssapi_generic.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "gssapi/gssapi_generic.h" "ac_cv_header_gssapi_gssapi_generic_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_generic_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GSSAPI_GSSAPI_GENERIC_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; } if ${ac_cv_search_gss_init_sec_context+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_init_sec_context (); int main () { return gss_init_sec_context (); ; return 0; } _ACEOF for ac_lib in '' gssapi_krb5 gssapi; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_gss_init_sec_context=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gss_init_sec_context+:} false; then : break fi done if ${ac_cv_search_gss_init_sec_context+:} false; then : else ac_cv_search_gss_init_sec_context=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; } ac_res=$ac_cv_search_gss_init_sec_context if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBGSSAPI_KRB5 1" >>confdefs.h else as_fn_error $? "libgssapi_krb5 is needed for GSSAPI security" "$LINENO" 5 fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } for ac_header in gssapi/gssapi_generic.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "gssapi/gssapi_generic.h" "ac_cv_header_gssapi_gssapi_generic_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_generic_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GSSAPI_GSSAPI_GENERIC_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gss_init_sec_context" >&5 $as_echo_n "checking for library containing gss_init_sec_context... " >&6; } if ${ac_cv_search_gss_init_sec_context+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gss_init_sec_context (); int main () { return gss_init_sec_context (); ; return 0; } _ACEOF for ac_lib in '' gssapi_krb5 gssapi; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_gss_init_sec_context=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_gss_init_sec_context+:} false; then : break fi done if ${ac_cv_search_gss_init_sec_context+:} false; then : else ac_cv_search_gss_init_sec_context=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gss_init_sec_context" >&5 $as_echo "$ac_cv_search_gss_init_sec_context" >&6; } ac_res=$ac_cv_search_gss_init_sec_context if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBGSSAPI_KRB5 1" >>confdefs.h else as_fn_error $? "libgssapi_krb5 is needed for GSSAPI security" "$LINENO" 5 fi else gssapi_krb5_CFLAGS=$pkg_cv_gssapi_krb5_CFLAGS gssapi_krb5_LIBS=$pkg_cv_gssapi_krb5_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$require_libgssapi_krb5_ext" != "xno"; then BUILD_GSSAPI_TRUE= BUILD_GSSAPI_FALSE='#' else BUILD_GSSAPI_TRUE='#' BUILD_GSSAPI_FALSE= fi # Select curve encryption library, defaults to tweetnacl # To use libsodium instead, use --with-libsodium (must be installed) # To disable curve, use --disable-curve # Check whether --with-libsodium was given. if test "${with_libsodium+set}" = set; then : withval=$with_libsodium; fi if test "x$with_libsodium" = "xyes"; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sodium" >&5 $as_echo_n "checking for sodium... " >&6; } if test -n "$sodium_CFLAGS"; then pkg_cv_sodium_CFLAGS="$sodium_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsodium") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_sodium_CFLAGS=`$PKG_CONFIG --cflags "libsodium" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$sodium_LIBS"; then pkg_cv_sodium_LIBS="$sodium_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium\""; } >&5 ($PKG_CONFIG --exists --print-errors "libsodium") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_sodium_LIBS=`$PKG_CONFIG --libs "libsodium" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then sodium_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsodium" 2>&1` else sodium_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsodium" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$sodium_PKG_ERRORS" >&5 as_fn_error then run configure again "libsodium is not installed. Install it" "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error then run configure again "libsodium is not installed. Install it" "$LINENO" 5 else sodium_CFLAGS=$pkg_cv_sodium_CFLAGS sodium_LIBS=$pkg_cv_sodium_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } libsodium_found=yes fi fi # Check whether --enable-curve was given. if test "${enable_curve+set}" = set; then : enableval=$enable_curve; fi if test "x$enable_curve" = "xno"; then curve_library="" { $as_echo "$as_me:${as_lineno-$LINENO}: CURVE security is disabled" >&5 $as_echo "$as_me: CURVE security is disabled" >&6;} elif test "x$with_libsodium" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Using libsodium for CURVE security" >&5 $as_echo "$as_me: Using libsodium for CURVE security" >&6;} $as_echo "#define ZMQ_HAVE_CURVE 1" >>confdefs.h $as_echo "#define ZMQ_USE_LIBSODIUM 1" >>confdefs.h curve_library="libsodium" enable_curve="yes" # On Solaris, libsodium depends on libssp case "${host_os}" in *solaris*) LDFLAGS="-lssp $LDFLAGS" libzmq_pedantic="no" libzmq_werror="no" ;; esac PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $sodium_LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Using tweetnacl for CURVE security" >&5 $as_echo "$as_me: Using tweetnacl for CURVE security" >&6;} $as_echo "#define ZMQ_HAVE_CURVE 1" >>confdefs.h $as_echo "#define ZMQ_USE_TWEETNACL 1" >>confdefs.h curve_library="tweetnacl" enable_curve="yes" fi if test "x$enable_curve" = "xyes" -a "x$zmq_enable_curve_keygen" = "xyes"; then ENABLE_CURVE_KEYGEN_TRUE= ENABLE_CURVE_KEYGEN_FALSE='#' else ENABLE_CURVE_KEYGEN_TRUE='#' ENABLE_CURVE_KEYGEN_FALSE= fi if test "$curve_library" = "libsodium"; then USE_LIBSODIUM_TRUE= USE_LIBSODIUM_FALSE='#' else USE_LIBSODIUM_TRUE='#' USE_LIBSODIUM_FALSE= fi if test "$curve_library" = "tweetnacl"; then USE_TWEETNACL_TRUE= USE_TWEETNACL_FALSE='#' else USE_TWEETNACL_TRUE='#' USE_TWEETNACL_FALSE= fi if test "x$curve_library" != "x"; then HAVE_CURVE_TRUE= HAVE_CURVE_FALSE='#' else HAVE_CURVE_TRUE='#' HAVE_CURVE_FALSE= fi # build using pgm have_pgm_library="no" # Check whether --with-pgm was given. if test "${with_pgm+set}" = set; then : withval=$with_pgm; with_pgm_ext=$withval else with_pgm_ext=no fi # conditionally require pgm package if test "x$with_pgm_ext" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pgm" >&5 $as_echo_n "checking for pgm... " >&6; } if test -n "$pgm_CFLAGS"; then pkg_cv_pgm_CFLAGS="$pgm_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.2 >= 5.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.2 >= 5.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_CFLAGS=`$PKG_CONFIG --cflags "openpgm-5.2 >= 5.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$pgm_LIBS"; then pkg_cv_pgm_LIBS="$pgm_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.2 >= 5.2\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.2 >= 5.2") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_LIBS=`$PKG_CONFIG --libs "openpgm-5.2 >= 5.2" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then pgm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openpgm-5.2 >= 5.2" 2>&1` else pgm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openpgm-5.2 >= 5.2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$pgm_PKG_ERRORS" >&5 pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pgm" >&5 $as_echo_n "checking for pgm... " >&6; } if test -n "$pgm_CFLAGS"; then pkg_cv_pgm_CFLAGS="$pgm_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_CFLAGS=`$PKG_CONFIG --cflags "openpgm-5.1 >= 5.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$pgm_LIBS"; then pkg_cv_pgm_LIBS="$pgm_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_LIBS=`$PKG_CONFIG --libs "openpgm-5.1 >= 5.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then pgm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1` else pgm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$pgm_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (openpgm-5.1 >= 5.1) were not met: $pgm_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables pgm_CFLAGS and pgm_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables pgm_CFLAGS and pgm_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else pgm_CFLAGS=$pkg_cv_pgm_CFLAGS pgm_LIBS=$pkg_cv_pgm_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_pgm_library="yes" fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pgm" >&5 $as_echo_n "checking for pgm... " >&6; } if test -n "$pgm_CFLAGS"; then pkg_cv_pgm_CFLAGS="$pgm_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_CFLAGS=`$PKG_CONFIG --cflags "openpgm-5.1 >= 5.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$pgm_LIBS"; then pkg_cv_pgm_LIBS="$pgm_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"openpgm-5.1 >= 5.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "openpgm-5.1 >= 5.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_pgm_LIBS=`$PKG_CONFIG --libs "openpgm-5.1 >= 5.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then pgm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1` else pgm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "openpgm-5.1 >= 5.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$pgm_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (openpgm-5.1 >= 5.1) were not met: $pgm_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables pgm_CFLAGS and pgm_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables pgm_CFLAGS and pgm_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else pgm_CFLAGS=$pkg_cv_pgm_CFLAGS pgm_LIBS=$pkg_cv_pgm_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_pgm_library="yes" fi else pgm_CFLAGS=$pkg_cv_pgm_CFLAGS pgm_LIBS=$pkg_cv_pgm_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_pgm_library="yes" fi fi if test "x$have_pgm_library" = "xyes"; then $as_echo "#define ZMQ_HAVE_OPENPGM 1" >>confdefs.h PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $pgm_LIBS" fi if test "x$have_pgm_library" = "xyes"; then HAVE_PGM_TRUE= HAVE_PGM_FALSE='#' else HAVE_PGM_TRUE='#' HAVE_PGM_FALSE= fi # This uses "--with-norm" to point to the "norm" directory # for "norm/include" and "norm/lib" #(if "--with-norm=yes" is given, then assume installed on system) # Check whether --with-norm was given. if test "${with_norm+set}" = set; then : withval=$with_norm; with_norm_ext=$withval else with_norm_ext=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"with_norm_ext = ${with_norm_ext}\"" >&5 $as_echo_n "checking \"with_norm_ext = ${with_norm_ext}\"... " >&6; } if test "x$with_norm_ext" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for norm" >&5 $as_echo_n "checking for norm... " >&6; } if test -n "$norm_CFLAGS"; then pkg_cv_norm_CFLAGS="$norm_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"norm\""; } >&5 ($PKG_CONFIG --exists --print-errors "norm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_norm_CFLAGS=`$PKG_CONFIG --cflags "norm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$norm_LIBS"; then pkg_cv_norm_LIBS="$norm_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"norm\""; } >&5 ($PKG_CONFIG --exists --print-errors "norm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_norm_LIBS=`$PKG_CONFIG --libs "norm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then norm_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "norm" 2>&1` else norm_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "norm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$norm_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } norm_LIBS="" norm_CFLAGS="" if test "x$with_norm_ext" != "xyes"; then norm_path="${with_norm_ext}" norm_CFLAGS="${norm_CFLAGS} -I${norm_path}/include" norm_LIBS="${norm_LIBS} -L${norm_path}/lib" fi norm_LIBS="${norm_LIBS} -lnorm" have_norm_library="yes" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } norm_LIBS="" norm_CFLAGS="" if test "x$with_norm_ext" != "xyes"; then norm_path="${with_norm_ext}" norm_CFLAGS="${norm_CFLAGS} -I${norm_path}/include" norm_LIBS="${norm_LIBS} -L${norm_path}/lib" fi norm_LIBS="${norm_LIBS} -lnorm" have_norm_library="yes" else norm_CFLAGS=$pkg_cv_norm_CFLAGS norm_LIBS=$pkg_cv_norm_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_norm_library="yes" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$have_norm_library" = "xyes"; then $as_echo "#define ZMQ_HAVE_NORM 1" >>confdefs.h PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $norm_LIBS" fi if test "x$have_norm_library" = "xyes"; then HAVE_NORM_TRUE= HAVE_NORM_FALSE='#' else HAVE_NORM_TRUE='#' HAVE_NORM_FALSE= fi # build using vmci have_vmci_library="no" # Check whether --with-vmci was given. if test "${with_vmci+set}" = set; then : withval=$with_vmci; have_vmci_ext=$withval else have_vmci_ext=no fi if test "x$have_vmci_ext" != "xno"; then $as_echo "#define ZMQ_HAVE_VMCI 1" >>confdefs.h if test "x$have_vmci_ext" != "xyes"; then vmci_path="${have_vmci_ext}" LIBZMQ_VMCI_CXXFLAGS="-I${vmci_path}" LIBZMQ_VMCI_LDFLAGS="-I${vmci_path}" LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_VMCI_CXXFLAGS} ${LIBZMQ_EXTRA_CXXFLAGS}" LIBZMQ_EXTRA_LDFLAGS="${LIBZMQ_VMCI_LDFLAGS} ${LIBZMQ_EXTRA_LDFLAGS}" fi fi if test "x$have_vmci_ext" != "xno"; then HAVE_VMCI_TRUE= HAVE_VMCI_FALSE='#' else HAVE_VMCI_TRUE='#' HAVE_VMCI_FALSE= fi # Set -Wall, -Werror and -pedantic ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Check how to enable -Wall { { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to enable additional warnings for C++ compiler" >&5 $as_echo_n "checking how to enable additional warnings for C++ compiler... " >&6; } libzmq_cv_cxx_wall_flag="" # C compilers case "xcxx" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o \ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then libzmq_cv_cxx_wall_flag="-Wall" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_wall_flag="-v" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o \ "x$libzmq_cv_cxx_intel_compiler" = "xyes" -o \ "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then libzmq_cv_cxx_wall_flag="-Wall" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_wall_flag="+w" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_cxx_wall_flag" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_wall_flag" >&5 $as_echo "$libzmq_cv_cxx_wall_flag" >&6; } CPPFLAGS="$libzmq_cv_cxx_wall_flag $CPPFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi } if test "x$libzmq_werror" = "xyes" -a "x$libzmq_cv_cxx_sun_studio_compiler" != "xyes"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to turn warnings to errors in C++ compiler" >&5 $as_echo_n "checking how to turn warnings to errors in C++ compiler... " >&6; } libzmq_cv_cxx_werror_flag="" # C compilers case "xcxx" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o "x$libzmq_cv_cxx_intel_compiler" = "xyes"; then libzmq_cv_cxx_werror_flag="-Werror" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_werror_flag="-errwarn=%all" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o "x$libzmq_cv_cxx_intel_compiler" = "xyes"; then libzmq_cv_cxx_werror_flag="-Werror" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_werror_flag="-errwarn=%all" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_cxx_werror_flag" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_werror_flag" >&5 $as_echo "$libzmq_cv_cxx_werror_flag" >&6; } CPPFLAGS="$libzmq_cv_cxx_werror_flag $CPPFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi } fi if test "x$libzmq_pedantic" = "xyes"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to enable strict standards compliance in C++ compiler" >&5 $as_echo_n "checking how to enable strict standards compliance in C++ compiler... " >&6; } libzmq_cv_cxx_strict_flag="" # C compilers case "xcxx" in xc) # GCC, clang and ICC if test "x$GCC" = "xyes" -o "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-pedantic" elif test "x$libzmq_cv_cxx_intel_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-strict-ansi" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-Xc" fi ;; xcxx) # GCC, clang and ICC if test "x$GXX" = "xyes" -o "x$libzmq_cv_cxx_clang_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-pedantic" elif test "x$libzmq_cv_cxx_intel_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-strict-ansi" # Sun studio elif test "x$libzmq_cv_cxx_sun_studio_compiler" = "xyes"; then libzmq_cv_cxx_strict_flag="-compat=5" fi ;; *) ;; esac # Call the action if test "x$libzmq_cv_cxx_strict_flag" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_cxx_strict_flag" >&5 $as_echo "$libzmq_cv_cxx_strict_flag" >&6; } CPPFLAGS="$libzmq_cv_cxx_strict_flag $CPPFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } fi } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$libzmq_tipc_support" = "xyes"; then BUILD_TIPC_TRUE= BUILD_TIPC_FALSE='#' else BUILD_TIPC_TRUE='#' BUILD_TIPC_FALSE= fi if test "x$libzmq_on_mingw" = "xyes"; then ON_MINGW_TRUE= ON_MINGW_FALSE='#' else ON_MINGW_TRUE='#' ON_MINGW_FALSE= fi if test "x$libzmq_on_cygwin" = "xyes"; then ON_CYGWIN_TRUE= ON_CYGWIN_FALSE='#' else ON_CYGWIN_TRUE='#' ON_CYGWIN_FALSE= fi if test "x$libzmq_on_android" = "xyes"; then ON_ANDROID_TRUE= ON_ANDROID_FALSE='#' else ON_ANDROID_TRUE='#' ON_ANDROID_FALSE= fi if test "x$libzmq_on_linux" = "xyes"; then ON_LINUX_TRUE= ON_LINUX_FALSE='#' else ON_LINUX_TRUE='#' ON_LINUX_FALSE= fi if test "x$libzmq_on_gnu" = "xyes"; then ON_GNU_TRUE= ON_GNU_FALSE='#' else ON_GNU_TRUE='#' ON_GNU_FALSE= fi # Check for __atomic_Xxx compiler intrinsics ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports __atomic_Xxx intrinsics" >&5 $as_echo_n "checking whether compiler supports __atomic_Xxx intrinsics... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* atomic intrinsics test */ int v = 0; int main (int, char **) { int t = __atomic_add_fetch (&v, 1, __ATOMIC_ACQ_REL); return t; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ; libzmq_cv_has_atomic_instrisics="yes" ; $as_echo "#define ZMQ_HAVE_ATOMIC_INTRINSICS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ; libzmq_cv_has_atomic_instrisics="no" ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext } ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF for ac_func in perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork posix_memalign mkdtemp accept4 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in alloca.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" if test "x$ac_cv_header_alloca_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi done # pthread_setname is non-posix, and there are at least 4 different implementations { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signature of pthread_setname_np() has 1 argument" >&5 $as_echo_n "checking whether signature of pthread_setname_np() has 1 argument... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_setname_np ("foo"); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ZMQ_HAVE_PTHREAD_SETNAME_1 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signature of pthread_setname_np() has 2 arguments" >&5 $as_echo_n "checking whether signature of pthread_setname_np() has 2 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_setname_np (pthread_self (), "foo"); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ZMQ_HAVE_PTHREAD_SETNAME_2 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether signature of pthread_setname_np() has 3 arguments" >&5 $as_echo_n "checking whether signature of pthread_setname_np() has 3 arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_setname_np (pthread_self(), "foo", (void *)0); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ZMQ_HAVE_PTHREAD_SETNAME_3 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_set_name_np() exists" >&5 $as_echo_n "checking whether pthread_set_name_np() exists... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_set_name_np (pthread_self(), "foo"); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ZMQ_HAVE_PTHREAD_SET_NAME 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # pthread_setaffinity_np is non-posix: { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_setaffinity_np() exists" >&5 $as_echo_n "checking whether pthread_setaffinity_np() exists... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { cpu_set_t test; pthread_setaffinity_np (pthread_self(), sizeof(cpu_set_t), &test); return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define ZMQ_HAVE_PTHREAD_SET_AFFINITY 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SOCK_CLOEXEC is supported" >&5 $as_echo_n "checking whether SOCK_CLOEXEC is supported... " >&6; } if ${libzmq_cv_sock_cloexec+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_sock_cloexec="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* SOCK_CLOEXEC test */ #include #include int main (int argc, char *argv []) { int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0); return (s == -1); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_sock_cloexec="yes" else libzmq_cv_sock_cloexec="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_sock_cloexec" >&5 $as_echo "$libzmq_cv_sock_cloexec" >&6; } if test "x$libzmq_cv_sock_cloexec" = "xyes"; then : $as_echo "#define ZMQ_HAVE_SOCK_CLOEXEC 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether O_CLOEXEC is supported" >&5 $as_echo_n "checking whether O_CLOEXEC is supported... " >&6; } if ${libzmq_cv_o_cloexec+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_o_cloexec="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* O_CLOEXEC test */ #include #include #include int main (int argc, char *argv []) { int s = open ("/dev/null", O_CLOEXEC | O_RDONLY); return (s == -1); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_o_cloexec="yes" else libzmq_cv_o_cloexec="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_o_cloexec" >&5 $as_echo "$libzmq_cv_o_cloexec" >&6; } if test "x$libzmq_cv_o_cloexec" = "xyes"; then : $as_echo "#define ZMQ_HAVE_O_CLOEXEC 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SO_BINDTODEVICE is supported" >&5 $as_echo_n "checking whether SO_BINDTODEVICE is supported... " >&6; } if ${libzmq_cv_so_bindtodevice+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_so_bindtodevice="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* SO_BINDTODEVICE test */ #include int main (int argc, char *argv []) { /* Actually making the setsockopt() call requires CAP_NET_RAW */ #ifndef SO_BINDTODEVICE return 1; #else return 0; #endif } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_so_bindtodevice="yes" else libzmq_cv_so_bindtodevice="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_so_bindtodevice" >&5 $as_echo "$libzmq_cv_so_bindtodevice" >&6; } if test "x$libzmq_cv_so_bindtodevice" = "xyes"; then : $as_echo "#define ZMQ_HAVE_SO_BINDTODEVICE 1" >>confdefs.h fi } # TCP keep-alives Checks. { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SO_KEEPALIVE is supported" >&5 $as_echo_n "checking whether SO_KEEPALIVE is supported... " >&6; } if ${libzmq_cv_so_keepalive+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_so_keepalive="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* SO_KEEPALIVE test */ #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_so_keepalive="yes" else libzmq_cv_so_keepalive="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_so_keepalive" >&5 $as_echo "$libzmq_cv_so_keepalive" >&6; } if test "x$libzmq_cv_so_keepalive" = "xyes"; then : $as_echo "#define ZMQ_HAVE_SO_KEEPALIVE 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCP_KEEPCNT is supported" >&5 $as_echo_n "checking whether TCP_KEEPCNT is supported... " >&6; } if ${libzmq_cv_tcp_keepcnt+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_tcp_keepcnt="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* TCP_KEEPCNT test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1) ); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_tcp_keepcnt="yes" else libzmq_cv_tcp_keepcnt="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_tcp_keepcnt" >&5 $as_echo "$libzmq_cv_tcp_keepcnt" >&6; } if test "x$libzmq_cv_tcp_keepcnt" = "xyes"; then : $as_echo "#define ZMQ_HAVE_TCP_KEEPCNT 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCP_KEEPIDLE is supported" >&5 $as_echo_n "checking whether TCP_KEEPIDLE is supported... " >&6; } if ${libzmq_cv_tcp_keepidle+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_tcp_keepidle="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* TCP_KEEPIDLE test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1) ); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_tcp_keepidle="yes" else libzmq_cv_tcp_keepidle="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_tcp_keepidle" >&5 $as_echo "$libzmq_cv_tcp_keepidle" >&6; } if test "x$libzmq_cv_tcp_keepidle" = "xyes"; then : $as_echo "#define ZMQ_HAVE_TCP_KEEPIDLE 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCP_KEEPINTVL is supported" >&5 $as_echo_n "checking whether TCP_KEEPINTVL is supported... " >&6; } if ${libzmq_cv_tcp_keepintvl+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_tcp_keepintvl="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* TCP_KEEPINTVL test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1) ); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_tcp_keepintvl="yes" else libzmq_cv_tcp_keepintvl="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_tcp_keepintvl" >&5 $as_echo "$libzmq_cv_tcp_keepintvl" >&6; } if test "x$libzmq_cv_tcp_keepintvl" = "xyes"; then : $as_echo "#define ZMQ_HAVE_TCP_KEEPINTVL 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether TCP_KEEPALIVE is supported" >&5 $as_echo_n "checking whether TCP_KEEPALIVE is supported... " >&6; } if ${libzmq_cv_tcp_keepalive+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_tcp_keepalive="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* TCP_KEEPALIVE test */ #include #include #include #include int main (int argc, char *argv []) { int s, rc, opt = 1; return ( ((s = socket (PF_INET, SOCK_STREAM, 0)) == -1) || ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) || ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1) ); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_tcp_keepalive="yes" else libzmq_cv_tcp_keepalive="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_tcp_keepalive" >&5 $as_echo "$libzmq_cv_tcp_keepalive" >&6; } if test "x$libzmq_cv_tcp_keepalive" = "xyes"; then : $as_echo "#define ZMQ_HAVE_TCP_KEEPALIVE 1" >>confdefs.h fi } { { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getrandom is supported" >&5 $as_echo_n "checking whether getrandom is supported... " >&6; } if ${libzmq_cv_getrandom+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : libzmq_cv_getrandom="not during cross-compile" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* thread-local storage test */ #include int main (int argc, char *argv []) { char buf[4]; getrandom(buf, 4, 0); } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : libzmq_cv_getrandom="yes" else libzmq_cv_getrandom="no" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libzmq_cv_getrandom" >&5 $as_echo "$libzmq_cv_getrandom" >&6; } if test "x$libzmq_cv_getrandom" = "xyes"; then : $as_echo "#define ZMQ_HAVE_GETRANDOM 1" >>confdefs.h fi } if test "x$ac_cv_func_fork" = "xyes"; then HAVE_FORK_TRUE= HAVE_FORK_FALSE='#' else HAVE_FORK_TRUE='#' HAVE_FORK_FALSE= fi if test "x$cross_compiling" = "xyes"; then # Enable draft by default when cross-compiling defaultval=yes else # enable draft API by default if we're in a git repository # else disable it by default; then allow --enable-drafts=yes/no override as_ac_File=`$as_echo "ac_cv_file_$srcdir/.git" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $srcdir/.git" >&5 $as_echo_n "checking for $srcdir/.git... " >&6; } if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$srcdir/.git"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi eval ac_res=\$$as_ac_File { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_File"\" = x"yes"; then : defaultval=yes else defaultval=no fi fi # Check whether --enable-drafts was given. if test "${enable_drafts+set}" = set; then : enableval=$enable_drafts; enable_drafts=$enableval else enable_drafts=$defaultval fi if test x$enable_drafts != xno; then ENABLE_DRAFTS_TRUE= ENABLE_DRAFTS_FALSE='#' else ENABLE_DRAFTS_TRUE='#' ENABLE_DRAFTS_FALSE= fi if test "x$enable_drafts" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: Building stable and legacy API + draft API" >&5 $as_echo "$as_me: Building stable and legacy API + draft API" >&6;} $as_echo "#define ZMQ_BUILD_DRAFT_API 1" >>confdefs.h pkg_config_defines="-DZMQ_BUILD_DRAFT_API=1" else { $as_echo "$as_me:${as_lineno-$LINENO}: Building stable and legacy API (no draft API)" >&5 $as_echo "$as_me: Building stable and legacy API (no draft API)" >&6;} pkg_config_defines="" fi # Check whether --enable-libunwind was given. if test "${enable_libunwind+set}" = set; then : enableval=$enable_libunwind; enable_libunwind=$enableval else enable_libunwind="auto" fi if test "x$enable_libunwind" != "xno"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUNWIND" >&5 $as_echo_n "checking for LIBUNWIND... " >&6; } if test -n "$LIBUNWIND_CFLAGS"; then pkg_cv_LIBUNWIND_CFLAGS="$LIBUNWIND_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_CFLAGS=`$PKG_CONFIG --cflags "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LIBUNWIND_LIBS"; then pkg_cv_LIBUNWIND_LIBS="$LIBUNWIND_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libunwind\""; } >&5 ($PKG_CONFIG --exists --print-errors "libunwind") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LIBUNWIND_LIBS=`$PKG_CONFIG --libs "libunwind" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libunwind" 2>&1` else LIBUNWIND_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libunwind" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBUNWIND_PKG_ERRORS" >&5 if test "x$enable_libunwind" = "xyes"; then as_fn_error $? "Cannot find libunwind" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libunwind" >&5 $as_echo "$as_me: WARNING: Cannot find libunwind" >&2;} fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "x$enable_libunwind" = "xyes"; then as_fn_error $? "Cannot find libunwind" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find libunwind" >&5 $as_echo "$as_me: WARNING: Cannot find libunwind" >&2;} fi else LIBUNWIND_CFLAGS=$pkg_cv_LIBUNWIND_CFLAGS LIBUNWIND_LIBS=$pkg_cv_LIBUNWIND_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_LIBUNWIND 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5 $as_echo_n "checking for dladdr in -ldl... " >&6; } if ${ac_cv_lib_dl_dladdr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dladdr (); int main () { return dladdr (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dladdr=yes else ac_cv_lib_dl_dladdr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5 $as_echo "$ac_cv_lib_dl_dladdr" >&6; } if test "x$ac_cv_lib_dl_dladdr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi fi fi # See if clang-format is in PATH; the result unblocks the relevant recipes WITH_CLANG_FORMAT="" if test x"$CLANG_FORMAT" = x; then : # Extract the first word of "clang-format", so it can be a program name with args. set dummy clang-format; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_CLANG_FORMAT+:} false; then : $as_echo_n "(cached) " >&6 else case $CLANG_FORMAT in [\\/]* | ?:[\\/]*) ac_cv_path_CLANG_FORMAT="$CLANG_FORMAT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CLANG_FORMAT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CLANG_FORMAT=$ac_cv_path_CLANG_FORMAT if test -n "$CLANG_FORMAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLANG_FORMAT" >&5 $as_echo "$CLANG_FORMAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else # Extract the first word of "$CLANG_FORMAT", so it can be a program name with args. set dummy $CLANG_FORMAT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_WITH_CLANG_FORMAT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WITH_CLANG_FORMAT"; then ac_cv_prog_WITH_CLANG_FORMAT="$WITH_CLANG_FORMAT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_WITH_CLANG_FORMAT="true" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_WITH_CLANG_FORMAT" && ac_cv_prog_WITH_CLANG_FORMAT="fail" fi fi WITH_CLANG_FORMAT=$ac_cv_prog_WITH_CLANG_FORMAT if test -n "$WITH_CLANG_FORMAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_CLANG_FORMAT" >&5 $as_echo "$WITH_CLANG_FORMAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test x"$CLANG_FORMAT" != x && test x"$WITH_CLANG_FORMAT" = x; then : if test -x "$CLANG_FORMAT"; then : WITH_CLANG_FORMAT=true else # Extract the first word of "$CLANG_FORMAT", so it can be a program name with args. set dummy $CLANG_FORMAT; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_WITH_CLANG_FORMAT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$WITH_CLANG_FORMAT"; then ac_cv_prog_WITH_CLANG_FORMAT="$WITH_CLANG_FORMAT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_WITH_CLANG_FORMAT="true" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_WITH_CLANG_FORMAT" && ac_cv_prog_WITH_CLANG_FORMAT="false" fi fi WITH_CLANG_FORMAT=$ac_cv_prog_WITH_CLANG_FORMAT if test -n "$WITH_CLANG_FORMAT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_CLANG_FORMAT" >&5 $as_echo "$WITH_CLANG_FORMAT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test "$WITH_CLANG_FORMAT" = fail; then : as_fn_error $? "Caller explicitly referenced CLANG_FORMAT=$CLANG_FORMAT which was not found" "$LINENO" 5 fi if $WITH_CLANG_FORMAT; then WITH_CLANG_FORMAT_TRUE= WITH_CLANG_FORMAT_FALSE='#' else WITH_CLANG_FORMAT_TRUE='#' WITH_CLANG_FORMAT_FALSE= fi # unittests will not build without the static libzmq.a if test "x$enable_static" = "xyes"; then ENABLE_STATIC_TRUE= ENABLE_STATIC_FALSE='#' else ENABLE_STATIC_TRUE='#' ENABLE_STATIC_FALSE= fi # Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS pkg_config_libs_private=$PKGCFG_LIBS_PRIVATE # set pkgconfigdir, allow override # Check whether --with-pkgconfigdir was given. if test "${with_pkgconfigdir+set}" = set; then : withval=$with_pkgconfigdir; pkgconfigdir="$withval" else pkgconfigdir='${libdir}/pkgconfig' fi ac_config_files="$ac_config_files Makefile src/libzmq.pc doc/Makefile builds/Makefile builds/msvc/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_FALSE}"; then as_fn_error $? "conditional \"CODE_COVERAGE_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${VALGRIND_ENABLED_TRUE}" && test -z "${VALGRIND_ENABLED_FALSE}"; then as_fn_error $? "conditional \"VALGRIND_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ASAN_TRUE}" && test -z "${ENABLE_ASAN_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ASAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_ASAN_TRUE}" && test -z "${ENABLE_ASAN_FALSE}"; then as_fn_error $? "conditional \"ENABLE_ASAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_MAN_TRUE}" && test -z "${INSTALL_MAN_FALSE}"; then as_fn_error $? "conditional \"INSTALL_MAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_PERF_TRUE}" && test -z "${ENABLE_PERF_FALSE}"; then as_fn_error $? "conditional \"ENABLE_PERF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_IPC_PEERCRED_TRUE}" && test -z "${HAVE_IPC_PEERCRED_FALSE}"; then as_fn_error $? "conditional \"HAVE_IPC_PEERCRED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_GSSAPI_TRUE}" && test -z "${BUILD_GSSAPI_FALSE}"; then as_fn_error $? "conditional \"BUILD_GSSAPI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_CURVE_KEYGEN_TRUE}" && test -z "${ENABLE_CURVE_KEYGEN_FALSE}"; then as_fn_error $? "conditional \"ENABLE_CURVE_KEYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_LIBSODIUM_TRUE}" && test -z "${USE_LIBSODIUM_FALSE}"; then as_fn_error $? "conditional \"USE_LIBSODIUM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_TWEETNACL_TRUE}" && test -z "${USE_TWEETNACL_FALSE}"; then as_fn_error $? "conditional \"USE_TWEETNACL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CURVE_TRUE}" && test -z "${HAVE_CURVE_FALSE}"; then as_fn_error $? "conditional \"HAVE_CURVE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PGM_TRUE}" && test -z "${HAVE_PGM_FALSE}"; then as_fn_error $? "conditional \"HAVE_PGM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_NORM_TRUE}" && test -z "${HAVE_NORM_FALSE}"; then as_fn_error $? "conditional \"HAVE_NORM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_VMCI_TRUE}" && test -z "${HAVE_VMCI_FALSE}"; then as_fn_error $? "conditional \"HAVE_VMCI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_TIPC_TRUE}" && test -z "${BUILD_TIPC_FALSE}"; then as_fn_error $? "conditional \"BUILD_TIPC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ON_MINGW_TRUE}" && test -z "${ON_MINGW_FALSE}"; then as_fn_error $? "conditional \"ON_MINGW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ON_CYGWIN_TRUE}" && test -z "${ON_CYGWIN_FALSE}"; then as_fn_error $? "conditional \"ON_CYGWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ON_ANDROID_TRUE}" && test -z "${ON_ANDROID_FALSE}"; then as_fn_error $? "conditional \"ON_ANDROID\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ON_LINUX_TRUE}" && test -z "${ON_LINUX_FALSE}"; then as_fn_error $? "conditional \"ON_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ON_GNU_TRUE}" && test -z "${ON_GNU_FALSE}"; then as_fn_error $? "conditional \"ON_GNU\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_FORK_TRUE}" && test -z "${HAVE_FORK_FALSE}"; then as_fn_error $? "conditional \"HAVE_FORK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_DRAFTS_TRUE}" && test -z "${ENABLE_DRAFTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DRAFTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CLANG_FORMAT_TRUE}" && test -z "${WITH_CLANG_FORMAT_FALSE}"; then as_fn_error $? "conditional \"WITH_CLANG_FORMAT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_STATIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by zeromq $as_me 4.2.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ zeromq config.status 4.2.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/platform.hpp") CONFIG_HEADERS="$CONFIG_HEADERS src/platform.hpp" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/libzmq.pc") CONFIG_FILES="$CONFIG_FILES src/libzmq.pc" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "builds/Makefile") CONFIG_FILES="$CONFIG_FILES builds/Makefile" ;; "builds/msvc/Makefile") CONFIG_FILES="$CONFIG_FILES builds/msvc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi zeromq-4.2.5/configure.ac0000664000372000037200000006523513255253220016241 0ustar00travistravis00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) # # The 0MQ version number is extracted from include/zmq.h using # the version.sh script. Hence, it should be updated there. # The version in git should reflect the *next* version planned. # AC_INIT([zeromq],[m4_esyscmd([./version.sh])],[zeromq-dev@lists.zeromq.org]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) AC_CONFIG_HEADERS([src/platform.hpp]) AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip) m4_pattern_allow([AC_PROG_CC_C99]) m4_include([m4/ax_check_compile_flag.m4]) m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) m4_include([m4/ax_code_coverage.m4]) m4_include([m4/ax_valgrind_check.m4]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # This lets us use PACKAGE_VERSION in Makefiles AC_SUBST(PACKAGE_VERSION) # Libtool -version-info (ABI version) # # Don't change this unless you know exactly what you're doing and have read and # understand: # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html # # Changes: # # ZeroMQ versions prior to 2.1.0 use 0:0:0 (undefined) # ZeroMQ versions 2.1.x: 1:0:0 (ABI version 1) # ZeroMQ version 3.0: 2:0:0 (ABI version 2) # ZeroMQ version 3.1: 3:0:0 (ABI version 3) # ZeroMQ version 4.0: 4:0:0 (ABI version 4) # ZeroMQ version 4.1: 5:0:0 (ABI version 5) # ZeroMQ version 4.2.0: 6:0:1 (ABI version 5) # ZeroMQ version 4.2.1: 6:1:1 (ABI version 5) # ZeroMQ version 4.2.2: 6:2:1 (ABI version 5) # ZeroMQ version 4.2.3: 6:3:1 (ABI version 5) # ZeroMQ version 4.2.4: 6:4:1 (ABI version 5) # ZeroMQ version 4.2.5: 6:5:1 (ABI version 5) # # libzmq -version-info current:revision:age LTVER="6:5:1" AC_SUBST(LTVER) # Take a copy of original flags ZMQ_ORIG_CFLAGS="${CFLAGS:-none}" ZMQ_ORIG_CPPFLAGS="${CPPFLAGS:-none}" ZMQ_ORIG_CXXFLAGS="${CXXFLAGS:-none}" # Checks for programs. AC_PROG_CC AX_CHECK_COMPILE_FLAG([-std=gnu11], [CFLAGS+=" -std=gnu11"], [AC_PROG_CC_C99]) AC_PROG_CXX AX_CXX_COMPILE_STDCXX_11([ext], [optional]) AX_CODE_COVERAGE AM_PROG_CC_C_O AC_PROG_SED AC_PROG_AWK PKG_PROG_PKG_CONFIG m4_pattern_forbid([^PKG_[A-Z_]+$], [missing some pkg-config macros (pkg-config package)]) # Libtool configuration for different targets. See acinclude.m4 AC_ARG_VAR([XMLTO], [path to xmlto command]) AC_PATH_PROG([XMLTO], [xmlto]) AC_ARG_VAR([ASCIIDOC], [path to asciidoc command]) AC_PATH_PROG([ASCIIDOC], [asciidoc]) LIBZMQ_CONFIG_LIBTOOL AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AX_VALGRIND_CHECK # Check whether to build a with debug symbols LIBZMQ_CHECK_ENABLE_DEBUG # Check whether to enable code coverage LIBZMQ_WITH_GCOV AC_MSG_CHECKING([if TIPC is available and supports nonblocking connect]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include #include #include #include #include ]],[[ struct sockaddr_tipc topsrv; int sd = socket(AF_TIPC, SOCK_SEQPACKET, 0); memset(&topsrv, 0, sizeof(topsrv)); topsrv.family = AF_TIPC; topsrv.addrtype = TIPC_ADDR_NAME; topsrv.addr.name.name.type = TIPC_TOP_SRV; topsrv.addr.name.name.instance = TIPC_TOP_SRV; fcntl(sd, F_SETFL, O_NONBLOCK); ]]) ], [libzmq_tipc_support=yes], [libzmq_tipc_support=no], [libzmq_tipc_support=no]) AC_MSG_RESULT([$libzmq_tipc_support]) AC_ARG_ENABLE([pedantic], [AS_HELP_STRING([--disable-pedantic], [disable pedantic compiler checks [default=enabled]])], [libzmq_pedantic=$enableval], [libzmq_pedantic=yes]) AC_ARG_WITH([militant], [AS_HELP_STRING([--with-militant], [enable militant API assertions])], [zmq_militant="yes"], []) if test "x$zmq_militant" = "xyes"; then AC_DEFINE(ZMQ_ACT_MILITANT, 1, [Enable militant API assertions]) fi # Memory mis-use detection AC_MSG_CHECKING([whether to enable ASan]) AC_ARG_ENABLE(address-sanitizer, [AS_HELP_STRING([--enable-address-sanitizer=yes/no], [Build with GCC Address Sanitizer instrumentation])], [ZMQ_ASAN="$enableval"]) if test "x${ZMQ_ASAN}" == "xyes"; then CFLAGS="${CFLAGS} -fsanitize=address" CXXFLAGS="${CXXFLAGS} -fsanitize=address" AM_CONDITIONAL(ENABLE_ASAN, true) AC_MSG_RESULT([yes]) else AM_CONDITIONAL(ENABLE_ASAN, false) AC_MSG_RESULT([no]) fi # By default compiling with -Werror except OSX and on Solaris when building # with libsodium. AC_ARG_ENABLE([Werror], [AS_HELP_STRING([--disable-Werror], [disable Werror compiler flag [default=enabled]])], [libzmq_werror=$enableval], [libzmq_werror=yes]) # By default use DSO visibility libzmq_dso_visibility="yes" # Platform specific checks libzmq_on_mingw="no" libzmq_on_cygwin="no" libzmq_on_android="no" libzmq_on_linux="no" libzmq_on_gnu="no" # Set some default features required by ZeroMQ code CPPFLAGS="-D_REENTRANT -D_THREAD_SAFE -Wno-long-long $CPPFLAGS" # Will be used to add flags to pkg-config useful when apps want to statically link PKGCFG_LIBS_PRIVATE="" # For host type checks AC_CANONICAL_HOST # OS-specific tests case "${host_os}" in *linux*) # Define on Linux to enable all library features. Define if using a gnu compiler if test "x$GXX" = "xyes"; then CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" fi AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS]) libzmq_on_linux="yes" # dladdr/dlopen is in libdl on glibc AC_SEARCH_LIBS([dladdr], [dl dld], [], [ AC_MSG_ERROR([unable to find the dladdr() function]) ]) if test "x$libzmq_tipc_support" = "xyes"; then AC_DEFINE(ZMQ_HAVE_TIPC, 1, [Have TIPC support]) fi case "${host_os}" in *android*) AC_DEFINE(ZMQ_HAVE_ANDROID, 1, [Have Android OS]) libzmq_on_android="yes" ;; esac ;; *solaris*) # Define on Solaris to enable all library features CPPFLAGS="-Wno-sign-compare -D_PTHREADS $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS]) AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname) AC_MSG_CHECKING([whether atomic operations can be used]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[uint32_t value; atomic_cas_32 (&value, 0, 0); return 0;]])], [solaris_has_atomic=yes], [solaris_has_atomic=no]) AC_MSG_RESULT([$solaris_has_atomic]) # Solaris 8 does not have atomic operations exported to user space. if test "x$solaris_has_atomic" = "xno"; then AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes]) fi ;; *freebsd*) # Define on FreeBSD to enable all library features CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_FREEBSD, 1, [Have FreeBSD OS]) ;; *dragonfly*) CPPFLAGS="-D__BSD_VISIBLE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_DRAGONFLY, 1, [Have DragonFly OS]) ;; *darwin*) # Define on Darwin to enable all library features CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS" libzmq_pedantic="no" libzmq_werror="no" AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) AC_LANG_PUSH([C++]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Wno-uninitialized]) AC_LANG_POP([C++]) ;; *haiku*) AC_DEFINE(ZMQ_HAVE_HAIKU, 1, [Have Haiku OS]) AC_CHECK_LIB(network, socket) ;; *netbsd*) # Define on NetBSD to enable all library features CPPFLAGS="-D_NETBSD_SOURCE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_NETBSD, 1, [Have NetBSD OS]) # NetBSD 5.0 and newer provides atomic operations but we can # only use these on systems where PR #42842 has been fixed so # we must try and link a test program using C++. libzmq_netbsd_has_atomic=no AC_MSG_CHECKING([whether atomic operations can be used]) AC_LANG_PUSH([C++]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[uint32_t value; atomic_cas_32 (&value, 0, 0); return 0;]])], [libzmq_netbsd_has_atomic=yes], [libzmq_netbsd_has_atomic=no]) AC_LANG_POP([C++]) AC_MSG_RESULT([$libzmq_netbsd_has_atomic]) if test "x$libzmq_netbsd_has_atomic" = "xno"; then AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes]) fi ;; *openbsd*|*bitrig*) # Define on OpenBSD to enable all library features CPPFLAGS="-D_BSD_SOURCE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_OPENBSD, 1, [Have OpenBSD OS]) ;; *nto-qnx*) libzmq_pedantic="no" AC_DEFINE(ZMQ_HAVE_QNXNTO, 1, [Have QNX Neutrino OS]) AC_CHECK_LIB(socket, socket) ;; *aix*) AC_DEFINE(ZMQ_HAVE_AIX, 1, [Have AIX OS]) ;; *hpux*) # Define on HP-UX to enable all library features CPPFLAGS="-D_POSIX_C_SOURCE=200112L $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_HPUX, 1, [Have HPUX OS]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-Ae]) AC_CHECK_FUNCS(gethrtime) ;; *mingw*|*msys*) AC_DEFINE(ZMQ_HAVE_WINDOWS, 1, [Have Windows OS]) AC_DEFINE(ZMQ_HAVE_MINGW, 1, [Have MinGW]) AC_CHECK_HEADERS(windows.h) AC_CHECK_LIB(ws2_32, main, , [AC_MSG_ERROR([cannot link with ws2_32.dll.])]) AC_CHECK_LIB(rpcrt4, main, , [AC_MSG_ERROR([cannot link with rpcrt4.dll.])]) AC_CHECK_LIB(iphlpapi, main, , [AC_MSG_ERROR([cannot link with iphlpapi.dll.])]) libzmq_on_mingw="yes" libzmq_dso_visibility="no" if test "x$enable_static" = "xyes"; then CPPFLAGS="-DZMQ_STATIC $CPPFLAGS" PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE -liphlpapi" fi # Set FD_SETSIZE to 16384 CPPFLAGS=" -DFD_SETSIZE=16384 $CPPFLAGS" ;; *cygwin*) # Define on Cygwin to enable all library features CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" AC_DEFINE(ZMQ_HAVE_CYGWIN, 1, [Have Cygwin]) libzmq_on_cygwin="yes" libzmq_dso_visibility="no" if test "x$enable_static" = "xyes"; then AC_MSG_ERROR([Building static libraries is not supported under Cygwin]) fi ;; gnu*) # Define on GNU/Hurd to enable all library features. Define if using a gnu compiler if test "x$GXX" = "xyes"; then CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" fi AC_DEFINE(ZMQ_HAVE_GNU, 1, [Have GNU/Hurd OS]) libzmq_on_gnu="yes" AC_CHECK_LIB(rt, sem_init) ;; *) AC_MSG_ERROR([unsupported system: ${host_os}.]) ;; esac # Checks for libraries AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([rt], [clock_gettime]) # # Check if the compiler supports -fvisibility=hidden flag. MinGW uses __declspec # if test "x$libzmq_dso_visibility" = "xyes"; then AC_LANG_PUSH([C++]) LIBZMQ_CHECK_LANG_VISIBILITY([LIBZMQ_EXTRA_CXXFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_visibility_flag ${LIBZMQ_EXTRA_CXXFLAGS}"]) AC_LANG_POP([C++]) fi # CPU-specific optimizations case "${host_cpu}" in *sparc64*) AC_LANG_PUSH([C++]) LIBZMQ_CHECK_LANG_FLAG_PREPEND([-mcpu=v9]) AC_LANG_POP([C++]) ;; *) ;; esac # Check whether to build docs / install man pages LIBZMQ_CHECK_DOC_BUILD # Check polling system, set appropriate macro in src/platform.hpp LIBZMQ_CHECK_POLLER # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(\ errno.h \ time.h \ unistd.h \ limits.h \ stddef.h \ stdlib.h \ string.h \ arpa/inet.h \ netinet/tcp.h \ netinet/in.h \ sys/socket.h \ sys/time.h) # Check if we have ifaddrs.h header file. AC_CHECK_HEADERS(ifaddrs.h, [AC_DEFINE(ZMQ_HAVE_IFADDRS, 1, [Have ifaddrs.h header.])]) # Check if we have sys/uio.h header file. AC_CHECK_HEADERS(sys/uio.h, [AC_DEFINE(ZMQ_HAVE_UIO, 1, [Have uio.h header.])]) # Force not to use eventfd AC_ARG_ENABLE([eventfd], [AS_HELP_STRING([--disable-eventfd], [disable eventfd [default=enabled]])], [zmq_enable_eventfd=$enableval], [zmq_enable_eventfd=yes]) if test "x$zmq_enable_eventfd" = "xyes"; then # Check if we have eventfd.h header file. AC_CHECK_HEADERS(sys/eventfd.h, [ AC_DEFINE(ZMQ_HAVE_EVENTFD, 1, [Have eventfd extension]) LIBZMQ_CHECK_EVENTFD_CLOEXEC([ AC_DEFINE([ZMQ_HAVE_EVENTFD_CLOEXEC], [1], [Whether EFD_CLOEXEC is defined and functioning.]) ]) ]) fi # Conditionally build performance measurement tools AC_ARG_ENABLE([perf], [AS_HELP_STRING([--disable-perf], [don't build performance measurement tools [default=build]])], [zmq_enable_perf=$enableval], [zmq_enable_perf=yes]) AM_CONDITIONAL(ENABLE_PERF, test "x$zmq_enable_perf" = "xyes") # Conditionally build curve key generation tool AC_ARG_ENABLE([curve-keygen], [AS_HELP_STRING([--disable-curve-keygen], [don't build curve-keygen tool [default=build]])], [zmq_enable_curve_keygen=$enableval], [zmq_enable_curve_keygen=yes]) # Use c++ in subsequent tests AC_LANG_PUSH(C++) AC_CHECK_DECLS([SO_PEERCRED], [AC_DEFINE(ZMQ_HAVE_SO_PEERCRED, 1, [Have SO_PEERCRED socket option])], [], [#include ]) AC_CHECK_DECLS([LOCAL_PEERCRED], [AC_DEFINE(ZMQ_HAVE_LOCAL_PEERCRED, 1, [Have LOCAL_PEERCRED socket option])], [], [#include ]) AM_CONDITIONAL(HAVE_IPC_PEERCRED, test "x$ac_cv_have_decl_SO_PEERCRED" = "xyes" || test "x$ac_cv_have_decl_LOCAL_PEERCRED" = "xyes") AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE # Checks for typedefs, structures, and compiler characteristics. if test "x$libzmq_cv_[]_AC_LANG_ABBREV[]_intel_compiler" = "xyes"; then dnl 279: controlling expression is constant dnl Fixes build with ICC 12.x LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SIZE_T]) LIBZMQ_CHECK_WITH_FLAG([-wd279], [AC_TYPE_SSIZE_T]) else AC_TYPE_SIZE_T AC_TYPE_SSIZE_T fi AC_HEADER_TIME AC_TYPE_UINT32_T AC_C_VOLATILE # build using libgssapi_krb5 AC_ARG_WITH([libgssapi_krb5], [AS_HELP_STRING([--with-libgssapi_krb5], [require libzmq build with libgssapi_krb5 [default=no]])], [require_libgssapi_krb5_ext=$withval], [require_libgssapi_krb5_ext=no]) # conditionally require libgssapi_krb5 if test "x$require_libgssapi_krb5_ext" != "xno"; then PKG_CHECK_MODULES([gssapi_krb5], [krb5-gssapi], [], [ AC_CHECK_HEADERS(gssapi/gssapi_generic.h) AC_SEARCH_LIBS([gss_init_sec_context], [gssapi_krb5 gssapi], AC_DEFINE(HAVE_LIBGSSAPI_KRB5, [1], [Enabled GSSAPI security]), AC_MSG_ERROR(libgssapi_krb5 is needed for GSSAPI security)) ]) fi AM_CONDITIONAL(BUILD_GSSAPI, test "x$require_libgssapi_krb5_ext" != "xno") # Select curve encryption library, defaults to tweetnacl # To use libsodium instead, use --with-libsodium (must be installed) # To disable curve, use --disable-curve AC_ARG_WITH([libsodium], [AS_HELP_STRING([--with-libsodium], [use libsodium instead of built-in tweetnacl [default=no]])]) AS_IF([test "x$with_libsodium" = "xyes"], [ PKG_CHECK_MODULES([sodium], [libsodium], [libsodium_found=yes], [ AC_MSG_ERROR(libsodium is not installed. Install it, then run configure again) ]) ]) AC_ARG_ENABLE([curve], [AS_HELP_STRING([--disable-curve], [disable CURVE security [default=no]])]) if test "x$enable_curve" = "xno"; then curve_library="" AC_MSG_NOTICE([CURVE security is disabled]) elif test "x$with_libsodium" = "xyes"; then AC_MSG_NOTICE([Using libsodium for CURVE security]) AC_DEFINE(ZMQ_HAVE_CURVE, [1], [Using curve encryption]) AC_DEFINE(ZMQ_USE_LIBSODIUM, [1], [Using libsodium for curve encryption]) curve_library="libsodium" enable_curve="yes" # On Solaris, libsodium depends on libssp case "${host_os}" in *solaris*) LDFLAGS="-lssp $LDFLAGS" libzmq_pedantic="no" libzmq_werror="no" ;; esac PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $sodium_LIBS" else AC_MSG_NOTICE([Using tweetnacl for CURVE security]) AC_DEFINE(ZMQ_HAVE_CURVE, [1], [Using curve encryption]) AC_DEFINE(ZMQ_USE_TWEETNACL, [1], [Using tweetnacl for curve encryption]) curve_library="tweetnacl" enable_curve="yes" fi AM_CONDITIONAL(ENABLE_CURVE_KEYGEN, test "x$enable_curve" = "xyes" -a "x$zmq_enable_curve_keygen" = "xyes") AM_CONDITIONAL(USE_LIBSODIUM, test "$curve_library" = "libsodium") AM_CONDITIONAL(USE_TWEETNACL, test "$curve_library" = "tweetnacl") AM_CONDITIONAL(HAVE_CURVE, test "x$curve_library" != "x") # build using pgm have_pgm_library="no" AC_ARG_WITH([pgm], [AS_HELP_STRING([--with-pgm], [build libzmq with PGM extension. Requires pkg-config [default=no]])], [with_pgm_ext=$withval], [with_pgm_ext=no]) # conditionally require pgm package if test "x$with_pgm_ext" != "xno"; then PKG_CHECK_MODULES([pgm], [openpgm-5.2 >= 5.2], [ have_pgm_library="yes" ], [PKG_CHECK_MODULES([pgm], [openpgm-5.1 >= 5.1], [ have_pgm_library="yes" ])]) fi if test "x$have_pgm_library" = "xyes"; then AC_DEFINE(ZMQ_HAVE_OPENPGM, [1], [Have OpenPGM extension]) PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $pgm_LIBS" fi AM_CONDITIONAL(HAVE_PGM, test "x$have_pgm_library" = "xyes") # This uses "--with-norm" to point to the "norm" directory # for "norm/include" and "norm/lib" #(if "--with-norm=yes" is given, then assume installed on system) AC_ARG_WITH([norm], [AS_HELP_STRING([--with-norm], [build libzmq with NORM protocol extension, optionally specifying norm path [default=no]])], [with_norm_ext=$withval], [with_norm_ext=no]) AC_MSG_CHECKING("with_norm_ext = ${with_norm_ext}") if test "x$with_norm_ext" != "xno"; then PKG_CHECK_MODULES([norm], [norm], [ have_norm_library="yes" ], [ AC_MSG_RESULT([yes]) norm_LIBS="" norm_CFLAGS="" if test "x$with_norm_ext" != "xyes"; then norm_path="${with_norm_ext}" norm_CFLAGS="${norm_CFLAGS} -I${norm_path}/include" norm_LIBS="${norm_LIBS} -L${norm_path}/lib" fi norm_LIBS="${norm_LIBS} -lnorm" have_norm_library="yes" AC_SUBST(norm_LIBS) AC_SUBST(norm_CFLAGS) ]) else AC_MSG_RESULT([no]) fi if test "x$have_norm_library" = "xyes"; then AC_DEFINE(ZMQ_HAVE_NORM, [1], [Have NORM protocol extension]) PKGCFG_LIBS_PRIVATE="$PKGCFG_LIBS_PRIVATE $norm_LIBS" fi AM_CONDITIONAL(HAVE_NORM, test "x$have_norm_library" = "xyes") # build using vmci have_vmci_library="no" AC_ARG_WITH([vmci], [AS_HELP_STRING([--with-vmci], [build libzmq with VMCI transport [default=no]])], [have_vmci_ext=$withval], [have_vmci_ext=no]) if test "x$have_vmci_ext" != "xno"; then AC_DEFINE(ZMQ_HAVE_VMCI, 1, [Have VMCI transport]) if test "x$have_vmci_ext" != "xyes"; then vmci_path="${have_vmci_ext}" LIBZMQ_VMCI_CXXFLAGS="-I${vmci_path}" LIBZMQ_VMCI_LDFLAGS="-I${vmci_path}" LIBZMQ_EXTRA_CXXFLAGS="${LIBZMQ_VMCI_CXXFLAGS} ${LIBZMQ_EXTRA_CXXFLAGS}" LIBZMQ_EXTRA_LDFLAGS="${LIBZMQ_VMCI_LDFLAGS} ${LIBZMQ_EXTRA_LDFLAGS}" fi fi AM_CONDITIONAL(HAVE_VMCI, test "x$have_vmci_ext" != "xno") # Set -Wall, -Werror and -pedantic AC_LANG_PUSH([C++]) # Check how to enable -Wall LIBZMQ_LANG_WALL([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_wall_flag $CPPFLAGS"]) if test "x$libzmq_werror" = "xyes" -a "x$libzmq_cv_[]_AC_LANG_ABBREV[]_sun_studio_compiler" != "xyes"; then LIBZMQ_LANG_WERROR([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_werror_flag $CPPFLAGS"]) fi if test "x$libzmq_pedantic" = "xyes"; then LIBZMQ_LANG_STRICT([CPPFLAGS="$libzmq_cv_[]_AC_LANG_ABBREV[]_strict_flag $CPPFLAGS"]) fi AC_LANG_POP([C++]) AM_CONDITIONAL(BUILD_TIPC, test "x$libzmq_tipc_support" = "xyes") AM_CONDITIONAL(ON_MINGW, test "x$libzmq_on_mingw" = "xyes") AM_CONDITIONAL(ON_CYGWIN, test "x$libzmq_on_cygwin" = "xyes") AM_CONDITIONAL(ON_ANDROID, test "x$libzmq_on_android" = "xyes") AM_CONDITIONAL(ON_LINUX, test "x$libzmq_on_linux" = "xyes") AM_CONDITIONAL(ON_GNU, test "x$libzmq_on_gnu" = "xyes") # Check for __atomic_Xxx compiler intrinsics AC_LANG_PUSH([C++]) LIBZMQ_CHECK_ATOMIC_INTRINSICS([ AC_DEFINE([ZMQ_HAVE_ATOMIC_INTRINSICS], [1], [Whether compiler has __atomic_Xxx intrinsics.]) ]) AC_LANG_POP([C++]) # Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork posix_memalign mkdtemp accept4) AC_CHECK_HEADERS([alloca.h]) # pthread_setname is non-posix, and there are at least 4 different implementations AC_MSG_CHECKING([whether signature of pthread_setname_np() has 1 argument]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_setname_np ("foo"); return 0;]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(ZMQ_HAVE_PTHREAD_SETNAME_1, [1], [Whether pthread_setname_np() has 1 argument]) ],[ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([whether signature of pthread_setname_np() has 2 arguments]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_setname_np (pthread_self (), "foo"); return 0;]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(ZMQ_HAVE_PTHREAD_SETNAME_2, [1], [Whether pthread_setname_np() has 2 arguments]) ],[ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([whether signature of pthread_setname_np() has 3 arguments]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_setname_np (pthread_self(), "foo", (void *)0); return 0;]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(ZMQ_HAVE_PTHREAD_SETNAME_3, [1], [Whether pthread_setname_np() has 3 arguments]) ],[ AC_MSG_RESULT([no]) ]) AC_MSG_CHECKING([whether pthread_set_name_np() exists]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[pthread_set_name_np (pthread_self(), "foo"); return 0;]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(ZMQ_HAVE_PTHREAD_SET_NAME, [1], [Whether pthread_set_name_np() exists]) ],[ AC_MSG_RESULT([no]) ]) # pthread_setaffinity_np is non-posix: AC_MSG_CHECKING([whether pthread_setaffinity_np() exists]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[cpu_set_t test; pthread_setaffinity_np (pthread_self(), sizeof(cpu_set_t), &test); return 0;]]) ],[ AC_MSG_RESULT([yes]) AC_DEFINE(ZMQ_HAVE_PTHREAD_SET_AFFINITY, [1], [Whether pthread_setaffinity_np() exists]) ],[ AC_MSG_RESULT([no]) ]) LIBZMQ_CHECK_SOCK_CLOEXEC([ AC_DEFINE([ZMQ_HAVE_SOCK_CLOEXEC], [1], [Whether SOCK_CLOEXEC is defined and functioning.]) ]) LIBZMQ_CHECK_O_CLOEXEC([ AC_DEFINE([ZMQ_HAVE_O_CLOEXEC], [1], [Whether O_CLOEXEC is defined and functioning.]) ]) LIBZMQ_CHECK_SO_BINDTODEVICE([ AC_DEFINE([ZMQ_HAVE_SO_BINDTODEVICE], [1], [Whether SO_BINDTODEVICE is supported.]) ]) # TCP keep-alives Checks. LIBZMQ_CHECK_SO_KEEPALIVE([ AC_DEFINE([ZMQ_HAVE_SO_KEEPALIVE], [1], [Whether SO_KEEPALIVE is supported.]) ]) LIBZMQ_CHECK_TCP_KEEPCNT([ AC_DEFINE([ZMQ_HAVE_TCP_KEEPCNT], [1], [Whether TCP_KEEPCNT is supported.]) ]) LIBZMQ_CHECK_TCP_KEEPIDLE([ AC_DEFINE([ZMQ_HAVE_TCP_KEEPIDLE], [1], [Whether TCP_KEEPIDLE is supported.]) ]) LIBZMQ_CHECK_TCP_KEEPINTVL([ AC_DEFINE([ZMQ_HAVE_TCP_KEEPINTVL], [1], [Whether TCP_KEEPINTVL is supported.]) ]) LIBZMQ_CHECK_TCP_KEEPALIVE([ AC_DEFINE([ZMQ_HAVE_TCP_KEEPALIVE], [1], [Whether TCP_KEEPALIVE is supported.]) ]) LIBZMQ_CHECK_GETRANDOM([ AC_DEFINE([ZMQ_HAVE_GETRANDOM], [1], [Whether getrandom is supported.]) ]) AM_CONDITIONAL(HAVE_FORK, test "x$ac_cv_func_fork" = "xyes") if test "x$cross_compiling" = "xyes"; then # Enable draft by default when cross-compiling defaultval=yes else # enable draft API by default if we're in a git repository # else disable it by default; then allow --enable-drafts=yes/no override AC_CHECK_FILE($srcdir/.git, [defaultval=yes], [defaultval=no]) fi AC_ARG_ENABLE([drafts], AS_HELP_STRING([--enable-drafts], [Build and install draft classes and methods [default=yes]]), [enable_drafts=$enableval], [enable_drafts=$defaultval]) AM_CONDITIONAL([ENABLE_DRAFTS], [test x$enable_drafts != xno]) if test "x$enable_drafts" = "xyes"; then AC_MSG_NOTICE([Building stable and legacy API + draft API]) AC_DEFINE(ZMQ_BUILD_DRAFT_API, 1, [Provide draft classes and methods]) AC_SUBST(pkg_config_defines, "-DZMQ_BUILD_DRAFT_API=1") else AC_MSG_NOTICE([Building stable and legacy API (no draft API)]) AC_SUBST(pkg_config_defines, "") fi AC_ARG_ENABLE([libunwind], [AS_HELP_STRING([--enable-libunwind], [enable libunwind [default=auto]])], [enable_libunwind=$enableval], [enable_libunwind="auto"]) if test "x$enable_libunwind" != "xno"; then PKG_CHECK_MODULES(LIBUNWIND, [libunwind], [ AC_DEFINE(HAVE_LIBUNWIND, 1, [The libunwind library is to be used]) AC_SUBST([LIBUNWIND_CFLAGS]) AC_SUBST([LIBUNWIND_LIBS]) AC_CHECK_LIB([dl], [dladdr]) ], [ if test "x$enable_libunwind" = "xyes"; then AC_MSG_ERROR([Cannot find libunwind]) else AC_MSG_WARN([Cannot find libunwind]) fi ]) fi # See if clang-format is in PATH; the result unblocks the relevant recipes WITH_CLANG_FORMAT="" AS_IF([test x"$CLANG_FORMAT" = x], [AC_PATH_PROG([CLANG_FORMAT], [clang-format], [])], [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [fail])]) AS_IF([test x"$CLANG_FORMAT" != x && test x"$WITH_CLANG_FORMAT" = x], [AS_IF([test -x "$CLANG_FORMAT"], [WITH_CLANG_FORMAT=true], [AC_CHECK_PROG([WITH_CLANG_FORMAT], [$CLANG_FORMAT], [true], [false])])]) AS_IF([test "$WITH_CLANG_FORMAT" = fail], [AC_MSG_ERROR([Caller explicitly referenced CLANG_FORMAT=$CLANG_FORMAT which was not found])]) AM_CONDITIONAL([WITH_CLANG_FORMAT], [$WITH_CLANG_FORMAT]) # unittests will not build without the static libzmq.a AM_CONDITIONAL(ENABLE_STATIC, test "x$enable_static" = "xyes") # Subst LIBZMQ_EXTRA_CFLAGS & CXXFLAGS & LDFLAGS AC_SUBST(LIBZMQ_EXTRA_CFLAGS) AC_SUBST(LIBZMQ_EXTRA_CXXFLAGS) AC_SUBST(LIBZMQ_EXTRA_LDFLAGS) AC_SUBST(LIBZMQ_VMCI_CXXFLAGS) AC_SUBST(LIBZMQ_VMCI_LDFLAGS) AC_SUBST(pkg_config_libs_private, $PKGCFG_LIBS_PRIVATE) # set pkgconfigdir, allow override AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) AC_SUBST([pkgconfigdir]) AC_CONFIG_FILES([ \ Makefile \ src/libzmq.pc \ doc/Makefile \ builds/Makefile \ builds/msvc/Makefile]) AC_OUTPUT zeromq-4.2.5/CMakeLists.txt0000664000372000037200000011632213255253220016505 0ustar00travistravis00000000000000# CMake build script for ZeroMQ cmake_minimum_required (VERSION 2.8.12) project (ZeroMQ) list (INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}") set (ZMQ_CMAKE_MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules) list (APPEND CMAKE_MODULE_PATH ${ZMQ_CMAKE_MODULES_DIR}) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") endif() include(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG("-std=gnu11" COMPILER_SUPPORTS_C11) if(COMPILER_SUPPORTS_C11) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") endif() # Will be used to add flags to pkg-config useful when apps want to statically link set (pkg_config_libs_private "") option (WITH_OPENPGM "Build with support for OpenPGM" OFF) option (WITH_VMCI "Build with support for VMware VMCI socket" OFF) if (APPLE) option (ZMQ_BUILD_FRAMEWORK "Build as OS X framework" OFF) endif () # Select curve encryption library, defaults to tweetnacl # To use libsodium instead, use --with-libsodium (must be installed) # To disable curve, use --disable-curve option (WITH_LIBSODIUM "Use libsodium instead of built-in tweetnacl" OFF) option (ENABLE_CURVE "Enable CURVE security" ON) if (NOT ENABLE_CURVE) message (STATUS "CURVE security is disabled") elseif (WITH_LIBSODIUM) find_package (Sodium) if (SODIUM_FOUND) message (STATUS "Using libsodium for CURVE security") include_directories (${SODIUM_INCLUDE_DIRS}) set (ZMQ_USE_LIBSODIUM 1) set (ZMQ_HAVE_CURVE 1) set (pkg_config_libs_private "${pkg_config_libs_private} -lsodium") else () message (FATAL_ERROR "libsodium is not installed. Install it, then run CMake again") endif () else () message (STATUS "Using tweetnacl for CURVE security") list (APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/tweetnacl.c) set (ZMQ_USE_TWEETNACL 1) set (ZMQ_HAVE_CURVE 1) endif () set(SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") if (EXISTS "${SOURCE_DIR}/.git") OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" ON) else () OPTION (ENABLE_DRAFTS "Build and install draft classes and methods" OFF) endif () IF (ENABLE_DRAFTS) ADD_DEFINITIONS (-DZMQ_BUILD_DRAFT_API) set (pkg_config_defines "-DZMQ_BUILD_DRAFT_API=1") ELSE (ENABLE_DRAFTS) set (pkg_config_defines "") ENDIF (ENABLE_DRAFTS) option (WITH_MILITANT "Enable militant assertions" OFF) if (WITH_MILITANT) add_definitions(-DZMQ_ACT_MILITANT) endif() set (POLLER "" CACHE STRING "Choose polling system. valid values are kqueue, epoll, devpoll, pollset, poll or select [default=autodetect]") include (CheckFunctionExists) include (CheckTypeSize) if (POLLER STREQUAL "") set (CMAKE_REQUIRED_INCLUDES sys/event.h) check_function_exists (kqueue HAVE_KQUEUE) set (CMAKE_REQUIRED_INCLUDES) if (HAVE_KQUEUE) set (POLLER "kqueue") endif() endif () if (POLLER STREQUAL "") set (CMAKE_REQUIRED_INCLUDES sys/epoll.h) check_function_exists (epoll_create HAVE_EPOLL) set (CMAKE_REQUIRED_INCLUDES) if (HAVE_EPOLL) set (POLLER "epoll") check_function_exists (epoll_create1 HAVE_EPOLL_CLOEXEC) if (HAVE_EPOLL_CLOEXEC) set (ZMQ_USE_EPOLL_CLOEXEC 1) endif () endif () endif () if (POLLER STREQUAL "") set (CMAKE_REQUIRED_INCLUDES sys/devpoll.h) check_type_size ("struct pollfd" DEVPOLL) set (CMAKE_REQUIRED_INCLUDES) if (HAVE_DEVPOLL) set (POLLER "devpoll") endif () endif () if (POLLER STREQUAL "") set (CMAKE_REQUIRED_INCLUDES sys/pollset.h) check_function_exists (pollset_create HAVE_POLLSET) set (CMAKE_REQUIRED_INCLUDES) if (HAVE_POLLSET) set (POLLER "pollset") endif() endif () if (POLLER STREQUAL "") set (CMAKE_REQUIRED_INCLUDES poll.h) check_function_exists (poll HAVE_POLL) set (CMAKE_REQUIRED_INCLUDES) if (HAVE_POLL) set (POLLER "poll") endif () endif () if (POLLER STREQUAL "") if (WIN32) set (CMAKE_REQUIRED_INCLUDES winsock2.h) set (HAVE_SELECT 1) else () set (CMAKE_REQUIRED_INCLUDES sys/select.h) check_function_exists (select HAVE_SELECT) set (CMAKE_REQUIRED_INCLUDES) endif () if (HAVE_SELECT) set (POLLER "select") else () message (FATAL_ERROR "Could not autodetect polling method") endif () endif () if (POLLER STREQUAL "kqueue" OR POLLER STREQUAL "epoll" OR POLLER STREQUAL "devpoll" OR POLLER STREQUAL "pollset" OR POLLER STREQUAL "poll" OR POLLER STREQUAL "select") message (STATUS "Detected ${POLLER} polling method") string (TOUPPER ${POLLER} UPPER_POLLER) set (ZMQ_USE_${UPPER_POLLER} 1) else () message (FATAL_ERROR "Invalid polling method") endif () include (TestZMQVersion) if (NOT CMAKE_CROSSCOMPILING) include (ZMQSourceRunChecks) endif () include (CheckIncludeFiles) include (CheckLibraryExists) include (CheckCCompilerFlag) include (CheckCXXCompilerFlag) include (CheckCSourceCompiles) include (CheckCSourceRuns) include (CMakeDependentOption) include (CheckCXXSymbolExists) include (CheckSymbolExists) check_include_files (ifaddrs.h ZMQ_HAVE_IFADDRS) check_include_files (windows.h ZMQ_HAVE_WINDOWS) if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_SYSTEM_VERSION STREQUAL "10.0") SET(ZMQ_HAVE_WINDOWS_UWP ON) ADD_DEFINITIONS(-D_WIN32_WINNT=_WIN32_WINNT_WIN10) endif() check_include_files (sys/uio.h ZMQ_HAVE_UIO) check_include_files (sys/eventfd.h ZMQ_HAVE_EVENTFD) if (ZMQ_HAVE_EVENTFD AND NOT CMAKE_CROSSCOMPILING) zmq_check_efd_cloexec () endif () if (ZMQ_HAVE_WINDOWS) # Cannot use check_library_exists because the symbol is always declared as char(*)(void) set(CMAKE_REQUIRED_LIBRARIES "ws2_32.lib") check_symbol_exists (WSAStartup "winsock2.h" HAVE_WS2_32) set(CMAKE_REQUIRED_LIBRARIES "rpcrt4.lib") check_symbol_exists (UuidCreateSequential "rpc.h" HAVE_RPCRT4) set(CMAKE_REQUIRED_LIBRARIES "iphlpapi.lib") check_symbol_exists (GetAdaptersAddresses "winsock2.h;iphlpapi.h" HAVE_IPHLAPI) set(CMAKE_REQUIRED_LIBRARIES "") # TODO: This not the symbol we're looking for. What is the symbol? check_library_exists (ws2 fopen "" HAVE_WS2) else() check_cxx_symbol_exists (SO_PEERCRED sys/socket.h ZMQ_HAVE_SO_PEERCRED) check_cxx_symbol_exists (LOCAL_PEERCRED sys/socket.h ZMQ_HAVE_LOCAL_PEERCRED) endif() find_library (RT_LIBRARY rt) find_package (Threads) if (WIN32 AND NOT CYGWIN) if (NOT HAVE_WS2_32 AND NOT HAVE_WS2) message (FATAL_ERROR "Cannot link to ws2_32 or ws2") endif () if (NOT HAVE_RPCRT4) message (FATAL_ERROR "Cannot link to rpcrt4") endif () if (NOT HAVE_IPHLAPI) message (FATAL_ERROR "Cannot link to iphlapi") endif () endif () set (CMAKE_REQUIRED_LIBRARIES rt) check_function_exists (clock_gettime HAVE_CLOCK_GETTIME) set (CMAKE_REQUIRED_LIBRARIES) set (CMAKE_REQUIRED_INCLUDES unistd.h) check_function_exists (fork HAVE_FORK) set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES sys/time.h) check_function_exists (gethrtime HAVE_GETHRTIME) set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES stdlib.h) check_function_exists (mkdtemp HAVE_MKDTEMP) set (CMAKE_REQUIRED_INCLUDES) set (CMAKE_REQUIRED_INCLUDES sys/socket.h) check_function_exists (accept4 HAVE_ACCEPT4) set (CMAKE_REQUIRED_INCLUDES) add_definitions (-D_REENTRANT -D_THREAD_SAFE) add_definitions (-DZMQ_CUSTOM_PLATFORM_HPP) option (ENABLE_EVENTFD "Enable/disable eventfd" ZMQ_HAVE_EVENTFD) macro (zmq_check_cxx_flag_prepend flag) check_cxx_compiler_flag ("${flag}" HAVE_FLAG_${flag}) if (HAVE_FLAG_${flag}) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") endif () endmacro () if (MSVC) zmq_check_cxx_flag_prepend ("/W3") if (MSVC_IDE) set (MSVC_TOOLSET "-${CMAKE_VS_PLATFORM_TOOLSET}") else () set (MSVC_TOOLSET "") endif () else () zmq_check_cxx_flag_prepend ("-Wall") endif () if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") zmq_check_cxx_flag_prepend ("-Wextra") endif () # TODO: why is -Wno-long-long defined differently than in configure.ac? zmq_check_cxx_flag_prepend ("-Wno-long-long") zmq_check_cxx_flag_prepend ("-Wno-uninitialized") option (LIBZMQ_PEDANTIC "" ON) option (LIBZMQ_WERROR "" OFF) if (LIBZMQ_PEDANTIC) zmq_check_cxx_flag_prepend ("-pedantic") if (${CMAKE_CXX_COMPILER_ID} MATCHES "Intel") zmq_check_cxx_flag_prepend ("-strict-ansi") endif () if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") zmq_check_cxx_flag_prepend ("-compat=5") endif () endif () if (LIBZMQ_WERROR) zmq_check_cxx_flag_prepend ("-Werror") if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") zmq_check_cxx_flag_prepend ("-errwarn=%all") endif() endif () if (CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc") zmq_check_cxx_flag_prepend ("-mcpu=v9") endif () if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") zmq_check_cxx_flag_prepend ("-features=zla") endif () if (CMAKE_SYSTEM_NAME MATCHES "SunOS" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD") message (STATUS "Checking whether atomic operations can be used") check_c_source_compiles ( " #include int main () { uint32_t value; atomic_cas_32 (&value, 0, 0); return 0; } " HAVE_ATOMIC_H) if (NOT HAVE_ATOMIC_H) set (ZMQ_FORCE_MUTEXES 1) endif () endif () #----------------------------------------------------------------------------- if (NOT CMAKE_CROSSCOMPILING) zmq_check_sock_cloexec () zmq_check_o_cloexec () zmq_check_so_bindtodevice () zmq_check_so_keepalive () zmq_check_tcp_keepcnt () zmq_check_tcp_keepidle () zmq_check_tcp_keepintvl () zmq_check_tcp_keepalive () zmq_check_tcp_tipc () zmq_check_pthread_setname () zmq_check_pthread_setaffinity () zmq_check_getrandom () endif () if ( CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "GNU/kFreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "GNU/Hurd" OR CYGWIN) add_definitions (-D_GNU_SOURCE) elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") add_definitions (-D__BSD_VISIBLE) elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD") add_definitions (-D_NETBSD_SOURCE) elseif (CMAKE_SYSTEM_NAME MATCHES "OpenBSD") add_definitions (-D_OPENBSD_SOURCE) elseif (CMAKE_SYSTEM_NAME MATCHES "SunOS") add_definitions (-D_PTHREADS) elseif (CMAKE_SYSTEM_NAME MATCHES "HP-UX") add_definitions (-D_POSIX_C_SOURCE=200112L) zmq_check_cxx_flag_prepend (-Ae) elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") add_definitions (-D_DARWIN_C_SOURCE) endif () set (CMAKE_PYTHON_VERSION 2.7 2.6 2.5 2.4) find_package (PythonInterp) find_package (AsciiDoc) cmake_dependent_option (WITH_DOC "Build Reference Guide documentation (requires DocBook)" ON "PYTHONINTERP_FOUND;ASCIIDOC_FOUND" OFF) if (MSVC) if (WITH_OPENPGM) # set (OPENPGM_ROOT "" CACHE PATH "Location of OpenPGM") set (OPENPGM_VERSION_MAJOR 5) set (OPENPGM_VERSION_MINOR 2) set (OPENPGM_VERSION_MICRO 122) if (CMAKE_CL_64) find_path (OPENPGM_ROOT include/pgm/pgm.h PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" NO_DEFAULT_PATH ) message (STATUS "OpenPGM x64 detected - ${OPENPGM_ROOT}") else () find_path (OPENPGM_ROOT include/pgm/pgm.h PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Miru\\OpenPGM ${OPENPGM_VERSION_MAJOR}.${OPENPGM_VERSION_MINOR}.${OPENPGM_VERSION_MICRO}]" NO_DEFAULT_PATH ) message (STATUS "OpenPGM x86 detected - ${OPENPGM_ROOT}") endif (CMAKE_CL_64) set (OPENPGM_INCLUDE_DIRS ${OPENPGM_ROOT}/include) set (OPENPGM_LIBRARY_DIRS ${OPENPGM_ROOT}/lib) set (OPENPGM_LIBRARIES optimized libpgm${MSVC_TOOLSET}-mt-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib debug libpgm${MSVC_TOOLSET}-mt-gd-${OPENPGM_VERSION_MAJOR}_${OPENPGM_VERSION_MINOR}_${OPENPGM_VERSION_MICRO}.lib) endif () else () if (WITH_OPENPGM) # message (FATAL_ERROR "WITH_OPENPGM not implemented") if (NOT OPENPGM_PKGCONFIG_NAME) SET (OPENPGM_PKGCONFIG_NAME "openpgm-5.2") endif(NOT OPENPGM_PKGCONFIG_NAME) SET (OPENPGM_PKGCONFIG_NAME ${OPENPGM_PKGCONFIG_NAME} CACHE STRING "Name pkg-config shall use to find openpgm libraries and include paths" FORCE ) find_package(PkgConfig) pkg_check_modules (OPENPGM ${OPENPGM_PKGCONFIG_NAME}) if (OPENPGM_FOUND) message (STATUS ${OPENPGM_PKGCONFIG_NAME}" found") else () message (FATAL_ERROR ${OPENPGM_PKGCONFIG_NAME}" not found. openpgm is searchd via `pkg-config ${OPENPGM_PKGCONFIG_NAME}`. Consider providing a valid OPENPGM_PKGCONFIG_NAME") endif () # DSO symbol visibility for openpgm if (HAVE_FLAG_VISIBILITY_HIDDEN) elseif (HAVE_FLAG_LDSCOPE_HIDDEN) endif () endif () endif () #----------------------------------------------------------------------------- # force off-tree build if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) message (FATAL_ERROR "CMake generation is not allowed within the source directory! Remove the CMakeCache.txt file and try again from another folder, e.g.: rm CMakeCache.txt mkdir cmake-make cd cmake-make cmake .. ") endif () #----------------------------------------------------------------------------- # default to Release build if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) # CMAKE_BUILD_TYPE is not used for multi-configuration generators like Visual Studio/XCode # which instead use CMAKE_CONFIGURATION_TYPES set (CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) endif () set (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin) set (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/lib) #----------------------------------------------------------------------------- # platform specifics if (WIN32) # Socket limit is 16K (can be raised arbitrarily) add_definitions (-DFD_SETSIZE=16384) add_definitions (-D_CRT_SECURE_NO_WARNINGS) add_definitions (-D_WINSOCK_DEPRECATED_NO_WARNINGS) endif () if (MSVC) # Parallel make. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") # Optimization flags. # http://msdn.microsoft.com/en-us/magazine/cc301698.aspx if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG") set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /LTCG") endif () endif () #----------------------------------------------------------------------------- # source files set (cxx-sources precompiled.cpp address.cpp client.cpp clock.cpp ctx.cpp curve_mechanism_base.cpp curve_client.cpp curve_server.cpp dealer.cpp devpoll.cpp dgram.cpp dist.cpp epoll.cpp err.cpp fq.cpp io_object.cpp io_thread.cpp ip.cpp ipc_address.cpp ipc_connecter.cpp ipc_listener.cpp kqueue.cpp lb.cpp mailbox.cpp mailbox_safe.cpp mechanism.cpp mechanism_base.cpp metadata.cpp msg.cpp mtrie.cpp object.cpp options.cpp own.cpp null_mechanism.cpp pair.cpp pgm_receiver.cpp pgm_sender.cpp pgm_socket.cpp pipe.cpp plain_client.cpp plain_server.cpp poll.cpp poller_base.cpp pollset.cpp proxy.cpp pub.cpp pull.cpp push.cpp random.cpp raw_encoder.cpp raw_decoder.cpp reaper.cpp rep.cpp req.cpp router.cpp select.cpp server.cpp session_base.cpp signaler.cpp socket_base.cpp socks.cpp socks_connecter.cpp stream.cpp stream_engine.cpp sub.cpp tcp.cpp tcp_address.cpp tcp_connecter.cpp tcp_listener.cpp thread.cpp trie.cpp v1_decoder.cpp v1_encoder.cpp v2_decoder.cpp v2_encoder.cpp xpub.cpp xsub.cpp zmq.cpp zmq_utils.cpp decoder_allocators.cpp socket_poller.cpp timers.cpp config.hpp radio.cpp dish.cpp udp_engine.cpp udp_address.cpp scatter.cpp gather.cpp zap_client.cpp # at least for VS, the header files must also be listed address.hpp array.hpp atomic_counter.hpp atomic_ptr.hpp blob.hpp client.hpp clock.hpp command.hpp condition_variable.hpp config.hpp ctx.hpp curve_client.hpp curve_client_tools.hpp curve_mechanism_base.hpp curve_server.hpp dbuffer.hpp dealer.hpp decoder.hpp decoder_allocators.hpp devpoll.hpp dgram.hpp dish.hpp dist.hpp encoder.hpp epoll.hpp err.hpp fd.hpp fq.hpp gather.hpp generic_mtrie.hpp generic_mtrie_impl.hpp gssapi_client.hpp gssapi_mechanism_base.hpp gssapi_server.hpp i_decoder.hpp i_encoder.hpp i_engine.hpp i_mailbox.hpp i_poll_events.hpp io_object.hpp io_thread.hpp ip.hpp ipc_address.hpp ipc_connecter.hpp ipc_listener.hpp kqueue.hpp lb.hpp likely.hpp macros.hpp mailbox.hpp mailbox_safe.hpp mechanism.hpp mechanism_base.hpp metadata.hpp msg.hpp mtrie.hpp mutex.hpp norm_engine.hpp null_mechanism.hpp object.hpp options.hpp own.hpp pair.hpp pgm_receiver.hpp pgm_sender.hpp pgm_socket.hpp pipe.hpp plain_client.hpp plain_server.hpp poll.hpp poller.hpp poller_base.hpp pollset.hpp precompiled.hpp proxy.hpp pub.hpp pull.hpp push.hpp radio.hpp random.hpp raw_decoder.hpp raw_encoder.hpp reaper.hpp rep.hpp req.hpp router.hpp scatter.hpp select.hpp server.hpp session_base.hpp signaler.hpp socket_base.hpp socket_poller.hpp socks.hpp socks_connecter.hpp stdint.hpp stream.hpp stream_engine.hpp sub.hpp tcp.hpp tcp_address.hpp tcp_connecter.hpp tcp_listener.hpp thread.hpp timers.hpp tipc_address.hpp tipc_connecter.hpp tipc_listener.hpp trie.hpp udp_address.hpp udp_engine.hpp v1_decoder.hpp v1_encoder.hpp v2_decoder.hpp v2_encoder.hpp v2_protocol.hpp vmci.hpp vmci_address.hpp vmci_connecter.hpp vmci_listener.hpp windows.hpp wire.hpp xpub.hpp xsub.hpp ypipe.hpp ypipe_base.hpp ypipe_conflate.hpp yqueue.hpp zap_client.hpp ) if (MINGW) # Generate the right type when using -m32 or -m64 macro (set_rc_arch rc_target) set (CMAKE_RC_COMPILER_INIT windres) enable_language (RC) set (CMAKE_RC_COMPILE_OBJECT " -O coff --target=${rc_target} -i -o ") endmacro () if (NOT CMAKE_SYSTEM_PROCESSOR) set (CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) endif () if ( CMAKE_SYSTEM_PROCESSOR MATCHES "i386" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i486" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i586" OR CMAKE_SYSTEM_PROCESSOR MATCHES "i686" # This also happens on x86_64 systems...what a worthless variable OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86" OR CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "amd64") if (CMAKE_SIZEOF_VOID_P EQUAL 8) set_rc_arch ("pe-x86-64") else () set_rc_arch ("pe-i386") endif () endif () endif () set (public_headers include/zmq.h include/zmq_utils.h) set (readme-docs AUTHORS COPYING COPYING.LESSER NEWS) #----------------------------------------------------------------------------- # optional modules if (WITH_OPENPGM) add_definitions (-DZMQ_HAVE_OPENPGM) include_directories (${OPENPGM_INCLUDE_DIRS}) link_directories (${OPENPGM_LIBRARY_DIRS}) set (OPTIONAL_LIBRARIES ${OPENPGM_LIBRARIES}) endif (WITH_OPENPGM) if (WITH_VMCI) add_definitions (-DZMQ_HAVE_VMCI) include_directories (${VMCI_INCLUDE_DIRS}) list (APPEND cxx-sources vmci_address.cpp vmci_connecter.cpp vmci_listener.cpp vmci.cpp) endif (WITH_VMCI) if (ZMQ_HAVE_TIPC) add_definitions (-DZMQ_HAVE_TIPC) list (APPEND cxx-sources tipc_address.cpp tipc_connecter.cpp tipc_listener.cpp) endif (ZMQ_HAVE_TIPC) #----------------------------------------------------------------------------- # source generators foreach (source ${cxx-sources}) list (APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/src/${source}) endforeach () configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) # Delete any src/platform.hpp left by configure file (REMOVE ${CMAKE_CURRENT_SOURCE_DIR}/src/platform.hpp) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/platform.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp) list (APPEND sources ${CMAKE_CURRENT_BINARY_DIR}/platform.hpp) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/libzmq.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc @ONLY) set (zmq-pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc) if (NOT ZMQ_BUILD_FRAMEWORK) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libzmq.pc DESTINATION lib/pkgconfig) endif () if (MSVC) if (CMAKE_CL_64) set (nsis-template ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/NSIS.template64.in) else () set (nsis-template ${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/NSIS.template32.in) endif () add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in COMMAND ${CMAKE_COMMAND} ARGS -E copy ${nsis-template} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in DEPENDS ${nsis-template}) endif () file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc) file (GLOB docs RELATIVE ${CMAKE_CURRENT_BINARY_DIR}/ "${CMAKE_CURRENT_SOURCE_DIR}/doc/*.txt") set (html-docs) foreach (txt ${docs}) string (REGEX REPLACE ".*/(.*)\\.txt" "\\1.html" html ${txt}) set (src ${txt}) set (dst doc/${html}) if (WITH_DOC) add_custom_command ( OUTPUT ${dst} COMMAND ${ASCIIDOC_EXECUTABLE} -d manpage -b xhtml11 -f ${CMAKE_CURRENT_SOURCE_DIR}/doc/asciidoc.conf -azmq_version=${ZMQ_VERSION} -o ${dst} ${src} DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${src} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating ${html}") list (APPEND html-docs ${CMAKE_CURRENT_BINARY_DIR}/${dst}) endif () endforeach () if (ZMQ_BUILD_FRAMEWORK) add_custom_command ( TARGET libzmq POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E make_directory "${CMAKE_LIBRARY_OUTPUT_PATH}/ZeroMQ.framework/Versions/${ZMQ_VERSION}/MacOS" COMMENT "Perf tools") endif () if (MSVC) # default for all sources is to use precompiled headers foreach(source ${sources}) if (NOT ${source} STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/src/precompiled.cpp") set_source_files_properties(${source} PROPERTIES COMPILE_FLAGS "/Yuprecompiled.hpp" OBJECT_DEPENDS precompiled.hpp ) endif() endforeach() # create precompiled header set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/precompiled.cpp PROPERTIES COMPILE_FLAGS "/Ycprecompiled.hpp" OBJECT_OUTPUTS precompiled.hpp ) # C and C++ can not use the same precompiled header set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/src/tweetnacl.c PROPERTIES COMPILE_FLAGS "/Y-" ) endif () #----------------------------------------------------------------------------- # output option(BUILD_SHARED "Whether or not to build the shared object" ON) option(BUILD_STATIC "Whether or not to build the static archive" ON) list(APPEND target_outputs "") if (BUILD_SHARED) list(APPEND target_outputs "libzmq") endif() if (BUILD_STATIC) list(APPEND target_outputs "libzmq-static") endif() if (MSVC) # Suppress linker warnings caused by #ifdef omission # of file content. set( CMAKE_STATIC_LINKER_FLAGS /ignore:4221 ) if (BUILD_SHARED) add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) set_target_properties (libzmq PROPERTIES PUBLIC_HEADER "${public_headers}" RELEASE_POSTFIX "${MSVC_TOOLSET}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" RELWITHDEBINFO_POSTFIX "${MSVC_TOOLSET}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" MINSIZEREL_POSTFIX "${MSVC_TOOLSET}-mt-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" DEBUG_POSTFIX "${MSVC_TOOLSET}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" COMPILE_DEFINITIONS "DLL_EXPORT" OUTPUT_NAME "libzmq") endif() if (BUILD_STATIC) add_library (libzmq-static STATIC ${sources} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) set_target_properties (libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" RELEASE_POSTFIX "${MSVC_TOOLSET}-mt-s-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" RELWITHDEBINFO_POSTFIX "${MSVC_TOOLSET}-mt-s-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" MINSIZEREL_POSTFIX "${MSVC_TOOLSET}-mt-s-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" DEBUG_POSTFIX "${MSVC_TOOLSET}-mt-sgd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}" COMPILE_FLAGS "/DZMQ_STATIC" OUTPUT_NAME "libzmq") endif() else () # avoid building everything twice for shared + static # only on *nix, as Windows needs different preprocessor defines in static builds if (NOT MINGW) add_library (objects OBJECT ${sources}) set_property(TARGET objects PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories (objects PUBLIC $ $ $ ) endif () if (BUILD_SHARED) if (MINGW) add_library (libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) else () add_library (libzmq SHARED $ ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif () # NOTE: the SOVERSION and VERSION MUST be the same as the one generated by libtool! It is NOT the same as the version of the package. set_target_properties (libzmq PROPERTIES COMPILE_DEFINITIONS "DLL_EXPORT" PUBLIC_HEADER "${public_headers}" VERSION "5.1.5" SOVERSION "5" OUTPUT_NAME "zmq" PREFIX "lib") if (ZMQ_BUILD_FRAMEWORK) set_target_properties (libzmq PROPERTIES FRAMEWORK TRUE MACOSX_FRAMEWORK_IDENTIFIER "org.zeromq.libzmq" MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${ZMQ_VERSION} MACOSX_FRAMEWORK_BUNDLE_VERSION ${ZMQ_VERSION}) set_source_files_properties (${html-docs} PROPERTIES MACOSX_PACKAGE_LOCATION doc) set_source_files_properties (${readme-docs} PROPERTIES MACOSX_PACKAGE_LOCATION etc) set_source_files_properties (${zmq-pkgconfig} PROPERTIES MACOSX_PACKAGE_LOCATION lib/pkgconfig) endif () endif() if (BUILD_STATIC) if (MINGW) add_library (libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) else () add_library (libzmq-static STATIC $ ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) endif () set_target_properties (libzmq-static PROPERTIES PUBLIC_HEADER "${public_headers}" OUTPUT_NAME "zmq" PREFIX "lib") endif() endif () if (BUILD_STATIC) target_compile_definitions(libzmq-static PUBLIC ZMQ_STATIC ) endif () foreach (target ${target_outputs}) target_include_directories (${target} PUBLIC $ $ $ ) endforeach() if (BUILD_SHARED) target_link_libraries (libzmq ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) if (SODIUM_FOUND) target_link_libraries (libzmq ${SODIUM_LIBRARIES}) # On Solaris, libsodium depends on libssp if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") target_link_libraries (libzmq ssp) endif () endif () if (HAVE_WS2_32) target_link_libraries (libzmq ws2_32) elseif (HAVE_WS2) target_link_libraries (libzmq ws2) endif () if (HAVE_RPCRT4) target_link_libraries (libzmq rpcrt4) endif () if (HAVE_IPHLAPI) target_link_libraries (libzmq iphlpapi) endif () if (RT_LIBRARY) target_link_libraries (libzmq -lrt) endif () endif () if (BUILD_STATIC) target_link_libraries (libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) if (SODIUM_FOUND) target_link_libraries (libzmq-static ${SODIUM_LIBRARIES}) # On Solaris, libsodium depends on libssp if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") target_link_libraries (libzmq-static ssp) endif () endif () if (HAVE_WS2_32) target_link_libraries (libzmq-static ws2_32) elseif (HAVE_WS2) target_link_libraries (libzmq-static ws2) endif () if (HAVE_RPCRT4) target_link_libraries (libzmq-static rpcrt4) endif () if (HAVE_IPHLAPI) target_link_libraries (libzmq-static iphlpapi) endif () if (RT_LIBRARY) target_link_libraries (libzmq-static -lrt) endif () endif () if (BUILD_SHARED) set (perf-tools local_lat remote_lat local_thr remote_thr inproc_lat inproc_thr) if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") # Why? option (WITH_PERF_TOOL "Build with perf-tools" ON) else () option (WITH_PERF_TOOL "Build with perf-tools" OFF) endif () if (WITH_PERF_TOOL) foreach (perf-tool ${perf-tools}) add_executable (${perf-tool} perf/${perf-tool}.cpp) target_link_libraries (${perf-tool} libzmq) if (ZMQ_BUILD_FRAMEWORK) # Copy perf-tools binaries into Framework add_custom_command ( TARGET libzmq ${perf-tool} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "$" "${LIBRARY_OUTPUT_PATH}/ZeroMQ.framework/Versions/${ZMQ_VERSION_STRING}/MacOS/${perf-tool}" VERBATIM COMMENT "Perf tools") else () install (TARGETS ${perf-tool} RUNTIME DESTINATION bin COMPONENT PerfTools) endif () endforeach () endif () elseif (WITH_PERF_TOOL) message(FATAL_ERROR "Shared library disabled - perf-tools unavailable.") endif () #----------------------------------------------------------------------------- # tests option(BUILD_TESTS "Whether or not to build the tests" ON) set (ZMQ_BUILD_TESTS ${BUILD_TESTS} CACHE BOOL "Build the tests for ZeroMQ") if (ZMQ_BUILD_TESTS) enable_testing () # Enable testing only works in root scope ADD_SUBDIRECTORY (tests) if (BUILD_STATIC) add_subdirectory (unittests) else () message (WARNING "Not building unit tests, since BUILD_STATIC is not enabled") endif () endif () #----------------------------------------------------------------------------- # installer include(GNUInstallDirs) if (MSVC) install (TARGETS ${target_outputs} EXPORT ${PROJECT_NAME}-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT SDK) if (CMAKE_BUILD_TYPE STREQUAL "Debug") install (TARGETS ${target_outputs} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT SDK) if (NOT CMAKE_PDB_OUTPUT_DIRECTORY AND BUILD_SHARED) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/bin/libzmq${MSVC_TOOLSET}-mt-gd-${ZMQ_VERSION_MAJOR}_${ZMQ_VERSION_MINOR}_${ZMQ_VERSION_PATCH}.pdb DESTINATION lib COMPONENT SDK) endif () elseif (BUILD_SHARED) install (TARGETS libzmq RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT Runtime) endif () else () install (TARGETS ${target_outputs} EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} FRAMEWORK DESTINATION "Library/Frameworks" PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif () # install (FILES ${public_headers} # DESTINATION include # COMPONENT SDK) #if (NOT ZMQ_BUILD_FRAMEWORK) # file (GLOB private_headers "${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp") # install (FILES ${sources} ${private_headers} DESTINATION src/zmq # COMPONENT SourceCode) #endif () foreach (readme ${readme-docs}) configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${readme} ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt) if (NOT ZMQ_BUILD_FRAMEWORK) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${readme}.txt DESTINATION share/zmq) endif () endforeach () if (WITH_DOC) if (NOT ZMQ_BUILD_FRAMEWORK) install (FILES ${html-docs} DESTINATION doc/zmq COMPONENT RefGuide) endif () endif () include(CMakePackageConfigHelpers) if (WIN32) set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "CMake" CACHE STRING "install path for ZeroMQConfig.cmake") else() # GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share". set(ZEROMQ_CMAKECONFIG_INSTALL_DIR "share/cmake/${PROJECT_NAME}" CACHE STRING "install path for ZeroMQConfig.cmake") endif() if (NOT CMAKE_VERSION VERSION_LESS 3.0) export(EXPORT ${PROJECT_NAME}-targets FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") endif() configure_package_config_file(builds/cmake/${PROJECT_NAME}Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" INSTALL_DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR}) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH} COMPATIBILITY AnyNewerVersion) install(EXPORT ${PROJECT_NAME}-targets FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION ${ZEROMQ_CMAKECONFIG_INSTALL_DIR}) option(ENABLE_CPACK "Enables cpack rules" ON) if (MSVC AND ENABLE_CPACK) include (InstallRequiredSystemLibraries) if (CMAKE_CL_64) set (arch_name "x64") else () set (arch_name "x86") endif () set (CPACK_NSIS_DISPLAY_NAME "ZeroMQ ${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH} (${arch_name})") set (CPACK_PACKAGE_FILE_NAME "ZeroMQ-${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}-${arch_name}") # TODO: I think this part was intended to be used when running cpack # separately from cmake but I don't know how that works. # # macro (add_crt_version version) # set (rel_dir "${CMAKE_CURRENT_BINARY_DIR}/build/${arch_name}/${version};ZeroMQ;ALL;/") # set (debug_dir "${CMAKE_CURRENT_BINARY_DIR}/debug/${arch_name}/${version};ZeroMQ;ALL;/") # if (EXISTS ${rel_dir}) # list (APPEND CPACK_INSTALL_CMAKE_PROJECTS ${rel_dir}) # endif () # if (EXISTS ${debug_dir}) # list (APPEND CPACK_INSTALL_CMAKE_PROJECTS ${rel_dir}) # endmacro () # endmacro () # add_crt_version (v110) # add_crt_version (v100) # add_crt_version (v90) list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}) set (CPACK_GENERATOR "NSIS") set (CPACK_PACKAGE_NAME "ZeroMQ") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "ZeroMQ lightweight messaging kernel") set (CPACK_PACKAGE_VENDOR "Miru") set (CPACK_NSIS_CONTACT "Steven McCoy ") set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}\\\\COPYING.txt") # set (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_BINARY_DIR}\\\\README.txt") # set (CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_BINARY_DIR}\\\\WELCOME.txt") # There is a bug in NSI that does not handle full unix paths properly. Make # sure there is at least one set of four (4) backslashes. set (CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\installer.ico") set (CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\installer.ico") set (CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\branding.bmp") set (CPACK_NSIS_COMPRESSOR "/SOLID lzma") set (CPACK_PACKAGE_VERSION ${ZMQ_VERSION}) set (CPACK_PACKAGE_VERSION_MAJOR ${ZMQ_VERSION_MAJOR}) set (CPACK_PACKAGE_VERSION_MINOR ${ZMQ_VERSION_MINOR}) set (CPACK_PACKAGE_VERSION_PATCH ${ZMQ_VERSION_PATCH}) # set (CPACK_PACKAGE_INSTALL_DIRECTORY "ZMQ Install Directory") # set (CPACK_TEMPORARY_DIRECTORY "ZMQ Temporary CPack Directory") include (CPack) cpack_add_component_group (Development DISPLAY_NAME "ZeroMQ software development kit" EXPANDED) cpack_add_component (PerfTools DISPLAY_NAME "ZeroMQ performance tools" INSTALL_TYPES FullInstall DevInstall) cpack_add_component (SourceCode DISPLAY_NAME "ZeroMQ source code" DISABLED INSTALL_TYPES FullInstall) cpack_add_component (SDK DISPLAY_NAME "ZeroMQ headers and libraries" INSTALL_TYPES FullInstall DevInstall GROUP Development) if (WITH_DOC) cpack_add_component (RefGuide DISPLAY_NAME "ZeroMQ reference guide" INSTALL_TYPES FullInstall DevInstall GROUP Development) endif () cpack_add_component (Runtime DISPLAY_NAME "ZeroMQ runtime files" REQUIRED INSTALL_TYPES FullInstall DevInstall MinInstall) cpack_add_install_type (FullInstall DISPLAY_NAME "Full install, including source code") cpack_add_install_type (DevInstall DISPLAY_NAME "Developer install, headers and libraries") cpack_add_install_type (MinInstall DISPLAY_NAME "Minimal install, runtime only") endif () # Export this for library to help build this as a sub-project set (ZEROMQ_LIBRARY libzmq CACHE STRING "ZeroMQ library") # Workaround for MSVS10 to avoid the Dialog Hell # FIXME: This could be removed with future version of CMake. if (MSVC_VERSION EQUAL 1600) set (ZMQ_SLN_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/ZeroMQ.sln") if (EXISTS "${ZMQ_SLN_FILENAME}") file (APPEND "${ZMQ_SLN_FILENAME}" "\n# This should be regenerated!\n") endif () endif () include(ClangFormat) zeromq-4.2.5/AUTHORS0000664000372000037200000000444313255253220015015 0ustar00travistravis00000000000000Corporate Contributors ====================== Copyright (c) 2007-2014 iMatix Corporation Copyright (c) 2009-2011 250bpm s.r.o. Copyright (c) 2010-2011 Miru Limited Copyright (c) 2011 VMware, Inc. Copyright (c) 2012 Spotify AB Copyright (c) 2013 Ericsson AB Copyright (c) 2014 AppDynamics Inc. Copyright (c) 2015 Google, Inc. Copyright (c) 2015-2016 Brocade Communications Systems Inc. Individual Contributors ======================= AJ Lewis Alexej Lotz Andrew Thompson André Caron Asko Kauppi Attila Mark Barak Amar Ben Gray Bernd Melchers Bernd Prager Bob Beaty Brandon Carpenter Brett Cameron Brian Buchanan Burak Arslan Carl Clemens Chia-liang Kao Chris Busbey Chris Rempel Chris Wong Christian Gudrian Christian Kamm Chuck Remes Conrad D. Steenberg Constantin Rack Daniel J. Bernstein Dhammika Pathirana Dhruva Krishnamurthy Dirk O. Kaar Doron Somech Douglas Creager Drew Crawford Erich Heine Erik Hugne Erik Rigtorp Fabien Ninoles Frank Denis George Neill Gerard Toonstra Ghislain Putois Gonzalo Diethelm Guido Goldstein Harald Achitz Hardeep Singh Hiten Pandya Ian Barber Ilja Golshtein Ilya Kulakov Ivo Danihelka Jacob Rideout Joe Thornber Jon Dyte Kamil Shakirov Ken Steele Kouhei Sutou Laurent Alebarde Leonardo J. Consoni Lourens Naudé Luca Boccassi Marc Rossi Mark Barbisan Martin Hurton Martin Lucina Martin Pales Martin Sustrik Matus Hamorsky Max Wolf McClain Looney Michael Compton Mika Fischer Mikael Helbo Kjaer Mike Gatny Mikko Koppanen Min Ragan-Kelley Neale Ferguson Nir Soffer Osiris Pedroso Paul Betts Paul Colomiets Pavel Gushcha Pavol Malosek Perry Kundert Peter Bourgon Philip Kovacs Pieter Hintjens Piotr Trojanek Reza Ebrahimi Richard Newton Rik van der Heijden Robert G. Jakabosky Sebastian Otaegui Stefan Radomski Steven McCoy Stuart Webster Tamara Kustarova Taras Shpot Tero Marttila Terry Wilson Thijs Terlouw Thomas Rodgers Tim Mossbarger Toralf Wittner Tore Halvorsen Trevor Bernard Vitaly Mayatskikh Credits ======= Aamir Mohammad Adrian von Bidder Aleksey Yeschenko Alessio Spadaro Alexander Majorov Anh Vu Bernd Schumacher Brian Granger Carsten Dinkelmann David Bahi Dirk Eddelbuettel Evgueny Khartchenko Frank Vanden Berghen Ian Barber John Apps Markus Fischer Matt Muggeridge Michael Santy Oleg Sevostyanov Paulo Henrique Silva Peter Busser Peter Lemenkov Robert Zhang Toralf Wittner Zed Shaw zeromq-4.2.5/INSTALL0000664000372000037200000003014213255253220014771 0ustar00travistravis00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. From GitHub =========== If you clone the Git repository then you should start by running the command `./autogen.sh`. This is not necessary if you get the source packages. CMake installation ================== The following options are available for cmake invocation: - `WITH_PERF_TOOL' Enables the build of performance tools. Default value is ON. - `ZMQ_BUILD_TESTS' Builds ZeroMQ tests. Default value is ON. - `ENABLE_CPACK' Enables CPack build rules. This option has effect on Windows platform only. Default value is ON. Turn it to OFF if you don't want the runtime libraries to be installed (typically if your installation destination already contains them). Example: installing ZeroMQ on Windows with no tests, no performance tools, and no runtime library copy: cmake -G "NMake Makefiles" -D WITH_PERF_TOOL=OFF -D ZMQ_BUILD_TESTS=OFF -D ENABLE_CPACK=OFF -D CMAKE_BUILD_TYPE=Release Windows Builds ============== For Windows building, see the libzmq\builds\msvc\readme.txt file. The library can also be built for the Windows 10 UWP platform through CMake : cmake -H. -B -G"Visual Studio 14 2015 Win64" \ -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 \ -DENABLE_CURVE=OFF -DZMQ_BUILD_TESTS=OFF In VS 2012 it is mandatory to increase the default stack size of 1 MB to at least 2 MB due to implementation of std::map intermittently requiring substantial amount of stack and causing stack overflow. ZeroMQ generally needs more stack when FD_SETSIZE is higher. In all Windows builds it is recommended to start with at least 2 MB stack size unless application using ZeroMQ is using large number of threads which can cause substantial consumption of virtual address space, especially if 32 bit build is used. Generally, programmer needs to tune the stack to balance memory consumption but never get into situation that stack is overflown. Windows Builds - Static ======================= When linking statically with libzmq your CFLAGS and/or CPPFLAGS need to include `-DZMQ_STATIC` otherwise `__dclspec(dllimport)` will be set for all functions and the build will fail. This is a workaround for issue: https://github.com/zeromq/libzmq/issues/2788 Windows Builds - Wine ===================== To use Windows binaries on *nix via Wine, it is necessary to ensure that the kernel TCP buffers are large enough. On some systems, like OS X, they are too small by default. They need to be set to at least one MB as a workaround for issue: https://github.com/zeromq/libzmq/issues/1608 sudo sysctl -w net.inet.tcp.sendspace=1300000 Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. If you are building a development version from the Github source, for example, use `./autogen.sh' to generate `configure' and other necessary installation scripts. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. Note that `make -j check' is not supported as some tests share infrastructure and cannot be run in parallel. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 6. Often, you can also type `make uninstall' to remove the installed files again. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. zeromq-4.2.5/version.sh0000775000372000037200000000135513255253220015770 0ustar00travistravis00000000000000#!/bin/sh # # This script extracts the 0MQ version from include/zmq.h, which is the master # location for this information. # if [ ! -f include/zmq.h ]; then echo "version.sh: error: include/zmq.h does not exist" 1>&2 exit 1 fi MAJOR=`egrep '^#define +ZMQ_VERSION_MAJOR +[0-9]+$' include/zmq.h` MINOR=`egrep '^#define +ZMQ_VERSION_MINOR +[0-9]+$' include/zmq.h` PATCH=`egrep '^#define +ZMQ_VERSION_PATCH +[0-9]+$' include/zmq.h` if [ -z "$MAJOR" -o -z "$MINOR" -o -z "$PATCH" ]; then echo "version.sh: error: could not extract version from include/zmq.h" 1>&2 exit 1 fi MAJOR=`echo $MAJOR | awk '{ print $3 }'` MINOR=`echo $MINOR | awk '{ print $3 }'` PATCH=`echo $PATCH | awk '{ print $3 }'` echo $MAJOR.$MINOR.$PATCH | tr -d '\n' zeromq-4.2.5/tools/0000775000372000037200000000000013255253302015101 5ustar00travistravis00000000000000zeromq-4.2.5/tools/curve_keygen.cpp0000664000372000037200000000465013255253220020277 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include #include #include int main (void) { puts ("This tool generates a CurveZMQ keypair, as two printable strings " "you can"); puts ("use in configuration files or source code. The encoding uses Z85, " "which"); puts ( "is a base-85 format that is described in 0MQ RFC 32, and which has an"); puts ("implementation in the z85_codec.h source used by this tool. The " "keypair"); puts ( "always works with the secret key held by one party and the public key"); puts ("distributed (securely!) to peers wishing to connect to it."); char public_key[41]; char secret_key[41]; if (zmq_curve_keypair (public_key, secret_key)) { if (zmq_errno () == ENOTSUP) puts ("To use curve_keygen, please install libsodium and then " "rebuild libzmq."); exit (1); } puts ("\n== CURVE PUBLIC KEY =="); puts (public_key); puts ("\n== CURVE SECRET KEY =="); puts (secret_key); exit (0); } zeromq-4.2.5/src/0000775000372000037200000000000013255253403014532 5ustar00travistravis00000000000000zeromq-4.2.5/src/precompiled.hpp0000664000372000037200000000622013255253220017543 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PRECOMPILED_HPP_INCLUDED__ #define __ZMQ_PRECOMPILED_HPP_INCLUDED__ #include "platform.hpp" #define __STDC_LIMIT_MACROS // This must be included before any windows headers are compiled. #if defined ZMQ_HAVE_WINDOWS #include "windows.hpp" #endif #if defined ZMQ_HAVE_OPENBSD #define ucred sockpeercred #endif // 0MQ definitions and exported functions #include "../include/zmq.h" // 0MQ DRAFT definitions and exported functions #include "zmq_draft.h" // TODO: expand pch implementation to non-windows builds. #ifdef _MSC_VER // standard C headers #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // standard C++ headers #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if _MSC_VER >= 1800 #include #endif #if _MSC_VER >= 1700 #include #endif #if defined _WIN32_WCE #include #else #include #endif #if defined HAVE_LIBGSSAPI_KRB5 #include "err.hpp" #include "msg.hpp" #include "mechanism.hpp" #include "session_base.hpp" #include "gssapi_server.hpp" #include "wire.hpp" #include #include #endif #include "options.hpp" #endif // _MSC_VER #endif //ifndef __ZMQ_PRECOMPILED_HPP_INCLUDED__ zeromq-4.2.5/src/null_mechanism.cpp0000664000372000037200000001601313255253220020232 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include #include "err.hpp" #include "msg.hpp" #include "session_base.hpp" #include "wire.hpp" #include "null_mechanism.hpp" zmq::null_mechanism_t::null_mechanism_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_) : mechanism_base_t (session_, options_), zap_client_t (session_, peer_address_, options_), ready_command_sent (false), error_command_sent (false), ready_command_received (false), error_command_received (false), zap_request_sent (false), zap_reply_received (false) { } zmq::null_mechanism_t::~null_mechanism_t () { } int zmq::null_mechanism_t::next_handshake_command (msg_t *msg_) { if (ready_command_sent || error_command_sent) { errno = EAGAIN; return -1; } if (zap_required () && !zap_reply_received) { if (zap_request_sent) { errno = EAGAIN; return -1; } // Given this is a backward-incompatible change, it's behind a socket // option disabled by default. int rc = session->zap_connect (); if (rc == -1 && options.zap_enforce_domain) { session->get_socket ()->event_handshake_failed_no_detail ( session->get_endpoint (), EFAULT); return -1; } else if (rc == 0) { send_zap_request (); zap_request_sent = true; // TODO actually, it is quite unlikely that we can read the ZAP // reply already, but removing this has some strange side-effect // (probably because the pipe's in_active flag is true until a read // is attempted) rc = receive_and_process_zap_reply (); if (rc != 0) return -1; zap_reply_received = true; } } if (zap_reply_received && status_code != "200") { error_command_sent = true; if (status_code != "300") { const size_t status_code_len = 3; const int rc = msg_->init_size (6 + 1 + status_code_len); zmq_assert (rc == 0); unsigned char *msg_data = static_cast (msg_->data ()); memcpy (msg_data, "\5ERROR", 6); msg_data[6] = status_code_len; memcpy (msg_data + 7, status_code.c_str (), status_code_len); return 0; } else { errno = EAGAIN; return -1; } } make_command_with_basic_properties (msg_, "\5READY", 6); ready_command_sent = true; return 0; } int zmq::null_mechanism_t::process_handshake_command (msg_t *msg_) { if (ready_command_received || error_command_received) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } const unsigned char *cmd_data = static_cast (msg_->data ()); const size_t data_size = msg_->size (); int rc = 0; if (data_size >= 6 && !memcmp (cmd_data, "\5READY", 6)) rc = process_ready_command (cmd_data, data_size); else if (data_size >= 6 && !memcmp (cmd_data, "\5ERROR", 6)) rc = process_error_command (cmd_data, data_size); else { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; rc = -1; } if (rc == 0) { rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } return rc; } int zmq::null_mechanism_t::process_ready_command (const unsigned char *cmd_data, size_t data_size) { ready_command_received = true; return parse_metadata (cmd_data + 6, data_size - 6); } int zmq::null_mechanism_t::process_error_command (const unsigned char *cmd_data, size_t data_size) { if (data_size < 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const size_t error_reason_len = static_cast (cmd_data[6]); if (error_reason_len > data_size - 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const char *error_reason = reinterpret_cast (cmd_data) + 7; handle_error_reason (error_reason, error_reason_len); error_command_received = true; return 0; } int zmq::null_mechanism_t::zap_msg_available () { if (zap_reply_received) { errno = EFSM; return -1; } const int rc = receive_and_process_zap_reply (); if (rc == 0) zap_reply_received = true; return rc == -1 ? -1 : 0; } zmq::mechanism_t::status_t zmq::null_mechanism_t::status () const { const bool command_sent = ready_command_sent || error_command_sent; const bool command_received = ready_command_received || error_command_received; if (ready_command_sent && ready_command_received) return mechanism_t::ready; else if (command_sent && command_received) return error; else return handshaking; } void zmq::null_mechanism_t::send_zap_request () { zap_client_t::send_zap_request ("NULL", 4, NULL, NULL, 0); } zeromq-4.2.5/src/clock.hpp0000664000372000037200000000466713255253220016350 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CLOCK_HPP_INCLUDED__ #define __ZMQ_CLOCK_HPP_INCLUDED__ #include "stdint.hpp" #if defined ZMQ_HAVE_OSX #include #include #include #include int alt_clock_gettime (int clock_id, timespec *ts); #ifndef CLOCK_REALTIME #define CLOCK_REALTIME 0 #endif #ifndef HAVE_CLOCK_GETTIME #define HAVE_CLOCK_GETTIME #endif #endif namespace zmq { class clock_t { public: clock_t (); ~clock_t (); // CPU's timestamp counter. Returns 0 if it's not available. static uint64_t rdtsc (); // High precision timestamp. static uint64_t now_us (); // Low precision timestamp. In tight loops generating it can be // 10 to 100 times faster than the high precision timestamp. uint64_t now_ms (); private: // TSC timestamp of when last time measurement was made. uint64_t last_tsc; // Physical time corresponding to the TSC above (in milliseconds). uint64_t last_time; clock_t (const clock_t &); const clock_t &operator= (const clock_t &); }; } #endif zeromq-4.2.5/src/command.hpp0000664000372000037200000001245613255253220016666 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_COMMAND_HPP_INCLUDED__ #define __ZMQ_COMMAND_HPP_INCLUDED__ #include #include "stdint.hpp" namespace zmq { class object_t; class own_t; struct i_engine; class pipe_t; class socket_base_t; // This structure defines the commands that can be sent between threads. #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4324) // C4324: alignment padding warnings __declspec(align (64)) #endif struct command_t { // Object to process the command. zmq::object_t *destination; enum type_t { stop, plug, own, attach, bind, activate_read, activate_write, hiccup, pipe_term, pipe_term_ack, pipe_hwm, term_req, term, term_ack, term_endpoint, reap, reaped, inproc_connected, done } type; union args_t { // Sent to I/O thread to let it know that it should // terminate itself. struct { } stop; // Sent to I/O object to make it register with its I/O thread. struct { } plug; // Sent to socket to let it know about the newly created object. struct { zmq::own_t *object; } own; // Attach the engine to the session. If engine is NULL, it informs // session that the connection have failed. struct { struct i_engine *engine; } attach; // Sent from session to socket to establish pipe(s) between them. // Caller have used inc_seqnum beforehand sending the command. struct { zmq::pipe_t *pipe; } bind; // Sent by pipe writer to inform dormant pipe reader that there // are messages in the pipe. struct { } activate_read; // Sent by pipe reader to inform pipe writer about how many // messages it has read so far. struct { uint64_t msgs_read; } activate_write; // Sent by pipe reader to writer after creating a new inpipe. // The parameter is actually of type pipe_t::upipe_t, however, // its definition is private so we'll have to do with void*. struct { void *pipe; } hiccup; // Sent by pipe reader to pipe writer to ask it to terminate // its end of the pipe. struct { } pipe_term; // Pipe writer acknowledges pipe_term command. struct { } pipe_term_ack; // Sent by one of pipe to another part for modify hwm struct { int inhwm; int outhwm; } pipe_hwm; // Sent by I/O object ot the socket to request the shutdown of // the I/O object. struct { zmq::own_t *object; } term_req; // Sent by socket to I/O object to start its shutdown. struct { int linger; } term; // Sent by I/O object to the socket to acknowledge it has // shut down. struct { } term_ack; // Sent by session_base (I/O thread) to socket (application thread) // to ask to disconnect the endpoint. struct { std::string *endpoint; } term_endpoint; // Transfers the ownership of the closed socket // to the reaper thread. struct { zmq::socket_base_t *socket; } reap; // Closed socket notifies the reaper that it's already deallocated. struct { } reaped; // Sent by reaper thread to the term thread when all the sockets // are successfully deallocated. struct { } done; } args; #ifdef _MSC_VER }; #pragma warning(pop) #else } __attribute__ ((aligned (64))); #endif } #endif zeromq-4.2.5/src/dist.hpp0000664000372000037200000000741313255253220016210 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DIST_HPP_INCLUDED__ #define __ZMQ_DIST_HPP_INCLUDED__ #include #include "array.hpp" #include "pipe.hpp" namespace zmq { class pipe_t; class msg_t; // Class manages a set of outbound pipes. It sends each messages to // each of them. class dist_t { public: dist_t (); ~dist_t (); // Adds the pipe to the distributor object. void attach (zmq::pipe_t *pipe_); // Activates pipe that have previously reached high watermark. void activated (zmq::pipe_t *pipe_); // Mark the pipe as matching. Subsequent call to send_to_matching // will send message also to this pipe. void match (zmq::pipe_t *pipe_); // Marks all pipes that are not matched as matched and vice-versa. void reverse_match (); // Mark all pipes as non-matching. void unmatch (); // Removes the pipe from the distributor object. void pipe_terminated (zmq::pipe_t *pipe_); // Send the message to the matching outbound pipes. int send_to_matching (zmq::msg_t *msg_); // Send the message to all the outbound pipes. int send_to_all (zmq::msg_t *msg_); bool has_out (); // check HWM of all pipes matching bool check_hwm (); private: // Write the message to the pipe. Make the pipe inactive if writing // fails. In such a case false is returned. bool write (zmq::pipe_t *pipe_, zmq::msg_t *msg_); // Put the message to all active pipes. void distribute (zmq::msg_t *msg_); // List of outbound pipes. typedef array_t pipes_t; pipes_t pipes; // Number of all the pipes to send the next message to. pipes_t::size_type matching; // Number of active pipes. All the active pipes are located at the // beginning of the pipes array. These are the pipes the messages // can be sent to at the moment. pipes_t::size_type active; // Number of pipes eligible for sending messages to. This includes all // the active pipes plus all the pipes that we can in theory send // messages to (the HWM is not yet reached), but sending a message // to them would result in partial message being delivered, ie. message // with initial parts missing. pipes_t::size_type eligible; // True if last we are in the middle of a multipart message. bool more; dist_t (const dist_t &); const dist_t &operator= (const dist_t &); }; } #endif zeromq-4.2.5/src/raw_decoder.cpp0000664000372000037200000000510313255253220017510 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "raw_decoder.hpp" #include "err.hpp" zmq::raw_decoder_t::raw_decoder_t (size_t bufsize_) : allocator (bufsize_, 1) { int rc = in_progress.init (); errno_assert (rc == 0); } zmq::raw_decoder_t::~raw_decoder_t () { int rc = in_progress.close (); errno_assert (rc == 0); } void zmq::raw_decoder_t::get_buffer (unsigned char **data_, size_t *size_) { *data_ = allocator.allocate (); *size_ = allocator.size (); } int zmq::raw_decoder_t::decode (const uint8_t *data_, size_t size_, size_t &bytes_used_) { int rc = in_progress.init ((unsigned char *) data_, size_, shared_message_memory_allocator::call_dec_ref, allocator.buffer (), allocator.provide_content ()); // if the buffer serves as memory for a zero-copy message, release it // and allocate a new buffer in get_buffer for the next decode if (in_progress.is_zcmsg ()) { allocator.advance_content (); allocator.release (); } errno_assert (rc != -1); bytes_used_ = size_; return 1; } zeromq-4.2.5/src/v1_encoder.hpp0000664000372000037200000000363413255253220017273 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_V1_ENCODER_HPP_INCLUDED__ #define __ZMQ_V1_ENCODER_HPP_INCLUDED__ #include "encoder.hpp" namespace zmq { // Encoder for ZMTP/1.0 protocol. Converts messages into data batches. class v1_encoder_t : public encoder_base_t { public: v1_encoder_t (size_t bufsize_); ~v1_encoder_t (); private: void size_ready (); void message_ready (); unsigned char tmpbuf[10]; v1_encoder_t (const v1_encoder_t &); const v1_encoder_t &operator= (const v1_encoder_t &); }; } #endif zeromq-4.2.5/src/gssapi_server.hpp0000664000372000037200000000543313255253220020121 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GSSAPI_SERVER_HPP_INCLUDED__ #define __ZMQ_GSSAPI_SERVER_HPP_INCLUDED__ #ifdef HAVE_LIBGSSAPI_KRB5 #include "gssapi_mechanism_base.hpp" #include "zap_client.hpp" namespace zmq { class msg_t; class session_base_t; class gssapi_server_t : public gssapi_mechanism_base_t, public zap_client_t { public: gssapi_server_t (session_base_t *session_, const std::string &peer_address, const options_t &options_); virtual ~gssapi_server_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual int encode (msg_t *msg_); virtual int decode (msg_t *msg_); virtual int zap_msg_available (); virtual status_t status () const; private: enum state_t { send_next_token, recv_next_token, expect_zap_reply, send_ready, recv_ready, connected }; session_base_t *const session; const std::string peer_address; // Current FSM state state_t state; // True iff server considers the client authenticated bool security_context_established; // The underlying mechanism type (ignored) gss_OID doid; void accept_context (); int produce_next_token (msg_t *msg_); int process_next_token (msg_t *msg_); void send_zap_request (); }; } #endif #endif zeromq-4.2.5/src/v1_decoder.hpp0000664000372000037200000000432513255253220017257 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_V1_DECODER_HPP_INCLUDED__ #define __ZMQ_V1_DECODER_HPP_INCLUDED__ #include "decoder.hpp" namespace zmq { // Decoder for ZMTP/1.0 protocol. Converts data batches into messages. class v1_decoder_t : public zmq::c_single_allocator, public decoder_base_t { public: v1_decoder_t (size_t bufsize_, int64_t maxmsgsize_); ~v1_decoder_t (); virtual msg_t *msg () { return &in_progress; } private: int one_byte_size_ready (unsigned char const *); int eight_byte_size_ready (unsigned char const *); int flags_ready (unsigned char const *); int message_ready (unsigned char const *); unsigned char tmpbuf[8]; msg_t in_progress; const int64_t maxmsgsize; v1_decoder_t (const v1_decoder_t &); void operator= (const v1_decoder_t &); }; } #endif zeromq-4.2.5/src/epoll.hpp0000664000372000037200000000564613255253220016366 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_EPOLL_HPP_INCLUDED__ #define __ZMQ_EPOLL_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_EPOLL #include #include #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" #include "mutex.hpp" namespace zmq { struct i_poll_events; // This class implements socket polling mechanism using the Linux-specific // epoll mechanism. class epoll_t : public worker_poller_base_t { public: typedef void *handle_t; epoll_t (const thread_ctx_t &ctx_); ~epoll_t (); // "poller" concept. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void stop (); static int max_fds (); private: // Main event loop. void loop (); // Main epoll file descriptor fd_t epoll_fd; struct poll_entry_t { fd_t fd; epoll_event ev; zmq::i_poll_events *events; }; // List of retired event sources. typedef std::vector retired_t; retired_t retired; // Handle of the physical thread doing the I/O work. thread_t worker; // Synchronisation of retired event sources mutex_t retired_sync; epoll_t (const epoll_t &); const epoll_t &operator= (const epoll_t &); }; typedef epoll_t poller_t; } #endif #endif zeromq-4.2.5/src/version.rc.in0000664000372000037200000000670113255253220017153 0ustar00travistravis00000000000000///////////////////////////////////////////////////////////////////////////// // // VERSIONINFO resource // // http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058(v=vs.85).aspx // @MAJOR@,@MINOR@,@BUILD@,@PATCH@ #define VER_FILEVERSION @ZMQ_VERSION_MAJOR@,@ZMQ_VERSION_MINOR@,@ZMQ_VERSION_PATCH@,0 #define VER_FILEVERSION_STR "@ZMQ_VERSION_MAJOR@.@ZMQ_VERSION_MINOR@.@ZMQ_VERSION_PATCH@.0\0" #define VER_PRODUCTVERSION VER_FILEVERSION #define VER_PRODUCTVERSION_STR VER_FILEVERSION_STR // versionID // Version-information resource identifier. This value must be 1. 1 VERSIONINFO //// fixed-info // Binary version number for the file. FILEVERSION VER_FILEVERSION // Binary version number for the product with which the file is distributed. PRODUCTVERSION VER_PRODUCTVERSION // Bits in the FILEFLAGS statement are valid. FILEFLAGSMASK 0x17L // Attributes of the file. // VS_FF_DEBUG = 1 : File contains debugging information or is compiled with debugging features enabled. // VS_FF_PATCHED = 4 : File has been modified and is not identical to the original shipping file of the // same version number. // VS_FF_PRERELEASE = 2 : File is a development version, not a commercially released product. // VS_FF_PRIVATEBUILD = 8 : File was not built using standard release procedures. // VS_FF_SPECIALBUILD = 20 : File was built by the original company using standard release procedures but is a // : variation of the standard file of the same version number. #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x2L #endif // Operating system for which this file was designed. // VOS_DOS = 0x10000 : File was designed for MS-DOS. // VOS_NT = 0x40000 : File was designed for 32-bit Windows. // VOS_WINDOWS16 = 0x1 : File was designed for 16-bit Windows. // VOS_WINDOWS32 = 0x4 : File was designed for 32-bit Windows. // VOS_DOS_WINDOWS16 = 0x10001 : File was designed for 16-bit Windows running with MS-DOS. // VOS_DOS_WINDOWS32 = 0x10004 : File was designed for 32-bit Windows running with MS-DOS. // VOS_NT_WINDOWS32 = 0x40004 : File was designed for 32-bit Windows. // NB: appears obsolete, nothing for x64. FILEOS 0x4L // General type of file. // VFT_APP = 0x1 : File contains an application. // VFT_DLL = 0x2 : File contains a dynamic-link library (DLL). // VFT_DRV = 0x3 : File contains a device driver. // VFT_FONT = 0x4 : File contains a font. // VFT_VXD = 0x5 : File contains a virtual device. // VFT_STATIC_LIB = 0x7 : File contains a static-link library. FILETYPE 0x2L // Function of the file. FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "080904b0" BEGIN VALUE "CompanyName", "iMatix Corporation" VALUE "FileDescription", "ZeroMQ lightweight messaging kernel" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "zeromq" VALUE "LegalCopyright", "Copyright (c) 2012 The ZeroMQ Authors." VALUE "OriginalFilename", "libzmq.dll" VALUE "ProductName", "ZeroMQ" VALUE "ProductVersion", VER_PRODUCTVERSION_STR END END BLOCK "VarFileInfo" BEGIN // langID, one of the following language codes. // 0x409 : U.S. English // 0x809 : U.K. English // charsetID, one of the following character-set identifiers. // 1200 : Unicode VALUE "Translation", 0x809, 1200 END END // end of file. zeromq-4.2.5/src/i_poll_events.hpp0000664000372000037200000000371013255253220020103 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__ #define __ZMQ_I_POLL_EVENTS_HPP_INCLUDED__ namespace zmq { // Virtual interface to be exposed by object that want to be notified // about events on file descriptors. struct i_poll_events { virtual ~i_poll_events () {} // Called by I/O thread when file descriptor is ready for reading. virtual void in_event () = 0; // Called by I/O thread when file descriptor is ready for writing. virtual void out_event () = 0; // Called when timer expires. virtual void timer_event (int id_) = 0; }; } #endif zeromq-4.2.5/src/scatter.cpp0000664000372000037200000000470013255253220016701 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "scatter.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::scatter_t::scatter_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true) { options.type = ZMQ_SCATTER; } zmq::scatter_t::~scatter_t () { } void zmq::scatter_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); // Don't delay pipe termination as there is no one // to receive the delimiter. pipe_->set_nodelay (); zmq_assert (pipe_); lb.attach (pipe_); } void zmq::scatter_t::xwrite_activated (pipe_t *pipe_) { lb.activated (pipe_); } void zmq::scatter_t::xpipe_terminated (pipe_t *pipe_) { lb.pipe_terminated (pipe_); } int zmq::scatter_t::xsend (msg_t *msg_) { // SCATTER sockets do not allow multipart data (ZMQ_SNDMORE) if (msg_->flags () & msg_t::more) { errno = EINVAL; return -1; } return lb.send (msg_); } bool zmq::scatter_t::xhas_out () { return lb.has_out (); } zeromq-4.2.5/src/xpub.cpp0000664000372000037200000002556113255253220016222 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "xpub.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" #include "macros.hpp" #include "generic_mtrie_impl.hpp" zmq::xpub_t::xpub_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), verbose_subs (false), verbose_unsubs (false), more (false), lossy (true), manual (false), pending_pipes (), welcome_msg () { last_pipe = NULL; options.type = ZMQ_XPUB; welcome_msg.init (); } zmq::xpub_t::~xpub_t () { welcome_msg.close (); } void zmq::xpub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { zmq_assert (pipe_); dist.attach (pipe_); // If subscribe_to_all_ is specified, the caller would like to subscribe // to all data on this pipe, implicitly. if (subscribe_to_all_) subscriptions.add (NULL, 0, pipe_); // if welcome message exists, send a copy of it if (welcome_msg.size () > 0) { msg_t copy; copy.init (); int rc = copy.copy (welcome_msg); errno_assert (rc == 0); bool ok = pipe_->write (©); zmq_assert (ok); pipe_->flush (); } // The pipe is active when attached. Let's read the subscriptions from // it, if any. xread_activated (pipe_); } void zmq::xpub_t::xread_activated (pipe_t *pipe_) { // There are some subscriptions waiting. Let's process them. msg_t sub; while (pipe_->read (&sub)) { // Apply the subscription to the trie unsigned char *const data = (unsigned char *) sub.data (); const size_t size = sub.size (); metadata_t *metadata = sub.metadata (); if (size > 0 && (*data == 0 || *data == 1)) { if (manual) { // Store manual subscription to use on termination if (*data == 0) manual_subscriptions.rm (data + 1, size - 1, pipe_); else manual_subscriptions.add (data + 1, size - 1, pipe_); pending_pipes.push_back (pipe_); pending_data.push_back (blob_t (data, size)); if (metadata) metadata->add_ref (); pending_metadata.push_back (metadata); pending_flags.push_back (0); } else { bool notify; if (*data == 0) { mtrie_t::rm_result rm_result = subscriptions.rm (data + 1, size - 1, pipe_); // TODO reconsider what to do if rm_result == mtrie_t::not_found notify = rm_result != mtrie_t::values_remain || verbose_unsubs; } else { bool first_added = subscriptions.add (data + 1, size - 1, pipe_); notify = first_added || verbose_subs; } // If the request was a new subscription, or the subscription // was removed, or verbose mode is enabled, store it so that // it can be passed to the user on next recv call. if (options.type == ZMQ_XPUB && notify) { pending_data.push_back (blob_t (data, size)); if (metadata) metadata->add_ref (); pending_metadata.push_back (metadata); pending_flags.push_back (0); } } } else { // Process user message coming upstream from xsub socket pending_data.push_back (blob_t (data, size)); if (metadata) metadata->add_ref (); pending_metadata.push_back (metadata); pending_flags.push_back (sub.flags ()); } sub.close (); } } void zmq::xpub_t::xwrite_activated (pipe_t *pipe_) { dist.activated (pipe_); } int zmq::xpub_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { if (option_ == ZMQ_XPUB_VERBOSE || option_ == ZMQ_XPUB_VERBOSER || option_ == ZMQ_XPUB_NODROP || option_ == ZMQ_XPUB_MANUAL) { if (optvallen_ != sizeof (int) || *static_cast (optval_) < 0) { errno = EINVAL; return -1; } if (option_ == ZMQ_XPUB_VERBOSE) { verbose_subs = (*static_cast (optval_) != 0); verbose_unsubs = 0; } else if (option_ == ZMQ_XPUB_VERBOSER) { verbose_subs = (*static_cast (optval_) != 0); verbose_unsubs = verbose_subs; } else if (option_ == ZMQ_XPUB_NODROP) lossy = (*static_cast (optval_) == 0); else if (option_ == ZMQ_XPUB_MANUAL) manual = (*static_cast (optval_) != 0); } else if (option_ == ZMQ_SUBSCRIBE && manual) { if (last_pipe != NULL) subscriptions.add ((unsigned char *) optval_, optvallen_, last_pipe); } else if (option_ == ZMQ_UNSUBSCRIBE && manual) { if (last_pipe != NULL) subscriptions.rm ((unsigned char *) optval_, optvallen_, last_pipe); } else if (option_ == ZMQ_XPUB_WELCOME_MSG) { welcome_msg.close (); if (optvallen_ > 0) { int rc = welcome_msg.init_size (optvallen_); errno_assert (rc == 0); unsigned char *data = (unsigned char *) welcome_msg.data (); memcpy (data, optval_, optvallen_); } else welcome_msg.init (); } else { errno = EINVAL; return -1; } return 0; } static void stub (zmq::mtrie_t::prefix_t data_, size_t size_, void *arg_) { LIBZMQ_UNUSED (data_); LIBZMQ_UNUSED (size_); LIBZMQ_UNUSED (arg_); } void zmq::xpub_t::xpipe_terminated (pipe_t *pipe_) { if (manual) { // Remove the pipe from the trie and send corresponding manual // unsubscriptions upstream. manual_subscriptions.rm (pipe_, send_unsubscription, this, false); // Remove pipe without actually sending the message as it was taken // care of by the manual call above. subscriptions is the real mtrie, // so the pipe must be removed from there or it will be left over. subscriptions.rm (pipe_, stub, (void *) NULL, false); } else { // Remove the pipe from the trie. If there are topics that nobody // is interested in anymore, send corresponding unsubscriptions // upstream. subscriptions.rm (pipe_, send_unsubscription, this, !verbose_unsubs); } dist.pipe_terminated (pipe_); } void zmq::xpub_t::mark_as_matching (pipe_t *pipe_, xpub_t *self_) { self_->dist.match (pipe_); } int zmq::xpub_t::xsend (msg_t *msg_) { bool msg_more = msg_->flags () & msg_t::more ? true : false; // For the first part of multi-part message, find the matching pipes. if (!more) { subscriptions.match ((unsigned char *) msg_->data (), msg_->size (), mark_as_matching, this); // If inverted matching is used, reverse the selection now if (options.invert_matching) { dist.reverse_match (); } } int rc = -1; // Assume we fail if (lossy || dist.check_hwm ()) { if (dist.send_to_matching (msg_) == 0) { // If we are at the end of multi-part message we can mark // all the pipes as non-matching. if (!msg_more) dist.unmatch (); more = msg_more; rc = 0; // Yay, sent successfully } } else errno = EAGAIN; return rc; } bool zmq::xpub_t::xhas_out () { return dist.has_out (); } int zmq::xpub_t::xrecv (msg_t *msg_) { // If there is at least one if (pending_data.empty ()) { errno = EAGAIN; return -1; } // User is reading a message, set last_pipe and remove it from the deque if (manual && !pending_pipes.empty ()) { last_pipe = pending_pipes.front (); pending_pipes.pop_front (); } int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init_size (pending_data.front ().size ()); errno_assert (rc == 0); memcpy (msg_->data (), pending_data.front ().data (), pending_data.front ().size ()); // set metadata only if there is some if (metadata_t *metadata = pending_metadata.front ()) { msg_->set_metadata (metadata); // Remove ref corresponding to vector placement metadata->drop_ref (); } msg_->set_flags (pending_flags.front ()); pending_data.pop_front (); pending_metadata.pop_front (); pending_flags.pop_front (); return 0; } bool zmq::xpub_t::xhas_in () { return !pending_data.empty (); } void zmq::xpub_t::send_unsubscription (zmq::mtrie_t::prefix_t data_, size_t size_, xpub_t *self_) { if (self_->options.type != ZMQ_PUB) { // Place the unsubscription to the queue of pending (un)subscriptions // to be retrieved by the user later on. blob_t unsub (size_ + 1); *unsub.data () = 0; if (size_ > 0) memcpy (unsub.data () + 1, data_, size_); self_->pending_data.ZMQ_PUSH_OR_EMPLACE_BACK (ZMQ_MOVE (unsub)); self_->pending_metadata.push_back (NULL); self_->pending_flags.push_back (0); if (self_->manual) { self_->last_pipe = NULL; self_->pending_pipes.push_back (NULL); } } } zeromq-4.2.5/src/poll.hpp0000664000372000037200000000604713255253220016215 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_POLL_HPP_INCLUDED__ #define __ZMQ_POLL_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_POLL #if !defined ZMQ_HAVE_WINDOWS #include #endif #include #include #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" namespace zmq { struct i_poll_events; // Implements socket polling mechanism using the POSIX.1-2001 // poll() system call. class poll_t : public worker_poller_base_t { public: typedef fd_t handle_t; poll_t (const thread_ctx_t &ctx_); ~poll_t (); // "poller" concept. // These methods may only be called from an event callback; add_fd may also be called before start. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void stop (); static int max_fds (); private: // Main event loop. virtual void loop (); void cleanup_retired (); struct fd_entry_t { fd_t index; zmq::i_poll_events *events; }; // This table stores data for registered descriptors. typedef std::vector fd_table_t; fd_table_t fd_table; // Pollset to pass to the poll function. typedef std::vector pollset_t; pollset_t pollset; // If true, there's at least one retired event source. bool retired; poll_t (const poll_t &); const poll_t &operator= (const poll_t &); }; typedef poll_t poller_t; } #endif #endif zeromq-4.2.5/src/mtrie.hpp0000664000372000037200000000345513255253220016367 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MTRIE_HPP_INCLUDED__ #define __ZMQ_MTRIE_HPP_INCLUDED__ #include "generic_mtrie.hpp" #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER > 1600) #define ZMQ_HAS_EXTERN_TEMPLATE 1 #else #define ZMQ_HAS_EXTERN_TEMPLATE 0 #endif namespace zmq { class pipe_t; #if ZMQ_HAS_EXTERN_TEMPLATE extern template class generic_mtrie_t; #endif typedef generic_mtrie_t mtrie_t; } #endif zeromq-4.2.5/src/push.hpp0000664000372000037200000000424413255253220016223 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PUSH_HPP_INCLUDED__ #define __ZMQ_PUSH_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "lb.hpp" namespace zmq { class ctx_t; class pipe_t; class msg_t; class io_thread_t; class push_t : public socket_base_t { public: push_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~push_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); bool xhas_out (); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Load balancer managing the outbound pipes. lb_t lb; push_t (const push_t &); const push_t &operator= (const push_t &); }; } #endif zeromq-4.2.5/src/tcp_listener.cpp0000664000372000037200000002605513255253220017736 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include #include "tcp_listener.hpp" #include "stream_engine.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" #include "tcp.hpp" #include "socket_base.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #include #include #include #include #include #include #ifdef ZMQ_HAVE_VXWORKS #include #endif #endif #ifdef ZMQ_HAVE_OPENVMS #include #endif zmq::tcp_listener_t::tcp_listener_t (io_thread_t *io_thread_, socket_base_t *socket_, const options_t &options_) : own_t (io_thread_, options_), io_object_t (io_thread_), s (retired_fd), handle ((handle_t) NULL), socket (socket_) { } zmq::tcp_listener_t::~tcp_listener_t () { zmq_assert (s == retired_fd); zmq_assert (!handle); } void zmq::tcp_listener_t::process_plug () { // Start polling for incoming connections. handle = add_fd (s); set_pollin (handle); } void zmq::tcp_listener_t::process_term (int linger_) { rm_fd (handle); handle = (handle_t) NULL; close (); own_t::process_term (linger_); } void zmq::tcp_listener_t::in_event () { fd_t fd = accept (); // If connection was reset by the peer in the meantime, just ignore it. // TODO: Handle specific errors like ENFILE/EMFILE etc. if (fd == retired_fd) { socket->event_accept_failed (endpoint, zmq_errno ()); return; } int rc = tune_tcp_socket (fd); rc = rc | tune_tcp_keepalives ( fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl); rc = rc | tune_tcp_maxrt (fd, options.tcp_maxrt); if (rc != 0) { socket->event_accept_failed (endpoint, zmq_errno ()); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); // Create and launch a session object. session_base_t *session = session_base_t::create (io_thread, false, socket, options, NULL); errno_assert (session); session->inc_seqnum (); launch_child (session); send_attach (session, engine, false); socket->event_accepted (endpoint, (int) fd); } void zmq::tcp_listener_t::close () { zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (s); errno_assert (rc == 0); #endif socket->event_closed (endpoint, s); s = retired_fd; } int zmq::tcp_listener_t::get_address (std::string &addr_) { // Get the details of the TCP socket struct sockaddr_storage ss; #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_VXWORKS int sl = sizeof (ss); #else socklen_t sl = sizeof (ss); #endif int rc = getsockname (s, (struct sockaddr *) &ss, &sl); if (rc != 0) { addr_.clear (); return rc; } tcp_address_t addr ((struct sockaddr *) &ss, sl); return addr.to_string (addr_); } int zmq::tcp_listener_t::set_address (const char *addr_) { // Convert the textual address into address structure. int rc = address.resolve (addr_, true, options.ipv6); if (rc != 0) return -1; address.to_string (endpoint); if (options.use_fd != -1) { s = options.use_fd; socket->event_listening (endpoint, s); return 0; } // Create a listening socket. s = open_socket (address.family (), SOCK_STREAM, IPPROTO_TCP); // IPv6 address family not supported, try automatic downgrade to IPv4. if (s == zmq::retired_fd && address.family () == AF_INET6 && errno == EAFNOSUPPORT && options.ipv6) { rc = address.resolve (addr_, true, false); if (rc != 0) return rc; s = open_socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); } #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) { errno = wsa_error_to_errno (WSAGetLastError ()); return -1; } #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP // On Windows, preventing sockets to be inherited by child processes. BOOL brc = SetHandleInformation ((HANDLE) s, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif #else if (s == -1) return -1; #endif // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. // Switch it on in such cases. if (address.family () == AF_INET6) enable_ipv4_mapping (s); // Set the IP Type-Of-Service for the underlying socket if (options.tos != 0) set_ip_type_of_service (s, options.tos); // Set the socket to loopback fastpath if configured. if (options.loopback_fastpath) tcp_tune_loopback_fast_path (s); // Bind the socket to a device if applicable if (!options.bound_device.empty ()) bind_to_device (s, options.bound_device); // Set the socket buffer limits for the underlying socket. if (options.sndbuf >= 0) set_tcp_send_buffer (s, options.sndbuf); if (options.rcvbuf >= 0) set_tcp_receive_buffer (s, options.rcvbuf); // Allow reusing of the address. int flag = 1; #ifdef ZMQ_HAVE_WINDOWS rc = setsockopt (s, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (const char *) &flag, sizeof (int)); wsa_assert (rc != SOCKET_ERROR); #elif defined ZMQ_HAVE_VXWORKS rc = setsockopt (s, SOL_SOCKET, SO_REUSEADDR, (char *) &flag, sizeof (int)); errno_assert (rc == 0); #else rc = setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof (int)); errno_assert (rc == 0); #endif // Bind the socket to the network interface and port. #if defined ZMQ_HAVE_VXWORKS rc = bind (s, (sockaddr *) address.addr (), address.addrlen ()); #else rc = bind (s, address.addr (), address.addrlen ()); #endif #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { errno = wsa_error_to_errno (WSAGetLastError ()); goto error; } #else if (rc != 0) goto error; #endif // Listen for incoming connections. rc = listen (s, options.backlog); #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { errno = wsa_error_to_errno (WSAGetLastError ()); goto error; } #else if (rc != 0) goto error; #endif socket->event_listening (endpoint, s); return 0; error: int err = errno; close (); errno = err; return -1; } zmq::fd_t zmq::tcp_listener_t::accept () { // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. // Accept one connection and deal with different failure modes. zmq_assert (s != retired_fd); struct sockaddr_storage ss; memset (&ss, 0, sizeof (ss)); #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_VXWORKS int ss_len = sizeof (ss); #else socklen_t ss_len = sizeof (ss); #endif #if defined ZMQ_HAVE_SOCK_CLOEXEC && defined HAVE_ACCEPT4 fd_t sock = ::accept4 (s, (struct sockaddr *) &ss, &ss_len, SOCK_CLOEXEC); #else fd_t sock = ::accept (s, (struct sockaddr *) &ss, &ss_len); #endif #ifdef ZMQ_HAVE_WINDOWS if (sock == INVALID_SOCKET) { const int last_error = WSAGetLastError (); wsa_assert (last_error == WSAEWOULDBLOCK || last_error == WSAECONNRESET || last_error == WSAEMFILE || last_error == WSAENOBUFS); return retired_fd; } #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP // On Windows, preventing sockets to be inherited by child processes. BOOL brc = SetHandleInformation ((HANDLE) sock, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif #else if (sock == -1) { errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR || errno == ECONNABORTED || errno == EPROTO || errno == ENOBUFS || errno == ENOMEM || errno == EMFILE || errno == ENFILE); return retired_fd; } #endif #if (!defined ZMQ_HAVE_SOCK_CLOEXEC || !defined HAVE_ACCEPT4) \ && defined FD_CLOEXEC // Race condition can cause socket not to be closed (if fork happens // between accept and this point). int rc = fcntl (sock, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif if (!options.tcp_accept_filters.empty ()) { bool matched = false; for (options_t::tcp_accept_filters_t::size_type i = 0; i != options.tcp_accept_filters.size (); ++i) { if (options.tcp_accept_filters[i].match_address ( (struct sockaddr *) &ss, ss_len)) { matched = true; break; } } if (!matched) { #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (sock); wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (sock); errno_assert (rc == 0); #endif return retired_fd; } } if (zmq::set_nosigpipe (sock)) { #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (sock); wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (sock); errno_assert (rc == 0); #endif return retired_fd; } // Set the IP Type-Of-Service priority for this client socket if (options.tos != 0) set_ip_type_of_service (sock, options.tos); return sock; } zeromq-4.2.5/src/mailbox.hpp0000664000372000037200000000561113255253220016676 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MAILBOX_HPP_INCLUDED__ #define __ZMQ_MAILBOX_HPP_INCLUDED__ #include #include "signaler.hpp" #include "fd.hpp" #include "config.hpp" #include "command.hpp" #include "ypipe.hpp" #include "mutex.hpp" #include "i_mailbox.hpp" namespace zmq { class mailbox_t : public i_mailbox { public: mailbox_t (); ~mailbox_t (); fd_t get_fd () const; void send (const command_t &cmd_); int recv (command_t *cmd_, int timeout_); bool valid () const; #ifdef HAVE_FORK // close the file descriptors in the signaller. This is used in a forked // child process to close the file descriptors so that they do not interfere // with the context in the parent process. void forked () { signaler.forked (); } #endif private: // The pipe to store actual commands. typedef ypipe_t cpipe_t; cpipe_t cpipe; // Signaler to pass signals from writer thread to reader thread. signaler_t signaler; // There's only one thread receiving from the mailbox, but there // is arbitrary number of threads sending. Given that ypipe requires // synchronised access on both of its endpoints, we have to synchronise // the sending side. mutex_t sync; // True if the underlying pipe is active, ie. when we are allowed to // read commands from it. bool active; // Disable copying of mailbox_t object. mailbox_t (const mailbox_t &); const mailbox_t &operator= (const mailbox_t &); }; } #endif zeromq-4.2.5/src/libzmq.vers0000664000372000037200000000004213255253220016722 0ustar00travistravis00000000000000{ global: zmq_*; local: *; }; zeromq-4.2.5/src/socket_poller.cpp0000664000372000037200000004624513255253220020113 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "socket_poller.hpp" #include "err.hpp" static bool is_thread_safe (zmq::socket_base_t &socket) { int thread_safe; size_t thread_safe_size = sizeof (int); int rc = socket.getsockopt (ZMQ_THREAD_SAFE, &thread_safe, &thread_safe_size); zmq_assert (rc == 0); return thread_safe; } zmq::socket_poller_t::socket_poller_t () : tag (0xCAFEBABE), signaler (NULL), need_rebuild (true), use_signaler (false), poll_size (0) #if defined ZMQ_POLL_BASED_ON_POLL , pollfds (NULL) #elif defined ZMQ_POLL_BASED_ON_SELECT , maxfd (0) #endif { #if defined ZMQ_POLL_BASED_ON_SELECT #if defined ZMQ_HAVE_WINDOWS // On Windows fd_set contains array of SOCKETs, each 4 bytes. // For large fd_sets memset() could be expensive and it is unnecessary. // It is enough to set fd_count to 0, exactly what FD_ZERO() macro does. FD_ZERO (&pollset_in); FD_ZERO (&pollset_out); FD_ZERO (&pollset_err); #else memset (&pollset_in, 0, sizeof (pollset_in)); memset (&pollset_out, 0, sizeof (pollset_out)); memset (&pollset_err, 0, sizeof (pollset_err)); #endif #endif } zmq::socket_poller_t::~socket_poller_t () { // Mark the socket_poller as dead tag = 0xdeadbeef; for (items_t::iterator it = items.begin (); it != items.end (); ++it) { // TODO shouldn't this zmq_assert (it->socket->check_tag ()) instead? if (it->socket && it->socket->check_tag () && is_thread_safe (*it->socket)) { it->socket->remove_signaler (signaler); } } if (signaler != NULL) { delete signaler; signaler = NULL; } #if defined ZMQ_POLL_BASED_ON_POLL if (pollfds) { free (pollfds); pollfds = NULL; } #endif } bool zmq::socket_poller_t::check_tag () { return tag == 0xCAFEBABE; } int zmq::socket_poller_t::add (socket_base_t *socket_, void *user_data_, short events_) { for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (it->socket == socket_) { errno = EINVAL; return -1; } } if (is_thread_safe (*socket_)) { if (signaler == NULL) { signaler = new (std::nothrow) signaler_t (); if (!signaler) { errno = ENOMEM; return -1; } if (!signaler->valid ()) { delete signaler; signaler = NULL; errno = EMFILE; return -1; } } socket_->add_signaler (signaler); } item_t item = { socket_, 0, user_data_, events_ #if defined ZMQ_POLL_BASED_ON_POLL , -1 #endif }; items.push_back (item); need_rebuild = true; return 0; } int zmq::socket_poller_t::add_fd (fd_t fd_, void *user_data_, short events_) { for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (!it->socket && it->fd == fd_) { errno = EINVAL; return -1; } } item_t item = { NULL, fd_, user_data_, events_ #if defined ZMQ_POLL_BASED_ON_POLL , -1 #endif }; items.push_back (item); need_rebuild = true; return 0; } int zmq::socket_poller_t::modify (socket_base_t *socket_, short events_) { items_t::iterator it; for (it = items.begin (); it != items.end (); ++it) { if (it->socket == socket_) break; } if (it == items.end ()) { errno = EINVAL; return -1; } it->events = events_; need_rebuild = true; return 0; } int zmq::socket_poller_t::modify_fd (fd_t fd_, short events_) { items_t::iterator it; for (it = items.begin (); it != items.end (); ++it) { if (!it->socket && it->fd == fd_) break; } if (it == items.end ()) { errno = EINVAL; return -1; } it->events = events_; need_rebuild = true; return 0; } int zmq::socket_poller_t::remove (socket_base_t *socket_) { items_t::iterator it; for (it = items.begin (); it != items.end (); ++it) { if (it->socket == socket_) break; } if (it == items.end ()) { errno = EINVAL; return -1; } items.erase (it); need_rebuild = true; if (is_thread_safe (*socket_)) { socket_->remove_signaler (signaler); } return 0; } int zmq::socket_poller_t::remove_fd (fd_t fd_) { items_t::iterator it; for (it = items.begin (); it != items.end (); ++it) { if (!it->socket && it->fd == fd_) break; } if (it == items.end ()) { errno = EINVAL; return -1; } items.erase (it); need_rebuild = true; return 0; } void zmq::socket_poller_t::rebuild () { #if defined ZMQ_POLL_BASED_ON_POLL if (pollfds) { free (pollfds); pollfds = NULL; } use_signaler = false; poll_size = 0; for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (it->events) { if (it->socket && is_thread_safe (*it->socket)) { if (!use_signaler) { use_signaler = true; poll_size++; } } else poll_size++; } } if (poll_size == 0) return; pollfds = (pollfd *) malloc (poll_size * sizeof (pollfd)); alloc_assert (pollfds); int item_nbr = 0; if (use_signaler) { item_nbr = 1; pollfds[0].fd = signaler->get_fd (); pollfds[0].events = POLLIN; } for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (it->events) { if (it->socket) { if (!is_thread_safe (*it->socket)) { size_t fd_size = sizeof (zmq::fd_t); int rc = it->socket->getsockopt ( ZMQ_FD, &pollfds[item_nbr].fd, &fd_size); zmq_assert (rc == 0); pollfds[item_nbr].events = POLLIN; item_nbr++; } } else { pollfds[item_nbr].fd = it->fd; pollfds[item_nbr].events = (it->events & ZMQ_POLLIN ? POLLIN : 0) | (it->events & ZMQ_POLLOUT ? POLLOUT : 0) | (it->events & ZMQ_POLLPRI ? POLLPRI : 0); it->pollfd_index = item_nbr; item_nbr++; } } } #elif defined ZMQ_POLL_BASED_ON_SELECT FD_ZERO (&pollset_in); FD_ZERO (&pollset_out); FD_ZERO (&pollset_err); // Ensure we do not attempt to select () on more than FD_SETSIZE // file descriptors. zmq_assert (items.size () <= FD_SETSIZE); poll_size = 0; use_signaler = false; for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (it->socket && is_thread_safe (*it->socket) && it->events) { use_signaler = true; FD_SET (signaler->get_fd (), &pollset_in); poll_size = 1; break; } } maxfd = 0; // Build the fd_sets for passing to select (). for (items_t::iterator it = items.begin (); it != items.end (); ++it) { if (it->events) { // If the poll item is a 0MQ socket we are interested in input on the // notification file descriptor retrieved by the ZMQ_FD socket option. if (it->socket) { if (!is_thread_safe (*it->socket)) { zmq::fd_t notify_fd; size_t fd_size = sizeof (zmq::fd_t); int rc = it->socket->getsockopt (ZMQ_FD, ¬ify_fd, &fd_size); zmq_assert (rc == 0); FD_SET (notify_fd, &pollset_in); if (maxfd < notify_fd) maxfd = notify_fd; poll_size++; } } // Else, the poll item is a raw file descriptor. Convert the poll item // events to the appropriate fd_sets. else { if (it->events & ZMQ_POLLIN) FD_SET (it->fd, &pollset_in); if (it->events & ZMQ_POLLOUT) FD_SET (it->fd, &pollset_out); if (it->events & ZMQ_POLLERR) FD_SET (it->fd, &pollset_err); if (maxfd < it->fd) maxfd = it->fd; poll_size++; } } } #endif need_rebuild = false; } void zmq::socket_poller_t::zero_trail_events ( zmq::socket_poller_t::event_t *events_, int n_events_, int found) { for (int i = found; i < n_events_; ++i) { events_[i].socket = NULL; events_[i].fd = 0; events_[i].user_data = NULL; events_[i].events = 0; } } #if defined ZMQ_POLL_BASED_ON_POLL int zmq::socket_poller_t::check_events (zmq::socket_poller_t::event_t *events_, int n_events_) #elif defined ZMQ_POLL_BASED_ON_SELECT int zmq::socket_poller_t::check_events (zmq::socket_poller_t::event_t *events_, int n_events_, fd_set &inset, fd_set &outset, fd_set &errset) #endif { int found = 0; for (items_t::iterator it = items.begin (); it != items.end () && found < n_events_; ++it) { // The poll item is a 0MQ socket. Retrieve pending events // using the ZMQ_EVENTS socket option. if (it->socket) { size_t events_size = sizeof (uint32_t); uint32_t events; if (it->socket->getsockopt (ZMQ_EVENTS, &events, &events_size) == -1) { return -1; } if (it->events & events) { events_[found].socket = it->socket; events_[found].user_data = it->user_data; events_[found].events = it->events & events; ++found; } } // Else, the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. else { #if defined ZMQ_POLL_BASED_ON_POLL short revents = pollfds[it->pollfd_index].revents; short events = 0; if (revents & POLLIN) events |= ZMQ_POLLIN; if (revents & POLLOUT) events |= ZMQ_POLLOUT; if (revents & POLLPRI) events |= ZMQ_POLLPRI; if (revents & ~(POLLIN | POLLOUT | POLLPRI)) events |= ZMQ_POLLERR; #elif defined ZMQ_POLL_BASED_ON_SELECT short events = 0; if (FD_ISSET (it->fd, &inset)) events |= ZMQ_POLLIN; if (FD_ISSET (it->fd, &outset)) events |= ZMQ_POLLOUT; if (FD_ISSET (it->fd, &errset)) events |= ZMQ_POLLERR; #endif //POLL_SELECT if (events) { events_[found].socket = NULL; events_[found].user_data = it->user_data; events_[found].fd = it->fd; events_[found].events = events; ++found; } } } return found; } //Return 0 if timeout is expired otherwise 1 int zmq::socket_poller_t::adjust_timeout (zmq::clock_t &clock, long timeout_, uint64_t &now, uint64_t &end, bool &first_pass) { // If socket_poller_t::timeout is zero, exit immediately whether there // are events or not. if (timeout_ == 0) return 0; // At this point we are meant to wait for events but there are none. // If timeout is infinite we can just loop until we get some events. if (timeout_ < 0) { if (first_pass) first_pass = false; return 1; } // The timeout is finite and there are no events. In the first pass // we get a timestamp of when the polling have begun. (We assume that // first pass have taken negligible time). We also compute the time // when the polling should time out. now = clock.now_ms (); if (first_pass) { end = now + timeout_; first_pass = false; return 1; } // Find out whether timeout have expired. if (now >= end) return 0; return 1; } int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_, int n_events_, long timeout_) { if (items.empty () && timeout_ < 0) { errno = EFAULT; return -1; } if (need_rebuild) rebuild (); if (unlikely (poll_size == 0)) { // We'll report an error (timed out) as if the list was non-empty and // no event occurred within the specified timeout. Otherwise the caller // needs to check the return value AND the event to avoid using the // nullified event data. errno = EAGAIN; if (timeout_ == 0) return -1; #if defined ZMQ_HAVE_WINDOWS Sleep (timeout_ > 0 ? timeout_ : INFINITE); return -1; #elif defined ZMQ_HAVE_ANDROID usleep (timeout_ * 1000); return -1; #elif defined ZMQ_HAVE_OSX usleep (timeout_ * 1000); errno = EAGAIN; return -1; #elif defined ZMQ_HAVE_VXWORKS struct timespec ns_; ns_.tv_sec = timeout_ / 1000; ns_.tv_nsec = timeout_ % 1000 * 1000000; nanosleep (&ns_, 0); return -1; #else usleep (timeout_ * 1000); return -1; #endif } #if defined ZMQ_POLL_BASED_ON_POLL zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; bool first_pass = true; while (true) { // Compute the timeout for the subsequent poll. int timeout; if (first_pass) timeout = 0; else if (timeout_ < 0) timeout = -1; else timeout = end - now; // Wait for events. while (true) { int rc = poll (pollfds, poll_size, timeout); if (rc == -1 && errno == EINTR) { return -1; } errno_assert (rc >= 0); break; } // Receive the signal from pollfd if (use_signaler && pollfds[0].revents & POLLIN) signaler->recv (); // Check for the events. int found = check_events (events_, n_events_); if (found) { if (found > 0) zero_trail_events (events_, n_events_, found); return found; } // Adjust timeout or break if (adjust_timeout (clock, timeout_, now, end, first_pass) == 0) break; } errno = EAGAIN; return -1; #elif defined ZMQ_POLL_BASED_ON_SELECT zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; bool first_pass = true; fd_set inset, outset, errset; while (true) { // Compute the timeout for the subsequent poll. timeval timeout; timeval *ptimeout; if (first_pass) { timeout.tv_sec = 0; timeout.tv_usec = 0; ptimeout = &timeout; } else if (timeout_ < 0) ptimeout = NULL; else { timeout.tv_sec = (long) ((end - now) / 1000); timeout.tv_usec = (long) ((end - now) % 1000 * 1000); ptimeout = &timeout; } // Wait for events. Ignore interrupts if there's infinite timeout. while (true) { #if defined ZMQ_HAVE_WINDOWS // On Windows we don't need to copy the whole fd_set. // SOCKETS are continuous from the beginning of fd_array in fd_set. // We just need to copy fd_count elements of fd_array. // We gain huge memcpy() improvement if number of used SOCKETs is much lower than FD_SETSIZE. memcpy (&inset, &pollset_in, (char *) (pollset_in.fd_array + pollset_in.fd_count) - (char *) &pollset_in); memcpy (&outset, &pollset_out, (char *) (pollset_out.fd_array + pollset_out.fd_count) - (char *) &pollset_out); memcpy (&errset, &pollset_err, (char *) (pollset_err.fd_array + pollset_err.fd_count) - (char *) &pollset_err); int rc = select (0, &inset, &outset, &errset, ptimeout); if (unlikely (rc == SOCKET_ERROR)) { errno = zmq::wsa_error_to_errno (WSAGetLastError ()); wsa_assert (errno == ENOTSOCK); return -1; } #else memcpy (&inset, &pollset_in, sizeof (fd_set)); memcpy (&outset, &pollset_out, sizeof (fd_set)); memcpy (&errset, &pollset_err, sizeof (fd_set)); int rc = select (maxfd + 1, &inset, &outset, &errset, ptimeout); if (unlikely (rc == -1)) { errno_assert (errno == EINTR || errno == EBADF); return -1; } #endif break; } if (use_signaler && FD_ISSET (signaler->get_fd (), &inset)) signaler->recv (); // Check for the events. int found = check_events (events_, n_events_, inset, outset, errset); if (found) { if (found > 0) zero_trail_events (events_, n_events_, found); return found; } // Adjust timeout or break if (adjust_timeout (clock, timeout_, now, end, first_pass) == 0) break; } errno = EAGAIN; return -1; #else // Exotic platforms that support neither poll() nor select(). errno = ENOTSUP; return -1; #endif } zeromq-4.2.5/src/tcp_connecter.hpp0000664000372000037200000001045113255253220020067 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __TCP_CONNECTER_HPP_INCLUDED__ #define __TCP_CONNECTER_HPP_INCLUDED__ #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class session_base_t; struct address_t; class tcp_connecter_t : public own_t, public io_object_t { public: // If 'delayed_start' is true connecter first waits for a while, // then starts connection process. tcp_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, address_t *addr_, bool delayed_start_); ~tcp_connecter_t (); private: // ID of the timer used to delay the reconnection. enum { reconnect_timer_id = 1, connect_timer_id }; // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); void out_event (); void timer_event (int id_); // Removes the handle from the poller. void rm_handle (); // Internal function to start the actual connection establishment. void start_connecting (); // Internal function to add a connect timer void add_connect_timer (); // Internal function to add a reconnect timer void add_reconnect_timer (); // Internal function to return a reconnect backoff delay. // Will modify the current_reconnect_ivl used for next call // Returns the currently used interval int get_new_reconnect_ivl (); // Open TCP connecting socket. Returns -1 in case of error, // 0 if connect was successful immediately. Returns -1 with // EAGAIN errno if async connect was launched. int open (); // Close the connecting socket. void close (); // Get the file descriptor of newly created connection. Returns // retired_fd if the connection was unsuccessful. fd_t connect (); // Tunes a connected socket. bool tune_socket (fd_t fd); // Address to connect to. Owned by session_base_t. address_t *const addr; // Underlying socket. fd_t s; // Handle corresponding to the listening socket, if file descriptor is // registered with the poller, or NULL. handle_t handle; // If true, connecter is waiting a while before trying to connect. const bool delayed_start; // True iff a timer has been started. bool connect_timer_started; bool reconnect_timer_started; // Reference to the session we belong to. zmq::session_base_t *const session; // Current reconnect ivl, updated for backoff strategy int current_reconnect_ivl; // String representation of endpoint to connect to std::string endpoint; // Socket zmq::socket_base_t *const socket; tcp_connecter_t (const tcp_connecter_t &); const tcp_connecter_t &operator= (const tcp_connecter_t &); }; } #endif zeromq-4.2.5/src/pgm_sender.cpp0000664000372000037200000001614113255253220017361 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #if defined ZMQ_HAVE_OPENPGM #include #include "io_thread.hpp" #include "pgm_sender.hpp" #include "session_base.hpp" #include "err.hpp" #include "wire.hpp" #include "stdint.hpp" #include "macros.hpp" zmq::pgm_sender_t::pgm_sender_t (io_thread_t *parent_, const options_t &options_) : io_object_t (parent_), has_tx_timer (false), has_rx_timer (false), session (NULL), encoder (0), more_flag (false), pgm_socket (false, options_), options (options_), out_buffer (NULL), out_buffer_size (0), write_size (0) { int rc = msg.init (); errno_assert (rc == 0); } int zmq::pgm_sender_t::init (bool udp_encapsulation_, const char *network_) { int rc = pgm_socket.init (udp_encapsulation_, network_); if (rc != 0) return rc; out_buffer_size = pgm_socket.get_max_tsdu_size (); out_buffer = (unsigned char *) malloc (out_buffer_size); alloc_assert (out_buffer); return rc; } void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, session_base_t *session_) { LIBZMQ_UNUSED (io_thread_); // Allocate 2 fds for PGM socket. fd_t downlink_socket_fd = retired_fd; fd_t uplink_socket_fd = retired_fd; fd_t rdata_notify_fd = retired_fd; fd_t pending_notify_fd = retired_fd; session = session_; // Fill fds from PGM transport and add them to the poller. pgm_socket.get_sender_fds (&downlink_socket_fd, &uplink_socket_fd, &rdata_notify_fd, &pending_notify_fd); handle = add_fd (downlink_socket_fd); uplink_handle = add_fd (uplink_socket_fd); rdata_notify_handle = add_fd (rdata_notify_fd); pending_notify_handle = add_fd (pending_notify_fd); // Set POLLIN. We wont never want to stop polling for uplink = we never // want to stop processing NAKs. set_pollin (uplink_handle); set_pollin (rdata_notify_handle); set_pollin (pending_notify_handle); // Set POLLOUT for downlink_socket_handle. set_pollout (handle); } void zmq::pgm_sender_t::unplug () { if (has_rx_timer) { cancel_timer (rx_timer_id); has_rx_timer = false; } if (has_tx_timer) { cancel_timer (tx_timer_id); has_tx_timer = false; } rm_fd (handle); rm_fd (uplink_handle); rm_fd (rdata_notify_handle); rm_fd (pending_notify_handle); session = NULL; } void zmq::pgm_sender_t::terminate () { unplug (); delete this; } void zmq::pgm_sender_t::restart_output () { set_pollout (handle); out_event (); } void zmq::pgm_sender_t::restart_input () { zmq_assert (false); } const char *zmq::pgm_sender_t::get_endpoint () const { return ""; } zmq::pgm_sender_t::~pgm_sender_t () { int rc = msg.close (); errno_assert (rc == 0); if (out_buffer) { free (out_buffer); out_buffer = NULL; } } void zmq::pgm_sender_t::in_event () { if (has_rx_timer) { cancel_timer (rx_timer_id); has_rx_timer = false; } // In-event on sender side means NAK or SPMR receiving from some peer. pgm_socket.process_upstream (); if (errno == ENOMEM || errno == EBUSY) { const long timeout = pgm_socket.get_rx_timeout (); add_timer (timeout, rx_timer_id); has_rx_timer = true; } } void zmq::pgm_sender_t::out_event () { // POLLOUT event from send socket. If write buffer is empty, // try to read new data from the encoder. if (write_size == 0) { // First two bytes (sizeof uint16_t) are used to store message // offset in following steps. Note that by passing our buffer to // the get data function we prevent it from returning its own buffer. unsigned char *bf = out_buffer + sizeof (uint16_t); size_t bfsz = out_buffer_size - sizeof (uint16_t); uint16_t offset = 0xffff; size_t bytes = encoder.encode (&bf, bfsz); while (bytes < bfsz) { if (!more_flag && offset == 0xffff) offset = static_cast (bytes); int rc = session->pull_msg (&msg); if (rc == -1) break; more_flag = msg.flags () & msg_t::more; encoder.load_msg (&msg); bf = out_buffer + sizeof (uint16_t) + bytes; bytes += encoder.encode (&bf, bfsz - bytes); } // If there are no data to write stop polling for output. if (bytes == 0) { reset_pollout (handle); return; } write_size = sizeof (uint16_t) + bytes; // Put offset information in the buffer. put_uint16 (out_buffer, offset); } if (has_tx_timer) { cancel_timer (tx_timer_id); set_pollout (handle); has_tx_timer = false; } // Send the data. size_t nbytes = pgm_socket.send (out_buffer, write_size); // We can write either all data or 0 which means rate limit reached. if (nbytes == write_size) write_size = 0; else { zmq_assert (nbytes == 0); if (errno == ENOMEM) { // Stop polling handle and wait for tx timeout const long timeout = pgm_socket.get_tx_timeout (); add_timer (timeout, tx_timer_id); reset_pollout (handle); has_tx_timer = true; } else errno_assert (errno == EBUSY); } } void zmq::pgm_sender_t::timer_event (int token) { // Timer cancels on return by poller_base. if (token == rx_timer_id) { has_rx_timer = false; in_event (); } else if (token == tx_timer_id) { // Restart polling handle and retry sending has_tx_timer = false; set_pollout (handle); out_event (); } else zmq_assert (false); } #endif zeromq-4.2.5/src/devpoll.cpp0000664000372000037200000001335513255253220016707 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "devpoll.hpp" #if defined ZMQ_USE_DEVPOLL #include #include #include #include #include #include #include #include #include #include "devpoll.hpp" #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" zmq::devpoll_t::devpoll_t (const zmq::thread_ctx_t &ctx_) : ctx (ctx_), stopping (false) { devpoll_fd = open ("/dev/poll", O_RDWR); errno_assert (devpoll_fd != -1); } zmq::devpoll_t::~devpoll_t () { worker.stop (); close (devpoll_fd); } void zmq::devpoll_t::devpoll_ctl (fd_t fd_, short events_) { struct pollfd pfd = {fd_, events_, 0}; ssize_t rc = write (devpoll_fd, &pfd, sizeof pfd); zmq_assert (rc == sizeof pfd); } zmq::devpoll_t::handle_t zmq::devpoll_t::add_fd (fd_t fd_, i_poll_events *reactor_) { // If the file descriptor table is too small expand it. fd_table_t::size_type sz = fd_table.size (); if (sz <= (fd_table_t::size_type) fd_) { fd_table.resize (fd_ + 1); while (sz != (fd_table_t::size_type) (fd_ + 1)) { fd_table[sz].valid = false; ++sz; } } zmq_assert (!fd_table[fd_].valid); fd_table[fd_].events = 0; fd_table[fd_].reactor = reactor_; fd_table[fd_].valid = true; fd_table[fd_].accepted = false; devpoll_ctl (fd_, 0); pending_list.push_back (fd_); // Increase the load metric of the thread. adjust_load (1); return fd_; } void zmq::devpoll_t::rm_fd (handle_t handle_) { zmq_assert (fd_table[handle_].valid); devpoll_ctl (handle_, POLLREMOVE); fd_table[handle_].valid = false; // Decrease the load metric of the thread. adjust_load (-1); } void zmq::devpoll_t::set_pollin (handle_t handle_) { devpoll_ctl (handle_, POLLREMOVE); fd_table[handle_].events |= POLLIN; devpoll_ctl (handle_, fd_table[handle_].events); } void zmq::devpoll_t::reset_pollin (handle_t handle_) { devpoll_ctl (handle_, POLLREMOVE); fd_table[handle_].events &= ~((short) POLLIN); devpoll_ctl (handle_, fd_table[handle_].events); } void zmq::devpoll_t::set_pollout (handle_t handle_) { devpoll_ctl (handle_, POLLREMOVE); fd_table[handle_].events |= POLLOUT; devpoll_ctl (handle_, fd_table[handle_].events); } void zmq::devpoll_t::reset_pollout (handle_t handle_) { devpoll_ctl (handle_, POLLREMOVE); fd_table[handle_].events &= ~((short) POLLOUT); devpoll_ctl (handle_, fd_table[handle_].events); } void zmq::devpoll_t::start () { ctx.start_thread (worker, worker_routine, this); } void zmq::devpoll_t::stop () { stopping = true; } int zmq::devpoll_t::max_fds () { return -1; } void zmq::devpoll_t::loop () { while (!stopping) { struct pollfd ev_buf[max_io_events]; struct dvpoll poll_req; for (pending_list_t::size_type i = 0; i < pending_list.size (); i++) fd_table[pending_list[i]].accepted = true; pending_list.clear (); // Execute any due timers. int timeout = (int) execute_timers (); // Wait for events. // On Solaris, we can retrieve no more then (OPEN_MAX - 1) events. poll_req.dp_fds = &ev_buf[0]; #if defined ZMQ_HAVE_SOLARIS poll_req.dp_nfds = std::min ((int) max_io_events, OPEN_MAX - 1); #else poll_req.dp_nfds = max_io_events; #endif poll_req.dp_timeout = timeout ? timeout : -1; int n = ioctl (devpoll_fd, DP_POLL, &poll_req); if (n == -1 && errno == EINTR) continue; errno_assert (n != -1); for (int i = 0; i < n; i++) { fd_entry_t *fd_ptr = &fd_table[ev_buf[i].fd]; if (!fd_ptr->valid || !fd_ptr->accepted) continue; if (ev_buf[i].revents & (POLLERR | POLLHUP)) fd_ptr->reactor->in_event (); if (!fd_ptr->valid || !fd_ptr->accepted) continue; if (ev_buf[i].revents & POLLOUT) fd_ptr->reactor->out_event (); if (!fd_ptr->valid || !fd_ptr->accepted) continue; if (ev_buf[i].revents & POLLIN) fd_ptr->reactor->in_event (); } } } void zmq::devpoll_t::worker_routine (void *arg_) { ((devpoll_t *) arg_)->loop (); } #endif zeromq-4.2.5/src/udp_address.hpp0000664000372000037200000000451513255253220017542 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_UDP_ADDRESS_HPP_INCLUDED__ #define __ZMQ_UDP_ADDRESS_HPP_INCLUDED__ #if !defined ZMQ_HAVE_WINDOWS #include #include #endif namespace zmq { class udp_address_t { public: udp_address_t (); virtual ~udp_address_t (); int resolve (const char *name_, bool receiver_); // The opposite to resolve() virtual int to_string (std::string &addr_); #if defined ZMQ_HAVE_WINDOWS unsigned short family () const; #else sa_family_t family () const; #endif const sockaddr *bind_addr () const; socklen_t bind_addrlen () const; const sockaddr *dest_addr () const; socklen_t dest_addrlen () const; bool is_mcast () const; const in_addr multicast_ip () const; const in_addr interface_ip () const; private: in_addr multicast; in_addr iface; sockaddr_in bind_address; sockaddr_in dest_address; bool is_multicast; std::string address; }; } #endif zeromq-4.2.5/src/err.cpp0000664000372000037200000012027213255253220016027 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "err.hpp" const char *zmq::errno_to_string (int errno_) { switch (errno_) { #if defined ZMQ_HAVE_WINDOWS case ENOTSUP: return "Not supported"; case EPROTONOSUPPORT: return "Protocol not supported"; case ENOBUFS: return "No buffer space available"; case ENETDOWN: return "Network is down"; case EADDRINUSE: return "Address in use"; case EADDRNOTAVAIL: return "Address not available"; case ECONNREFUSED: return "Connection refused"; case EINPROGRESS: return "Operation in progress"; #endif case EFSM: return "Operation cannot be accomplished in current state"; case ENOCOMPATPROTO: return "The protocol is not compatible with the socket type"; case ETERM: return "Context was terminated"; case EMTHREAD: return "No thread available"; case EHOSTUNREACH: return "Host unreachable"; default: #if defined _MSC_VER #pragma warning(push) #pragma warning(disable : 4996) #endif return strerror (errno_); #if defined _MSC_VER #pragma warning(pop) #endif } } void zmq::zmq_abort (const char *errmsg_) { #if defined ZMQ_HAVE_WINDOWS // Raise STATUS_FATAL_APP_EXIT. ULONG_PTR extra_info[1]; extra_info[0] = (ULONG_PTR) errmsg_; RaiseException (0x40000015, EXCEPTION_NONCONTINUABLE, 1, extra_info); #else (void) errmsg_; print_backtrace (); abort (); #endif } #ifdef ZMQ_HAVE_WINDOWS const char *zmq::wsa_error () { return wsa_error_no (WSAGetLastError (), NULL); } const char *zmq::wsa_error_no (int no_, const char *wsae_wouldblock_string) { // TODO: It seems that list of Windows socket errors is longer than this. // Investigate whether there's a way to convert it into the string // automatically (wsaError->HRESULT->string?). return (no_ == WSABASEERR) ? "No Error" : (no_ == WSAEINTR) ? "Interrupted system call" : (no_ == WSAEBADF) ? "Bad file number" : (no_ == WSAEACCES) ? "Permission denied" : (no_ == WSAEFAULT) ? "Bad address" : (no_ == WSAEINVAL) ? "Invalid argument" : (no_ == WSAEMFILE) ? "Too many open files" : (no_ == WSAEWOULDBLOCK) ? wsae_wouldblock_string : (no_ == WSAEINPROGRESS) ? "Operation now in progress" : (no_ == WSAEALREADY) ? "Operation already in " "progress" : (no_ == WSAENOTSOCK) ? "Socket operation on " "non-socket" : (no_ == WSAEDESTADDRREQ) ? "Destination " "address required" : (no_ == WSAEMSGSIZE) ? "Message too " "long" : (no_ == WSAEPROTOTYPE) ? "Protocol " "wrong type " "for socket" : (no_ == WSAENOPROTOOPT) ? "Bad " "protoco" "l " "option" : (no_ == WSAEPROTONOSUPPORT) ? "Pro" "toc" "ol " "not" " su" "ppo" "rte" "d" : (no_ == WSAESOCKTNOSUPPORT) ? "Socket type not supported" : (no_ == WSAEOPNOTSUPP) ? "Operation not supported on socket" : (no_ == WSAEPFNOSUPPORT) ? "Protocol family not supported" : (no_ == WSAEAFNOSUPPORT) ? "Address family not supported by protocol family" : (no_ == WSAEADDRINUSE) ? "Address already in use" : (no_ == WSAEADDRNOTAVAIL) ? "Can't assign requested address" : (no_ == WSAENETDOWN) ? "Network is down" : (no_ == WSAENETUNREACH) ? "Network is unreachable" : (no_ == WSAENETRESET) ? "Net dropped connection or reset" : (no_ == WSAECONNABORTED) ? "Software caused connection abort" : (no_ == WSAECONNRESET) ? "Connection reset by peer" : (no_ == WSAENOBUFS) ? "No buffer space available" : (no_ == WSAEISCONN) ? "Socket is already connected" : (no_ == WSAENOTCONN) ? "Socket is not connected" : (no_ == WSAESHUTDOWN) ? "Can't send after socket shutdown" : (no_ == WSAETOOMANYREFS) ? "Too many references can't splice" : (no_ == WSAETIMEDOUT) ? "Connection timed out" : (no_ == WSAECONNREFUSED) ? "Connection refused" : (no_ == WSAELOOP) ? "Too many levels of symbolic links" : (no_ == WSAENAMETOOLONG) ? "File name too long" : (no_ == WSAEHOSTDOWN) ? "Host is down" : (no_ == WSAEHOSTUNREACH) ? "No Route to Host" : (no_ == WSAENOTEMPTY) ? "Directory not empty" : (no_ == WSAEPROCLIM) ? "Too many processes" : ( no_ == WSAEUSERS) ? "Too many users" : (no_ == WSAEDQUOT) ? "Disc Quota Exceeded" : (no_ == WSAESTALE) ? "Stale NFS file handle" : (no_ == WSAEREMOTE) ? "Too many levels of remote in path" : (no_ == WSASYSNOTREADY) ? "Network SubSystem is unavailable" : (no_ == WSAVERNOTSUPPORTED) ? "WINSOCK DLL Version out of range" : (no_ == WSANOTINITIALISED) ? "Successful WSASTARTUP not yet performed" : (no_ == WSAHOST_NOT_FOUND) ? "Host not found" : (no_ == WSATRY_AGAIN) ? "Non-Authoritative Host not found" : (no_ == WSANO_RECOVERY) ? "Non-Recoverable errors: FORMERR REFUSED NOTIMP" : (no_ == WSANO_DATA) ? "Valid name no data record of requested" : "error not defined"; } void zmq::win_error (char *buffer_, size_t buffer_size_) { DWORD errcode = GetLastError (); #if defined _WIN32_WCE DWORD rc = FormatMessageW ( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR) buffer_, buffer_size_ / sizeof (wchar_t), NULL); #else DWORD rc = FormatMessageA ( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), buffer_, (DWORD) buffer_size_, NULL); #endif zmq_assert (rc); } int zmq::wsa_error_to_errno (int errcode) { switch (errcode) { // 10004 - Interrupted system call. case WSAEINTR: return EINTR; // 10009 - File handle is not valid. case WSAEBADF: return EBADF; // 10013 - Permission denied. case WSAEACCES: return EACCES; // 10014 - Bad address. case WSAEFAULT: return EFAULT; // 10022 - Invalid argument. case WSAEINVAL: return EINVAL; // 10024 - Too many open files. case WSAEMFILE: return EMFILE; // 10035 - Operation would block. case WSAEWOULDBLOCK: return EBUSY; // 10036 - Operation now in progress. case WSAEINPROGRESS: return EAGAIN; // 10037 - Operation already in progress. case WSAEALREADY: return EAGAIN; // 10038 - Socket operation on non-socket. case WSAENOTSOCK: return ENOTSOCK; // 10039 - Destination address required. case WSAEDESTADDRREQ: return EFAULT; // 10040 - Message too long. case WSAEMSGSIZE: return EMSGSIZE; // 10041 - Protocol wrong type for socket. case WSAEPROTOTYPE: return EFAULT; // 10042 - Bad protocol option. case WSAENOPROTOOPT: return EINVAL; // 10043 - Protocol not supported. case WSAEPROTONOSUPPORT: return EPROTONOSUPPORT; // 10044 - Socket type not supported. case WSAESOCKTNOSUPPORT: return EFAULT; // 10045 - Operation not supported on socket. case WSAEOPNOTSUPP: return EFAULT; // 10046 - Protocol family not supported. case WSAEPFNOSUPPORT: return EPROTONOSUPPORT; // 10047 - Address family not supported by protocol family. case WSAEAFNOSUPPORT: return EAFNOSUPPORT; // 10048 - Address already in use. case WSAEADDRINUSE: return EADDRINUSE; // 10049 - Cannot assign requested address. case WSAEADDRNOTAVAIL: return EADDRNOTAVAIL; // 10050 - Network is down. case WSAENETDOWN: return ENETDOWN; // 10051 - Network is unreachable. case WSAENETUNREACH: return ENETUNREACH; // 10052 - Network dropped connection on reset. case WSAENETRESET: return ENETRESET; // 10053 - Software caused connection abort. case WSAECONNABORTED: return ECONNABORTED; // 10054 - Connection reset by peer. case WSAECONNRESET: return ECONNRESET; // 10055 - No buffer space available. case WSAENOBUFS: return ENOBUFS; // 10056 - Socket is already connected. case WSAEISCONN: return EFAULT; // 10057 - Socket is not connected. case WSAENOTCONN: return ENOTCONN; // 10058 - Can't send after socket shutdown. case WSAESHUTDOWN: return EFAULT; // 10059 - Too many references can't splice. case WSAETOOMANYREFS: return EFAULT; // 10060 - Connection timed out. case WSAETIMEDOUT: return ETIMEDOUT; // 10061 - Connection refused. case WSAECONNREFUSED: return ECONNREFUSED; // 10062 - Too many levels of symbolic links. case WSAELOOP: return EFAULT; // 10063 - File name too long. case WSAENAMETOOLONG: return EFAULT; // 10064 - Host is down. case WSAEHOSTDOWN: return EAGAIN; // 10065 - No route to host. case WSAEHOSTUNREACH: return EHOSTUNREACH; // 10066 - Directory not empty. case WSAENOTEMPTY: return EFAULT; // 10067 - Too many processes. case WSAEPROCLIM: return EFAULT; // 10068 - Too many users. case WSAEUSERS: return EFAULT; // 10069 - Disc Quota Exceeded. case WSAEDQUOT: return EFAULT; // 10070 - Stale NFS file handle. case WSAESTALE: return EFAULT; // 10071 - Too many levels of remote in path. case WSAEREMOTE: return EFAULT; // 10091 - Network SubSystem is unavailable. case WSASYSNOTREADY: return EFAULT; // 10092 - WINSOCK DLL Version out of range. case WSAVERNOTSUPPORTED: return EFAULT; // 10093 - Successful WSASTARTUP not yet performed. case WSANOTINITIALISED: return EFAULT; // 11001 - Host not found. case WSAHOST_NOT_FOUND: return EFAULT; // 11002 - Non-Authoritative Host not found. case WSATRY_AGAIN: return EFAULT; // 11003 - Non-Recoverable errors: FORMERR REFUSED NOTIMP. case WSANO_RECOVERY: return EFAULT; // 11004 - Valid name no data record of requested. case WSANO_DATA: return EFAULT; default: wsa_assert (false); } // Not reachable return 0; } #endif #ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY #include #include #include #include "mutex.hpp" void zmq::print_backtrace (void) { static zmq::mutex_t mtx; mtx.lock (); Dl_info dl_info; unw_cursor_t cursor; unw_context_t ctx; unsigned frame_n = 0; unw_getcontext (&ctx); unw_init_local (&cursor, &ctx); while (unw_step (&cursor) > 0) { unw_word_t offset; unw_proc_info_t p_info; const char *file_name; char *demangled_name; char func_name[256] = ""; void *addr; int rc; if (unw_get_proc_info (&cursor, &p_info)) break; rc = unw_get_proc_name (&cursor, func_name, 256, &offset); if (rc == -UNW_ENOINFO) strcpy (func_name, "?"); addr = (void *) (p_info.start_ip + offset); if (dladdr (addr, &dl_info) && dl_info.dli_fname) file_name = dl_info.dli_fname; else file_name = "?"; demangled_name = abi::__cxa_demangle (func_name, NULL, NULL, &rc); printf ("#%u %p in %s (%s+0x%lx)\n", frame_n++, addr, file_name, rc ? func_name : demangled_name, (unsigned long) offset); free (demangled_name); } puts (""); fflush (stdout); mtx.unlock (); } #else void zmq::print_backtrace (void) { } #endif zeromq-4.2.5/src/dealer.hpp0000664000372000037200000000537713255253220016510 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DEALER_HPP_INCLUDED__ #define __ZMQ_DEALER_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "fq.hpp" #include "lb.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class socket_base_t; class dealer_t : public socket_base_t { public: dealer_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~dealer_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); // Send and recv - knowing which pipe was used. int sendpipe (zmq::msg_t *msg_, zmq::pipe_t **pipe_); int recvpipe (zmq::msg_t *msg_, zmq::pipe_t **pipe_); private: // Messages are fair-queued from inbound pipes. And load-balanced to // the outbound pipes. fq_t fq; lb_t lb; // if true, send an empty message to every connected router peer bool probe_router; dealer_t (const dealer_t &); const dealer_t &operator= (const dealer_t &); }; } #endif zeromq-4.2.5/src/pair.cpp0000664000372000037200000000727013255253220016174 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "pair.hpp" #include "err.hpp" #include "pipe.hpp" #include "msg.hpp" zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), pipe (NULL), last_in (NULL) { options.type = ZMQ_PAIR; } zmq::pair_t::~pair_t () { zmq_assert (!pipe); } void zmq::pair_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_ != NULL); // ZMQ_PAIR socket can only be connected to a single peer. // The socket rejects any further connection requests. if (pipe == NULL) pipe = pipe_; else pipe_->terminate (false); } void zmq::pair_t::xpipe_terminated (pipe_t *pipe_) { if (pipe_ == pipe) { if (last_in == pipe) { saved_credential.set_deep_copy (last_in->get_credential ()); last_in = NULL; } pipe = NULL; } } void zmq::pair_t::xread_activated (pipe_t *) { // There's just one pipe. No lists of active and inactive pipes. // There's nothing to do here. } void zmq::pair_t::xwrite_activated (pipe_t *) { // There's just one pipe. No lists of active and inactive pipes. // There's nothing to do here. } int zmq::pair_t::xsend (msg_t *msg_) { if (!pipe || !pipe->write (msg_)) { errno = EAGAIN; return -1; } if (!(msg_->flags () & msg_t::more)) pipe->flush (); // Detach the original message from the data buffer. int rc = msg_->init (); errno_assert (rc == 0); return 0; } int zmq::pair_t::xrecv (msg_t *msg_) { // Deallocate old content of the message. int rc = msg_->close (); errno_assert (rc == 0); if (!pipe || !pipe->read (msg_)) { // Initialise the output parameter to be a 0-byte message. rc = msg_->init (); errno_assert (rc == 0); errno = EAGAIN; return -1; } last_in = pipe; return 0; } bool zmq::pair_t::xhas_in () { if (!pipe) return false; return pipe->check_read (); } bool zmq::pair_t::xhas_out () { if (!pipe) return false; return pipe->check_write (); } const zmq::blob_t &zmq::pair_t::get_credential () const { return last_in ? last_in->get_credential () : saved_credential; } zeromq-4.2.5/src/reaper.cpp0000664000372000037200000000740613255253220016520 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "reaper.hpp" #include "socket_base.hpp" #include "err.hpp" zmq::reaper_t::reaper_t (class ctx_t *ctx_, uint32_t tid_) : object_t (ctx_, tid_), mailbox_handle ((poller_t::handle_t) NULL), poller (NULL), sockets (0), terminating (false) { if (!mailbox.valid ()) return; poller = new (std::nothrow) poller_t (*ctx_); alloc_assert (poller); if (mailbox.get_fd () != retired_fd) { mailbox_handle = poller->add_fd (mailbox.get_fd (), this); poller->set_pollin (mailbox_handle); } #ifdef HAVE_FORK pid = getpid (); #endif } zmq::reaper_t::~reaper_t () { LIBZMQ_DELETE (poller); } zmq::mailbox_t *zmq::reaper_t::get_mailbox () { return &mailbox; } void zmq::reaper_t::start () { zmq_assert (mailbox.valid ()); // Start the thread. poller->start (); } void zmq::reaper_t::stop () { if (get_mailbox ()->valid ()) { send_stop (); } } void zmq::reaper_t::in_event () { while (true) { #ifdef HAVE_FORK if (unlikely (pid != getpid ())) { //printf("zmq::reaper_t::in_event return in child process %d\n", (int)getpid()); return; } #endif // Get the next command. If there is none, exit. command_t cmd; int rc = mailbox.recv (&cmd, 0); if (rc != 0 && errno == EINTR) continue; if (rc != 0 && errno == EAGAIN) break; errno_assert (rc == 0); // Process the command. cmd.destination->process_command (cmd); } } void zmq::reaper_t::out_event () { zmq_assert (false); } void zmq::reaper_t::timer_event (int) { zmq_assert (false); } void zmq::reaper_t::process_stop () { terminating = true; // If there are no sockets being reaped finish immediately. if (!sockets) { send_done (); poller->rm_fd (mailbox_handle); poller->stop (); } } void zmq::reaper_t::process_reap (socket_base_t *socket_) { // Add the socket to the poller. socket_->start_reaping (poller); ++sockets; } void zmq::reaper_t::process_reaped () { --sockets; // If reaped was already asked to terminate and there are no more sockets, // finish immediately. if (!sockets && terminating) { send_done (); poller->rm_fd (mailbox_handle); poller->stop (); } } zeromq-4.2.5/src/devpoll.hpp0000664000372000037200000000631613255253220016713 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DEVPOLL_HPP_INCLUDED__ #define __ZMQ_DEVPOLL_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_DEVPOLL #include #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" namespace zmq { struct i_poll_events; // Implements socket polling mechanism using the "/dev/poll" interface. class devpoll_t : public poller_base_t { public: typedef fd_t handle_t; devpoll_t (const thread_ctx_t &ctx_); ~devpoll_t (); // "poller" concept. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void start (); void stop (); static int max_fds (); private: // Main worker thread routine. static void worker_routine (void *arg_); // Main event loop. void loop (); // Reference to ZMQ context. const thread_ctx_t &ctx; // File descriptor referring to "/dev/poll" pseudo-device. fd_t devpoll_fd; struct fd_entry_t { short events; zmq::i_poll_events *reactor; bool valid; bool accepted; }; typedef std::vector fd_table_t; fd_table_t fd_table; typedef std::vector pending_list_t; pending_list_t pending_list; // Pollset manipulation function. void devpoll_ctl (fd_t fd_, short events_); // If true, thread is in the process of shutting down. bool stopping; // Handle of the physical thread doing the I/O work. thread_t worker; devpoll_t (const devpoll_t &); const devpoll_t &operator= (const devpoll_t &); }; typedef devpoll_t poller_t; } #endif #endif zeromq-4.2.5/src/v2_decoder.hpp0000664000372000037200000000523013255253220017254 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_V2_DECODER_HPP_INCLUDED__ #define __ZMQ_V2_DECODER_HPP_INCLUDED__ #include "decoder.hpp" #include "decoder_allocators.hpp" namespace zmq { // Decoder for ZMTP/2.x framing protocol. Converts data stream into messages. // The class has to inherit from shared_message_memory_allocator because // the base class calls allocate in its constructor. class v2_decoder_t : // inherit first from allocator to ensure that it is constructed before decoder_base_t public shared_message_memory_allocator, public decoder_base_t { public: v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_, bool zero_copy_); virtual ~v2_decoder_t (); // i_decoder interface. virtual msg_t *msg () { return &in_progress; } private: int flags_ready (unsigned char const *); int one_byte_size_ready (unsigned char const *); int eight_byte_size_ready (unsigned char const *); int message_ready (unsigned char const *); int size_ready (uint64_t size_, unsigned char const *); unsigned char tmpbuf[8]; unsigned char msg_flags; msg_t in_progress; const bool zero_copy; const int64_t maxmsgsize; v2_decoder_t (const v2_decoder_t &); void operator= (const v2_decoder_t &); }; } #endif zeromq-4.2.5/src/precompiled.cpp0000664000372000037200000000264713255253220017547 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" zeromq-4.2.5/src/raw_encoder.cpp0000664000372000037200000000370113255253220017524 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "encoder.hpp" #include "raw_encoder.hpp" #include "likely.hpp" #include "wire.hpp" zmq::raw_encoder_t::raw_encoder_t (size_t bufsize_) : encoder_base_t (bufsize_) { // Write 0 bytes to the batch and go to message_ready state. next_step (NULL, 0, &raw_encoder_t::raw_message_ready, true); } zmq::raw_encoder_t::~raw_encoder_t () { } void zmq::raw_encoder_t::raw_message_ready () { next_step (in_progress->data (), in_progress->size (), &raw_encoder_t::raw_message_ready, true); } zeromq-4.2.5/src/atomic_counter.hpp0000664000372000037200000002120213255253220020250 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ATOMIC_COUNTER_HPP_INCLUDED__ #define __ZMQ_ATOMIC_COUNTER_HPP_INCLUDED__ #include "stdint.hpp" #if defined ZMQ_FORCE_MUTEXES #define ZMQ_ATOMIC_COUNTER_MUTEX #elif defined ZMQ_HAVE_ATOMIC_INTRINSICS #define ZMQ_ATOMIC_COUNTER_INTRINSIC #elif (defined __cplusplus && __cplusplus >= 201103L) \ || (defined _MSC_VER && _MSC_VER >= 1900) #define ZMQ_ATOMIC_COUNTER_CXX11 #elif (defined __i386__ || defined __x86_64__) && defined __GNUC__ #define ZMQ_ATOMIC_COUNTER_X86 #elif defined __ARM_ARCH_7A__ && defined __GNUC__ #define ZMQ_ATOMIC_COUNTER_ARM #elif defined ZMQ_HAVE_WINDOWS #define ZMQ_ATOMIC_COUNTER_WINDOWS #elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD \ || defined ZMQ_HAVE_GNU) #define ZMQ_ATOMIC_COUNTER_ATOMIC_H #elif defined __tile__ #define ZMQ_ATOMIC_COUNTER_TILE #else #define ZMQ_ATOMIC_COUNTER_MUTEX #endif #if defined ZMQ_ATOMIC_COUNTER_MUTEX #include "mutex.hpp" #elif defined ZMQ_ATOMIC_COUNTER_CXX11 #include #elif defined ZMQ_ATOMIC_COUNTER_WINDOWS #include "windows.hpp" #elif defined ZMQ_ATOMIC_COUNTER_ATOMIC_H #include #elif defined ZMQ_ATOMIC_COUNTER_TILE #include #endif namespace zmq { // This class represents an integer that can be incremented/decremented // in atomic fashion. // // In zmq::shared_message_memory_allocator a buffer with an atomic_counter_t // at the start is allocated. If the class does not align to pointer size, // access to pointers in structures in the buffer will cause SIGBUS on // architectures that do not allow mis-aligned pointers (eg: SPARC). // Force the compiler to align to pointer size, which will cause the object // to grow from 4 bytes to 8 bytes on 64 bit architectures (when not using // mutexes). #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64)) class __declspec(align (8)) atomic_counter_t #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_ARM_ARMV7VE)) class __declspec(align (4)) atomic_counter_t #else class atomic_counter_t #endif { public: typedef uint32_t integer_t; inline atomic_counter_t (integer_t value_ = 0) : value (value_) {} inline ~atomic_counter_t () {} // Set counter value (not thread-safe). inline void set (integer_t value_) { value = value_; } // Atomic addition. Returns the old value. inline integer_t add (integer_t increment_) { integer_t old_value; #if defined ZMQ_ATOMIC_COUNTER_WINDOWS old_value = InterlockedExchangeAdd ((LONG *) &value, increment_); #elif defined ZMQ_ATOMIC_COUNTER_INTRINSIC old_value = __atomic_fetch_add (&value, increment_, __ATOMIC_ACQ_REL); #elif defined ZMQ_ATOMIC_COUNTER_CXX11 old_value = value.fetch_add (increment_, std::memory_order_acq_rel); #elif defined ZMQ_ATOMIC_COUNTER_ATOMIC_H integer_t new_value = atomic_add_32_nv (&value, increment_); old_value = new_value - increment_; #elif defined ZMQ_ATOMIC_COUNTER_TILE old_value = arch_atomic_add (&value, increment_); #elif defined ZMQ_ATOMIC_COUNTER_X86 __asm__ volatile("lock; xadd %0, %1 \n\t" : "=r"(old_value), "=m"(value) : "0"(increment_), "m"(value) : "cc", "memory"); #elif defined ZMQ_ATOMIC_COUNTER_ARM integer_t flag, tmp; __asm__ volatile(" dmb sy\n\t" "1: ldrex %0, [%5]\n\t" " add %2, %0, %4\n\t" " strex %1, %2, [%5]\n\t" " teq %1, #0\n\t" " bne 1b\n\t" " dmb sy\n\t" : "=&r"(old_value), "=&r"(flag), "=&r"(tmp), "+Qo"(value) : "Ir"(increment_), "r"(&value) : "cc"); #elif defined ZMQ_ATOMIC_COUNTER_MUTEX sync.lock (); old_value = value; value += increment_; sync.unlock (); #else #error atomic_counter is not implemented for this platform #endif return old_value; } // Atomic subtraction. Returns false if the counter drops to zero. inline bool sub (integer_t decrement) { #if defined ZMQ_ATOMIC_COUNTER_WINDOWS LONG delta = -((LONG) decrement); integer_t old = InterlockedExchangeAdd ((LONG *) &value, delta); return old - decrement != 0; #elif defined ZMQ_ATOMIC_COUNTER_INTRINSIC integer_t nv = __atomic_sub_fetch (&value, decrement, __ATOMIC_ACQ_REL); return nv != 0; #elif defined ZMQ_ATOMIC_COUNTER_CXX11 integer_t old = value.fetch_sub (decrement, std::memory_order_acq_rel); return old - decrement != 0; #elif defined ZMQ_ATOMIC_COUNTER_ATOMIC_H int32_t delta = -((int32_t) decrement); integer_t nv = atomic_add_32_nv (&value, delta); return nv != 0; #elif defined ZMQ_ATOMIC_COUNTER_TILE int32_t delta = -((int32_t) decrement); integer_t nv = arch_atomic_add (&value, delta); return nv != 0; #elif defined ZMQ_ATOMIC_COUNTER_X86 integer_t oldval = -decrement; volatile integer_t *val = &value; __asm__ volatile("lock; xaddl %0,%1" : "=r"(oldval), "=m"(*val) : "0"(oldval), "m"(*val) : "cc", "memory"); return oldval != decrement; #elif defined ZMQ_ATOMIC_COUNTER_ARM integer_t old_value, flag, tmp; __asm__ volatile(" dmb sy\n\t" "1: ldrex %0, [%5]\n\t" " sub %2, %0, %4\n\t" " strex %1, %2, [%5]\n\t" " teq %1, #0\n\t" " bne 1b\n\t" " dmb sy\n\t" : "=&r"(old_value), "=&r"(flag), "=&r"(tmp), "+Qo"(value) : "Ir"(decrement), "r"(&value) : "cc"); return old_value - decrement != 0; #elif defined ZMQ_ATOMIC_COUNTER_MUTEX sync.lock (); value -= decrement; bool result = value ? true : false; sync.unlock (); return result; #else #error atomic_counter is not implemented for this platform #endif } inline integer_t get () const { return value; } private: #if defined ZMQ_ATOMIC_COUNTER_CXX11 std::atomic value; #else volatile integer_t value; #endif #if defined ZMQ_ATOMIC_COUNTER_MUTEX mutex_t sync; #endif #if !defined ZMQ_ATOMIC_COUNTER_CXX11 atomic_counter_t (const atomic_counter_t &); const atomic_counter_t &operator= (const atomic_counter_t &); #endif #if defined(__GNUC__) || defined(__INTEL_COMPILER) \ || (defined(__SUNPRO_C) && __SUNPRO_C >= 0x590) \ || (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x590) } __attribute__ ((aligned (sizeof (void *)))); #else }; #endif } // Remove macros local to this file. #undef ZMQ_ATOMIC_COUNTER_MUTEX #undef ZMQ_ATOMIC_COUNTER_INTRINSIC #undef ZMQ_ATOMIC_COUNTER_CXX11 #undef ZMQ_ATOMIC_COUNTER_X86 #undef ZMQ_ATOMIC_COUNTER_ARM #undef ZMQ_ATOMIC_COUNTER_WINDOWS #undef ZMQ_ATOMIC_COUNTER_ATOMIC_H #undef ZMQ_ATOMIC_COUNTER_TILE #endif zeromq-4.2.5/src/ipc_address.hpp0000664000372000037200000000431213255253220017520 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_IPC_ADDRESS_HPP_INCLUDED__ #define __ZMQ_IPC_ADDRESS_HPP_INCLUDED__ #include #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include #include namespace zmq { class ipc_address_t { public: ipc_address_t (); ipc_address_t (const sockaddr *sa, socklen_t sa_len); ~ipc_address_t (); // This function sets up the address for UNIX domain transport. int resolve (const char *path_); // The opposite to resolve() int to_string (std::string &addr_); const sockaddr *addr () const; socklen_t addrlen () const; private: struct sockaddr_un address; ipc_address_t (const ipc_address_t &); const ipc_address_t &operator= (const ipc_address_t &); }; } #endif #endif zeromq-4.2.5/src/err.hpp0000664000372000037200000002115713255253220016036 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ERR_HPP_INCLUDED__ #define __ZMQ_ERR_HPP_INCLUDED__ #include #if defined _WIN32_WCE #include "..\builds\msvc\errno.hpp" #else #include #endif #include #include #include #ifndef ZMQ_HAVE_WINDOWS #include #endif #include "likely.hpp" // 0MQ-specific error codes are defined in zmq.h // EPROTO is not used by OpenBSD and maybe other platforms. #ifndef EPROTO #define EPROTO 0 #endif namespace zmq { const char *errno_to_string (int errno_); void zmq_abort (const char *errmsg_); void print_backtrace (void); } #ifdef ZMQ_HAVE_WINDOWS namespace zmq { const char *wsa_error (); const char * wsa_error_no (int no_, const char *wsae_wouldblock_string = "Operation would block"); void win_error (char *buffer_, size_t buffer_size_); int wsa_error_to_errno (int errcode); } // Provides convenient way to check WSA-style errors on Windows. #define wsa_assert(x) \ do { \ if (unlikely (!(x))) { \ const char *errstr = zmq::wsa_error (); \ if (errstr != NULL) { \ fprintf (stderr, "Assertion failed: %s [%i] (%s:%d)\n", \ errstr, WSAGetLastError (), __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } \ } while (false) // Provides convenient way to assert on WSA-style errors on Windows. #define wsa_assert_no(no) \ do { \ const char *errstr = zmq::wsa_error_no (no); \ if (errstr != NULL) { \ fprintf (stderr, "Assertion failed: %s (%s:%d)\n", errstr, \ __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } while (false) // Provides convenient way to check GetLastError-style errors on Windows. #define win_assert(x) \ do { \ if (unlikely (!(x))) { \ char errstr[256]; \ zmq::win_error (errstr, 256); \ fprintf (stderr, "Assertion failed: %s (%s:%d)\n", errstr, \ __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } while (false) #endif // This macro works in exactly the same way as the normal assert. It is used // in its stead because standard assert on Win32 in broken - it prints nothing // when used within the scope of JNI library. #define zmq_assert(x) \ do { \ if (unlikely (!(x))) { \ fprintf (stderr, "Assertion failed: %s (%s:%d)\n", #x, __FILE__, \ __LINE__); \ fflush (stderr); \ zmq::zmq_abort (#x); \ } \ } while (false) // Provides convenient way to check for errno-style errors. #define errno_assert(x) \ do { \ if (unlikely (!(x))) { \ const char *errstr = strerror (errno); \ fprintf (stderr, "%s (%s:%d)\n", errstr, __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } while (false) // Provides convenient way to check for POSIX errors. #define posix_assert(x) \ do { \ if (unlikely (x)) { \ const char *errstr = strerror (x); \ fprintf (stderr, "%s (%s:%d)\n", errstr, __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } while (false) // Provides convenient way to check for errors from getaddrinfo. #define gai_assert(x) \ do { \ if (unlikely (x)) { \ const char *errstr = gai_strerror (x); \ fprintf (stderr, "%s (%s:%d)\n", errstr, __FILE__, __LINE__); \ fflush (stderr); \ zmq::zmq_abort (errstr); \ } \ } while (false) // Provides convenient way to check whether memory allocation have succeeded. #define alloc_assert(x) \ do { \ if (unlikely (!x)) { \ fprintf (stderr, "FATAL ERROR: OUT OF MEMORY (%s:%d)\n", __FILE__, \ __LINE__); \ fflush (stderr); \ zmq::zmq_abort ("FATAL ERROR: OUT OF MEMORY"); \ } \ } while (false) #endif zeromq-4.2.5/src/msg.hpp0000664000372000037200000002060513255253220016031 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MSG_HPP_INCLUDE__ #define __ZMQ_MSG_HPP_INCLUDE__ #include #include #include "config.hpp" #include "err.hpp" #include "fd.hpp" #include "atomic_counter.hpp" #include "metadata.hpp" // Signature for free function to deallocate the message content. // Note that it has to be declared as "C" so that it is the same as // zmq_free_fn defined in zmq.h. extern "C" { typedef void(msg_free_fn) (void *data, void *hint); } namespace zmq { // Note that this structure needs to be explicitly constructed // (init functions) and destructed (close function). class msg_t { public: // Shared message buffer. Message data are either allocated in one // continuous block along with this structure - thus avoiding one // malloc/free pair or they are stored in user-supplied memory. // In the latter case, ffn member stores pointer to the function to be // used to deallocate the data. If the buffer is actually shared (there // are at least 2 references to it) refcount member contains number of // references. struct content_t { void *data; size_t size; msg_free_fn *ffn; void *hint; zmq::atomic_counter_t refcnt; }; // Message flags. enum { more = 1, // Followed by more parts command = 2, // Command frame (see ZMTP spec) credential = 32, routing_id = 64, shared = 128 }; bool check () const; int init (); int init (void *data, size_t size_, msg_free_fn *ffn_, void *hint, content_t *content_ = NULL); int init_size (size_t size_); int init_data (void *data_, size_t size_, msg_free_fn *ffn_, void *hint_); int init_external_storage (content_t *content_, void *data_, size_t size_, msg_free_fn *ffn_, void *hint_); int init_delimiter (); int init_join (); int init_leave (); int close (); int move (msg_t &src_); int copy (msg_t &src_); void *data (); size_t size () const; unsigned char flags () const; void set_flags (unsigned char flags_); void reset_flags (unsigned char flags_); metadata_t *metadata () const; void set_metadata (metadata_t *metadata_); void reset_metadata (); bool is_routing_id () const; bool is_credential () const; bool is_delimiter () const; bool is_join () const; bool is_leave () const; bool is_vsm () const; bool is_cmsg () const; bool is_zcmsg () const; uint32_t get_routing_id (); int set_routing_id (uint32_t routing_id_); int reset_routing_id (); const char *group (); int set_group (const char *group_); int set_group (const char *, size_t length); // After calling this function you can copy the message in POD-style // refs_ times. No need to call copy. void add_refs (int refs_); // Removes references previously added by add_refs. If the number of // references drops to 0, the message is closed and false is returned. bool rm_refs (int refs_); // Size in bytes of the largest message that is still copied around // rather than being reference-counted. enum { msg_t_size = 64 }; enum { max_vsm_size = msg_t_size - (sizeof (metadata_t *) + 3 + 16 + sizeof (uint32_t)) }; private: zmq::atomic_counter_t *refcnt (); // Different message types. enum type_t { type_min = 101, // VSM messages store the content in the message itself type_vsm = 101, // LMSG messages store the content in malloc-ed memory type_lmsg = 102, // Delimiter messages are used in envelopes type_delimiter = 103, // CMSG messages point to constant data type_cmsg = 104, // zero-copy LMSG message for v2_decoder type_zclmsg = 105, // Join message for radio_dish type_join = 106, // Leave message for radio_dish type_leave = 107, type_max = 107 }; // Note that fields shared between different message types are not // moved to the parent class (msg_t). This way we get tighter packing // of the data. Shared fields can be accessed via 'base' member of // the union. union { struct { metadata_t *metadata; unsigned char unused[msg_t_size - (sizeof (metadata_t *) + 2 + 16 + sizeof (uint32_t))]; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } base; struct { metadata_t *metadata; unsigned char data[max_vsm_size]; unsigned char size; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } vsm; struct { metadata_t *metadata; content_t *content; unsigned char unused[msg_t_size - (sizeof (metadata_t *) + sizeof (content_t *) + 2 + 16 + sizeof (uint32_t))]; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } lmsg; struct { metadata_t *metadata; content_t *content; unsigned char unused[msg_t_size - (sizeof (metadata_t *) + sizeof (content_t *) + 2 + 16 + sizeof (uint32_t))]; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } zclmsg; struct { metadata_t *metadata; void *data; size_t size; unsigned char unused[msg_t_size - (sizeof (metadata_t *) + sizeof (void *) + sizeof (size_t) + 2 + 16 + sizeof (uint32_t))]; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } cmsg; struct { metadata_t *metadata; unsigned char unused[msg_t_size - (sizeof (metadata_t *) + 2 + 16 + sizeof (uint32_t))]; unsigned char type; unsigned char flags; char group[16]; uint32_t routing_id; } delimiter; } u; }; inline int close_and_return (zmq::msg_t *msg, int echo) { // Since we abort on close failure we preserve errno for success case. int err = errno; const int rc = msg->close (); errno_assert (rc == 0); errno = err; return echo; } inline int close_and_return (zmq::msg_t msg[], int count, int echo) { for (int i = 0; i < count; i++) close_and_return (&msg[i], 0); return echo; } } #endif zeromq-4.2.5/src/macros.hpp0000664000372000037200000000127513255253220016531 0ustar00travistravis00000000000000 /******************************************************************************/ /* 0MQ Internal Use */ /******************************************************************************/ #define LIBZMQ_UNUSED(object) (void) object #define LIBZMQ_DELETE(p_object) \ { \ delete p_object; \ p_object = 0; \ } /******************************************************************************/ zeromq-4.2.5/src/dist.cpp0000664000372000037200000001454013255253220016202 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "dist.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" #include "likely.hpp" zmq::dist_t::dist_t () : matching (0), active (0), eligible (0), more (false) { } zmq::dist_t::~dist_t () { zmq_assert (pipes.empty ()); } void zmq::dist_t::attach (pipe_t *pipe_) { // If we are in the middle of sending a message, we'll add new pipe // into the list of eligible pipes. Otherwise we add it to the list // of active pipes. if (more) { pipes.push_back (pipe_); pipes.swap (eligible, pipes.size () - 1); eligible++; } else { pipes.push_back (pipe_); pipes.swap (active, pipes.size () - 1); active++; eligible++; } } void zmq::dist_t::match (pipe_t *pipe_) { // If pipe is already matching do nothing. if (pipes.index (pipe_) < matching) return; // If the pipe isn't eligible, ignore it. if (pipes.index (pipe_) >= eligible) return; // Mark the pipe as matching. pipes.swap (pipes.index (pipe_), matching); matching++; } void zmq::dist_t::reverse_match () { pipes_t::size_type prev_matching = matching; // Reset matching to 0 unmatch (); // Mark all matching pipes as not matching and vice-versa. // To do this, push all pipes that are eligible but not // matched - i.e. between "matching" and "eligible" - // to the beginning of the queue. for (pipes_t::size_type i = prev_matching; i < eligible; ++i) { pipes.swap (i, matching++); } } void zmq::dist_t::unmatch () { matching = 0; } void zmq::dist_t::pipe_terminated (pipe_t *pipe_) { // Remove the pipe from the list; adjust number of matching, active and/or // eligible pipes accordingly. if (pipes.index (pipe_) < matching) { pipes.swap (pipes.index (pipe_), matching - 1); matching--; } if (pipes.index (pipe_) < active) { pipes.swap (pipes.index (pipe_), active - 1); active--; } if (pipes.index (pipe_) < eligible) { pipes.swap (pipes.index (pipe_), eligible - 1); eligible--; } pipes.erase (pipe_); } void zmq::dist_t::activated (pipe_t *pipe_) { // Move the pipe from passive to eligible state. if (eligible < pipes.size ()) { pipes.swap (pipes.index (pipe_), eligible); eligible++; } // If there's no message being sent at the moment, move it to // the active state. if (!more && active < pipes.size ()) { pipes.swap (eligible - 1, active); active++; } } int zmq::dist_t::send_to_all (msg_t *msg_) { matching = active; return send_to_matching (msg_); } int zmq::dist_t::send_to_matching (msg_t *msg_) { // Is this end of a multipart message? bool msg_more = msg_->flags () & msg_t::more ? true : false; // Push the message to matching pipes. distribute (msg_); // If multipart message is fully sent, activate all the eligible pipes. if (!msg_more) active = eligible; more = msg_more; return 0; } void zmq::dist_t::distribute (msg_t *msg_) { // If there are no matching pipes available, simply drop the message. if (matching == 0) { int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return; } if (msg_->is_vsm ()) { for (pipes_t::size_type i = 0; i < matching; ++i) if (!write (pipes[i], msg_)) --i; // Retry last write because index will have been swapped int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return; } // Add matching-1 references to the message. We already hold one reference, // that's why -1. msg_->add_refs ((int) matching - 1); // Push copy of the message to each matching pipe. int failed = 0; for (pipes_t::size_type i = 0; i < matching; ++i) if (!write (pipes[i], msg_)) { ++failed; --i; // Retry last write because index will have been swapped } if (unlikely (failed)) msg_->rm_refs (failed); // Detach the original message from the data buffer. Note that we don't // close the message. That's because we've already used all the references. int rc = msg_->init (); errno_assert (rc == 0); } bool zmq::dist_t::has_out () { return true; } bool zmq::dist_t::write (pipe_t *pipe_, msg_t *msg_) { if (!pipe_->write (msg_)) { pipes.swap (pipes.index (pipe_), matching - 1); matching--; pipes.swap (pipes.index (pipe_), active - 1); active--; pipes.swap (active, eligible - 1); eligible--; return false; } if (!(msg_->flags () & msg_t::more)) pipe_->flush (); return true; } bool zmq::dist_t::check_hwm () { for (pipes_t::size_type i = 0; i < matching; ++i) if (!pipes[i]->check_hwm ()) return false; return true; } zeromq-4.2.5/src/v2_encoder.cpp0000664000372000037200000000562413255253220017270 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "v2_protocol.hpp" #include "v2_encoder.hpp" #include "likely.hpp" #include "wire.hpp" zmq::v2_encoder_t::v2_encoder_t (size_t bufsize_) : encoder_base_t (bufsize_) { // Write 0 bytes to the batch and go to message_ready state. next_step (NULL, 0, &v2_encoder_t::message_ready, true); } zmq::v2_encoder_t::~v2_encoder_t () { } void zmq::v2_encoder_t::message_ready () { // Encode flags. unsigned char &protocol_flags = tmpbuf[0]; protocol_flags = 0; if (in_progress->flags () & msg_t::more) protocol_flags |= v2_protocol_t::more_flag; if (in_progress->size () > 255) protocol_flags |= v2_protocol_t::large_flag; if (in_progress->flags () & msg_t::command) protocol_flags |= v2_protocol_t::command_flag; // Encode the message length. For messages less then 256 bytes, // the length is encoded as 8-bit unsigned integer. For larger // messages, 64-bit unsigned integer in network byte order is used. const size_t size = in_progress->size (); if (unlikely (size > 255)) { put_uint64 (tmpbuf + 1, size); next_step (tmpbuf, 9, &v2_encoder_t::size_ready, false); } else { tmpbuf[1] = static_cast (size); next_step (tmpbuf, 2, &v2_encoder_t::size_ready, false); } } void zmq::v2_encoder_t::size_ready () { // Write message body into the buffer. next_step (in_progress->data (), in_progress->size (), &v2_encoder_t::message_ready, true); } zeromq-4.2.5/src/likely.hpp0000664000372000037200000000321013255253220016525 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_LIKELY_HPP_INCLUDED__ #define __ZMQ_LIKELY_HPP_INCLUDED__ #if defined __GNUC__ #define likely(x) __builtin_expect ((x), 1) #define unlikely(x) __builtin_expect ((x), 0) #else #define likely(x) (x) #define unlikely(x) (x) #endif #endif zeromq-4.2.5/src/udp_address.cpp0000664000372000037200000001100413255253220017524 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "macros.hpp" #include "udp_address.hpp" #include "stdint.hpp" #include "err.hpp" #include "ip.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #include #include #include #endif zmq::udp_address_t::udp_address_t () : is_multicast (false) { memset (&bind_address, 0, sizeof bind_address); memset (&dest_address, 0, sizeof dest_address); } zmq::udp_address_t::~udp_address_t () { } int zmq::udp_address_t::resolve (const char *name_, bool bind_) { // Find the ':' at end that separates address from the port number. const char *delimiter = strrchr (name_, ':'); if (!delimiter) { errno = EINVAL; return -1; } // Separate the address/port. std::string addr_str (name_, delimiter - name_); std::string port_str (delimiter + 1); // Parse the port number (0 is not a valid port). uint16_t port = (uint16_t) atoi (port_str.c_str ()); if (port == 0) { errno = EINVAL; return -1; } dest_address.sin_family = AF_INET; dest_address.sin_port = htons (port); // Only when the udp should bind we allow * as the address if (addr_str == "*" && bind_) dest_address.sin_addr.s_addr = htonl (INADDR_ANY); else dest_address.sin_addr.s_addr = inet_addr (addr_str.c_str ()); if (dest_address.sin_addr.s_addr == INADDR_NONE) { errno = EINVAL; return -1; } // we will check only first byte of IP // and if it from 224 to 239, then it can // represent multicast IP. int i = dest_address.sin_addr.s_addr & 0xFF; if (i >= 224 && i <= 239) { multicast = dest_address.sin_addr; is_multicast = true; } else is_multicast = false; iface.s_addr = htonl (INADDR_ANY); if (iface.s_addr == INADDR_NONE) { errno = EINVAL; return -1; } // If a should bind and not a multicast, the dest address // is actually the bind address if (bind_ && !is_multicast) bind_address = dest_address; else { bind_address.sin_family = AF_INET; bind_address.sin_port = htons (port); bind_address.sin_addr.s_addr = htonl (INADDR_ANY); } address = name_; return 0; } int zmq::udp_address_t::to_string (std::string &addr_) { addr_ = address; return 0; } bool zmq::udp_address_t::is_mcast () const { return is_multicast; } const sockaddr *zmq::udp_address_t::bind_addr () const { return (sockaddr *) &bind_address; } socklen_t zmq::udp_address_t::bind_addrlen () const { return sizeof (sockaddr_in); } const sockaddr *zmq::udp_address_t::dest_addr () const { return (sockaddr *) &dest_address; } socklen_t zmq::udp_address_t::dest_addrlen () const { return sizeof (sockaddr_in); } const in_addr zmq::udp_address_t::multicast_ip () const { return multicast; } const in_addr zmq::udp_address_t::interface_ip () const { return iface; } #if defined ZMQ_HAVE_WINDOWS unsigned short zmq::udp_address_t::family () const #else sa_family_t zmq::udp_address_t::family () const #endif { return AF_INET; } zeromq-4.2.5/src/mutex.hpp0000664000372000037200000001161513255253220016406 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MUTEX_HPP_INCLUDED__ #define __ZMQ_MUTEX_HPP_INCLUDED__ #include "err.hpp" // Mutex class encapsulates OS mutex in a platform-independent way. #ifdef ZMQ_HAVE_WINDOWS #include "windows.hpp" namespace zmq { class mutex_t { public: inline mutex_t () { InitializeCriticalSection (&cs); } inline ~mutex_t () { DeleteCriticalSection (&cs); } inline void lock () { EnterCriticalSection (&cs); } inline bool try_lock () { return (TryEnterCriticalSection (&cs)) ? true : false; } inline void unlock () { LeaveCriticalSection (&cs); } inline CRITICAL_SECTION *get_cs () { return &cs; } private: CRITICAL_SECTION cs; // Disable copy construction and assignment. mutex_t (const mutex_t &); void operator= (const mutex_t &); }; } #elif defined ZMQ_HAVE_VXWORKS #include #include namespace zmq { class mutex_t { public: inline mutex_t () { m_semId = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE); } inline ~mutex_t () { semDelete (m_semId); } inline void lock () { semTake (m_semId, WAIT_FOREVER); } inline bool try_lock () { if (semTake (m_semId, NO_WAIT) == OK) { return true; } return false; } inline void unlock () { semGive (m_semId); } private: SEM_ID m_semId; // Disable copy construction and assignment. mutex_t (const mutex_t &); const mutex_t &operator= (const mutex_t &); }; } #else #include namespace zmq { class mutex_t { public: inline mutex_t () { int rc = pthread_mutexattr_init (&attr); posix_assert (rc); rc = pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); posix_assert (rc); rc = pthread_mutex_init (&mutex, &attr); posix_assert (rc); } inline ~mutex_t () { int rc = pthread_mutex_destroy (&mutex); posix_assert (rc); rc = pthread_mutexattr_destroy (&attr); posix_assert (rc); } inline void lock () { int rc = pthread_mutex_lock (&mutex); posix_assert (rc); } inline bool try_lock () { int rc = pthread_mutex_trylock (&mutex); if (rc == EBUSY) return false; posix_assert (rc); return true; } inline void unlock () { int rc = pthread_mutex_unlock (&mutex); posix_assert (rc); } inline pthread_mutex_t *get_mutex () { return &mutex; } private: pthread_mutex_t mutex; pthread_mutexattr_t attr; // Disable copy construction and assignment. mutex_t (const mutex_t &); const mutex_t &operator= (const mutex_t &); }; } #endif namespace zmq { struct scoped_lock_t { scoped_lock_t (mutex_t &mutex_) : mutex (mutex_) { mutex.lock (); } ~scoped_lock_t () { mutex.unlock (); } private: mutex_t &mutex; // Disable copy construction and assignment. scoped_lock_t (const scoped_lock_t &); const scoped_lock_t &operator= (const scoped_lock_t &); }; struct scoped_optional_lock_t { scoped_optional_lock_t (mutex_t *mutex_) : mutex (mutex_) { if (mutex != NULL) mutex->lock (); } ~scoped_optional_lock_t () { if (mutex != NULL) mutex->unlock (); } private: mutex_t *mutex; // Disable copy construction and assignment. scoped_optional_lock_t (const scoped_lock_t &); const scoped_optional_lock_t &operator= (const scoped_lock_t &); }; } #endif zeromq-4.2.5/src/tipc_listener.hpp0000664000372000037200000000601413255253220020105 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TIPC_LISTENER_HPP_INCLUDED__ #define __ZMQ_TIPC_LISTENER_HPP_INCLUDED__ #include "platform.hpp" #if defined ZMQ_HAVE_TIPC #include #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" #include "tipc_address.hpp" namespace zmq { class io_thread_t; class socket_base_t; class tipc_listener_t : public own_t, public io_object_t { public: tipc_listener_t (zmq::io_thread_t *io_thread_, zmq::socket_base_t *socket_, const options_t &options_); ~tipc_listener_t (); // Set address to listen on. int set_address (const char *addr_); // Get the bound address for use with wildcards int get_address (std::string &addr_); private: // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); // Close the listening socket. void close (); // Accept the new connection. Returns the file descriptor of the // newly created connection. The function may return retired_fd // if the connection was dropped while waiting in the listen backlog. fd_t accept (); // Address to listen on tipc_address_t address; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // Socket the listener belongs to. zmq::socket_base_t *socket; // String representation of endpoint to bind to std::string endpoint; tipc_listener_t (const tipc_listener_t &); const tipc_listener_t &operator= (const tipc_listener_t &); }; } #endif #endif zeromq-4.2.5/src/socks_connecter.cpp0000664000372000037200000003511713255253220020424 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "macros.hpp" #include "socks_connecter.hpp" #include "stream_engine.hpp" #include "random.hpp" #include "err.hpp" #include "ip.hpp" #include "tcp.hpp" #include "address.hpp" #include "tcp_address.hpp" #include "session_base.hpp" #include "socks.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #include #include #if defined ZMQ_HAVE_VXWORKS #include #endif #endif zmq::socks_connecter_t::socks_connecter_t (class io_thread_t *io_thread_, class session_base_t *session_, const options_t &options_, address_t *addr_, address_t *proxy_addr_, bool delayed_start_) : own_t (io_thread_, options_), io_object_t (io_thread_), addr (addr_), proxy_addr (proxy_addr_), status (unplugged), s (retired_fd), handle ((handle_t) NULL), handle_valid (false), delayed_start (delayed_start_), timer_started (false), session (session_), current_reconnect_ivl (options.reconnect_ivl) { zmq_assert (addr); zmq_assert (addr->protocol == "tcp"); proxy_addr->to_string (endpoint); socket = session->get_socket (); } zmq::socks_connecter_t::~socks_connecter_t () { zmq_assert (s == retired_fd); LIBZMQ_DELETE (proxy_addr); } void zmq::socks_connecter_t::process_plug () { if (delayed_start) start_timer (); else initiate_connect (); } void zmq::socks_connecter_t::process_term (int linger_) { switch (status) { case unplugged: break; case waiting_for_reconnect_time: cancel_timer (reconnect_timer_id); break; case waiting_for_proxy_connection: case sending_greeting: case waiting_for_choice: case sending_request: case waiting_for_response: rm_fd (handle); if (s != retired_fd) close (); break; } own_t::process_term (linger_); } void zmq::socks_connecter_t::in_event () { zmq_assert (status != unplugged && status != waiting_for_reconnect_time); if (status == waiting_for_choice) { int rc = choice_decoder.input (s); if (rc == 0 || rc == -1) error (); else if (choice_decoder.message_ready ()) { const socks_choice_t choice = choice_decoder.decode (); rc = process_server_response (choice); if (rc == -1) error (); else { std::string hostname = ""; uint16_t port = 0; if (parse_address (addr->address, hostname, port) == -1) error (); else { request_encoder.encode ( socks_request_t (1, hostname, port)); reset_pollin (handle); set_pollout (handle); status = sending_request; } } } } else if (status == waiting_for_response) { int rc = response_decoder.input (s); if (rc == 0 || rc == -1) error (); else if (response_decoder.message_ready ()) { const socks_response_t response = response_decoder.decode (); rc = process_server_response (response); if (rc == -1) error (); else { // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (s, options, endpoint); alloc_assert (engine); // Attach the engine to the corresponding session object. send_attach (session, engine); socket->event_connected (endpoint, s); rm_fd (handle); s = -1; status = unplugged; // Shut the connecter down. terminate (); } } } else error (); } void zmq::socks_connecter_t::out_event () { zmq_assert (status == waiting_for_proxy_connection || status == sending_greeting || status == sending_request); if (status == waiting_for_proxy_connection) { const int rc = (int) check_proxy_connection (); if (rc == -1) error (); else { greeting_encoder.encode (socks_greeting_t (socks_no_auth_required)); status = sending_greeting; } } else if (status == sending_greeting) { zmq_assert (greeting_encoder.has_pending_data ()); const int rc = greeting_encoder.output (s); if (rc == -1 || rc == 0) error (); else if (!greeting_encoder.has_pending_data ()) { reset_pollout (handle); set_pollin (handle); status = waiting_for_choice; } } else { zmq_assert (request_encoder.has_pending_data ()); const int rc = request_encoder.output (s); if (rc == -1 || rc == 0) error (); else if (!request_encoder.has_pending_data ()) { reset_pollout (handle); set_pollin (handle); status = waiting_for_response; } } } void zmq::socks_connecter_t::initiate_connect () { // Open the connecting socket. const int rc = connect_to_proxy (); // Connect may succeed in synchronous manner. if (rc == 0) { handle = add_fd (s); set_pollout (handle); status = sending_greeting; } // Connection establishment may be delayed. Poll for its completion. else if (errno == EINPROGRESS) { handle = add_fd (s); set_pollout (handle); status = waiting_for_proxy_connection; socket->event_connect_delayed (endpoint, zmq_errno ()); } // Handle any other error condition by eventual reconnect. else { if (s != retired_fd) close (); start_timer (); } } int zmq::socks_connecter_t::process_server_response ( const socks_choice_t &response) { // We do not support any authentication method for now. return response.method == 0 ? 0 : -1; } int zmq::socks_connecter_t::process_server_response ( const socks_response_t &response) { return response.response_code == 0 ? 0 : -1; } void zmq::socks_connecter_t::timer_event (int id_) { zmq_assert (status == waiting_for_reconnect_time); zmq_assert (id_ == reconnect_timer_id); initiate_connect (); } void zmq::socks_connecter_t::error () { rm_fd (handle); close (); greeting_encoder.reset (); choice_decoder.reset (); request_encoder.reset (); response_decoder.reset (); start_timer (); } void zmq::socks_connecter_t::start_timer () { const int interval = get_new_reconnect_ivl (); add_timer (interval, reconnect_timer_id); status = waiting_for_reconnect_time; socket->event_connect_retried (endpoint, interval); } int zmq::socks_connecter_t::get_new_reconnect_ivl () { // The new interval is the current interval + random value. const int interval = current_reconnect_ivl + generate_random () % options.reconnect_ivl; // Only change the current reconnect interval if the maximum reconnect // interval was set and if it's larger than the reconnect interval. if (options.reconnect_ivl_max > 0 && options.reconnect_ivl_max > options.reconnect_ivl) // Calculate the next interval current_reconnect_ivl = std::min (current_reconnect_ivl * 2, options.reconnect_ivl_max); return interval; } int zmq::socks_connecter_t::connect_to_proxy () { zmq_assert (s == retired_fd); // Resolve the address LIBZMQ_DELETE (proxy_addr->resolved.tcp_addr); proxy_addr->resolved.tcp_addr = new (std::nothrow) tcp_address_t (); alloc_assert (proxy_addr->resolved.tcp_addr); int rc = proxy_addr->resolved.tcp_addr->resolve ( proxy_addr->address.c_str (), false, options.ipv6); if (rc != 0) { LIBZMQ_DELETE (proxy_addr->resolved.tcp_addr); return -1; } zmq_assert (proxy_addr->resolved.tcp_addr != NULL); const tcp_address_t *tcp_addr = proxy_addr->resolved.tcp_addr; // Create the socket. s = open_socket (tcp_addr->family (), SOCK_STREAM, IPPROTO_TCP); #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) return -1; #else if (s == -1) return -1; #endif // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. // Switch it on in such cases. if (tcp_addr->family () == AF_INET6) enable_ipv4_mapping (s); // Set the IP Type-Of-Service priority for this socket if (options.tos != 0) set_ip_type_of_service (s, options.tos); // Bind the socket to a device if applicable if (!options.bound_device.empty ()) bind_to_device (s, options.bound_device); // Set the socket to non-blocking mode so that we get async connect(). unblock_socket (s); // Set the socket buffer limits for the underlying socket. if (options.sndbuf >= 0) set_tcp_send_buffer (s, options.sndbuf); if (options.rcvbuf >= 0) set_tcp_receive_buffer (s, options.rcvbuf); // Set the IP Type-Of-Service for the underlying socket if (options.tos != 0) set_ip_type_of_service (s, options.tos); // Set a source address for conversations if (tcp_addr->has_src_addr ()) { #if defined ZMQ_HAVE_VXWORKS rc = ::bind (s, (sockaddr *) tcp_addr->src_addr (), tcp_addr->src_addrlen ()); #else rc = ::bind (s, tcp_addr->src_addr (), tcp_addr->src_addrlen ()); #endif if (rc == -1) { close (); return -1; } } // Connect to the remote peer. #if defined ZMQ_HAVE_VXWORKS rc = ::connect (s, (sockaddr *) tcp_addr->addr (), tcp_addr->addrlen ()); #else rc = ::connect (s, tcp_addr->addr (), tcp_addr->addrlen ()); #endif // Connect was successful immediately. if (rc == 0) return 0; // Translate error codes indicating asynchronous connect has been // launched to a uniform EINPROGRESS. #ifdef ZMQ_HAVE_WINDOWS const int last_error = WSAGetLastError (); if (last_error == WSAEINPROGRESS || last_error == WSAEWOULDBLOCK) errno = EINPROGRESS; else { errno = wsa_error_to_errno (last_error); close (); } #else if (errno == EINTR) errno = EINPROGRESS; #endif return -1; } zmq::fd_t zmq::socks_connecter_t::check_proxy_connection () { // Async connect has finished. Check whether an error occurred int err = 0; #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_VXWORKS int len = sizeof err; #else socklen_t len = sizeof err; #endif int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &err, &len); // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. #ifdef ZMQ_HAVE_WINDOWS zmq_assert (rc == 0); if (err != 0) { wsa_assert (err == WSAECONNREFUSED || err == WSAETIMEDOUT || err == WSAECONNABORTED || err == WSAEHOSTUNREACH || err == WSAENETUNREACH || err == WSAENETDOWN || err == WSAEACCES || err == WSAEINVAL || err == WSAEADDRINUSE); return -1; } #else // Following code should handle both Berkeley-derived socket // implementations and Solaris. if (rc == -1) err = errno; if (err != 0) { errno = err; errno_assert (errno == ECONNREFUSED || errno == ECONNRESET || errno == ETIMEDOUT || errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN || errno == EINVAL); return -1; } #endif rc = tune_tcp_socket (s); rc = rc | tune_tcp_keepalives ( s, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl); if (rc != 0) return -1; return 0; } void zmq::socks_connecter_t::close () { zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_WINDOWS const int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else const int rc = ::close (s); errno_assert (rc == 0); #endif socket->event_closed (endpoint, s); s = retired_fd; } int zmq::socks_connecter_t::parse_address (const std::string &address_, std::string &hostname_, uint16_t &port_) { // Find the ':' at end that separates address from the port number. const size_t idx = address_.rfind (':'); if (idx == std::string::npos) { errno = EINVAL; return -1; } // Extract hostname if (idx < 2 || address_[0] != '[' || address_[idx - 1] != ']') hostname_ = address_.substr (0, idx); else hostname_ = address_.substr (1, idx - 2); // Separate the hostname/port. const std::string port_str = address_.substr (idx + 1); // Parse the port number (0 is not a valid port). port_ = (uint16_t) atoi (port_str.c_str ()); if (port_ == 0) { errno = EINVAL; return -1; } return 0; } zeromq-4.2.5/src/tipc_address.cpp0000664000372000037200000001201613255253220017677 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "tipc_address.hpp" #if defined ZMQ_HAVE_TIPC #include "err.hpp" #include #include zmq::tipc_address_t::tipc_address_t () { memset (&address, 0, sizeof address); _random = false; } zmq::tipc_address_t::tipc_address_t (const sockaddr *sa, socklen_t sa_len) { zmq_assert (sa && sa_len > 0); memset (&address, 0, sizeof address); if (sa->sa_family == AF_TIPC) memcpy (&address, sa, sa_len); _random = false; } zmq::tipc_address_t::~tipc_address_t () { } void zmq::tipc_address_t::set_random () { _random = true; } bool zmq::tipc_address_t::is_random () const { return _random; } bool zmq::tipc_address_t::is_service () const { if (address.addrtype == TIPC_ADDR_ID) return false; return true; } int zmq::tipc_address_t::resolve (const char *name) { unsigned int type = 0; unsigned int lower = 0; unsigned int upper = 0; unsigned int ref = 0; unsigned int z = 1, c = 0, n = 0; char eof; const char *domain; int res; if (strncmp (name, "<*>", 3) == 0) { set_random (); address.family = AF_TIPC; address.addrtype = TIPC_ADDR_ID; address.addr.id.node = 0; address.addr.id.ref = 0; address.scope = 0; return 0; } res = sscanf (name, "{%u,%u,%u}", &type, &lower, &upper); /* Fetch optional domain suffix. */ if ((domain = strchr (name, '@'))) { if (sscanf (domain, "@%u.%u.%u%c", &z, &c, &n, &eof) != 3) return EINVAL; } if (res == 3) { if (type < TIPC_RESERVED_TYPES || upper < lower) return EINVAL; address.family = AF_TIPC; address.addrtype = TIPC_ADDR_NAMESEQ; address.addr.nameseq.type = type; address.addr.nameseq.lower = lower; address.addr.nameseq.upper = upper; address.scope = TIPC_ZONE_SCOPE; return 0; } else if (res == 2 && type > TIPC_RESERVED_TYPES) { address.family = AF_TIPC; address.addrtype = TIPC_ADDR_NAME; address.addr.name.name.type = type; address.addr.name.name.instance = lower; address.addr.name.domain = tipc_addr (z, c, n); address.scope = 0; return 0; } else if (res == 0) { res = sscanf (name, "<%u.%u.%u:%u>", &z, &c, &n, &ref); if (res == 4) { address.family = AF_TIPC; address.addrtype = TIPC_ADDR_ID; address.addr.id.node = tipc_addr (z, c, n); address.addr.id.ref = ref; address.scope = 0; return 0; } } return EINVAL; } int zmq::tipc_address_t::to_string (std::string &addr_) { if (address.family != AF_TIPC) { addr_.clear (); return -1; } std::stringstream s; if (address.addrtype == TIPC_ADDR_NAMESEQ || address.addrtype == TIPC_ADDR_NAME) { s << "tipc://" << "{" << address.addr.nameseq.type; s << ", " << address.addr.nameseq.lower; s << ", " << address.addr.nameseq.upper << "}"; addr_ = s.str (); } else if (address.addrtype == TIPC_ADDR_ID || is_random ()) { s << "tipc://" << "<" << tipc_zone (address.addr.id.node); s << "." << tipc_cluster (address.addr.id.node); s << "." << tipc_node (address.addr.id.node); s << ":" << address.addr.id.ref << ">"; addr_ = s.str (); } else { addr_.clear (); return -1; } return 0; } const sockaddr *zmq::tipc_address_t::addr () const { return (sockaddr *) &address; } socklen_t zmq::tipc_address_t::addrlen () const { return (socklen_t) sizeof address; } #endif zeromq-4.2.5/src/v1_encoder.cpp0000664000372000037200000000533713255253220017270 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "encoder.hpp" #include "v1_encoder.hpp" #include "likely.hpp" #include "wire.hpp" zmq::v1_encoder_t::v1_encoder_t (size_t bufsize_) : encoder_base_t (bufsize_) { // Write 0 bytes to the batch and go to message_ready state. next_step (NULL, 0, &v1_encoder_t::message_ready, true); } zmq::v1_encoder_t::~v1_encoder_t () { } void zmq::v1_encoder_t::size_ready () { // Write message body into the buffer. next_step (in_progress->data (), in_progress->size (), &v1_encoder_t::message_ready, true); } void zmq::v1_encoder_t::message_ready () { // Get the message size. size_t size = in_progress->size (); // Account for the 'flags' byte. size++; // For messages less than 255 bytes long, write one byte of message size. // For longer messages write 0xff escape character followed by 8-byte // message size. In both cases 'flags' field follows. if (size < 255) { tmpbuf[0] = (unsigned char) size; tmpbuf[1] = (in_progress->flags () & msg_t::more); next_step (tmpbuf, 2, &v1_encoder_t::size_ready, false); } else { tmpbuf[0] = 0xff; put_uint64 (tmpbuf + 1, size); tmpbuf[9] = (in_progress->flags () & msg_t::more); next_step (tmpbuf, 10, &v1_encoder_t::size_ready, false); } } zeromq-4.2.5/src/vmci_connecter.hpp0000664000372000037200000001022713255253220020240 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_VMCI_CONNECTER_HPP_INCLUDED__ #define __ZMQ_VMCI_CONNECTER_HPP_INCLUDED__ #include "platform.hpp" #if defined ZMQ_HAVE_VMCI #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class session_base_t; struct address_t; class vmci_connecter_t : public own_t, public io_object_t { public: // If 'delayed_start' is true connecter first waits for a while, // then starts connection process. vmci_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_); ~vmci_connecter_t (); private: // ID of the timer used to delay the reconnection. enum { reconnect_timer_id = 1 }; // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); void out_event (); void timer_event (int id_); // Internal function to start the actual connection establishment. void start_connecting (); // Internal function to add a reconnect timer void add_reconnect_timer (); // Internal function to return a reconnect backoff delay. // Will modify the current_reconnect_ivl used for next call // Returns the currently used interval int get_new_reconnect_ivl (); // Open VMCI connecting socket. Returns -1 in case of error, // 0 if connect was successful immediately. Returns -1 with // EAGAIN errno if async connect was launched. int open (); // Close the connecting socket. void close (); // Get the file descriptor of newly created connection. Returns // retired_fd if the connection was unsuccessful. fd_t connect (); // Address to connect to. Owned by session_base_t. const address_t *addr; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // If true file descriptor is registered with the poller and 'handle' // contains valid value. bool handle_valid; // If true, connecter is waiting a while before trying to connect. const bool delayed_start; // True iff a timer has been started. bool timer_started; // Reference to the session we belong to. zmq::session_base_t *session; // Current reconnect ivl, updated for backoff strategy int current_reconnect_ivl; // String representation of endpoint to connect to std::string endpoint; // Socket zmq::socket_base_t *socket; vmci_connecter_t (const vmci_connecter_t &); const vmci_connecter_t &operator= (const vmci_connecter_t &); }; } #endif #endif zeromq-4.2.5/src/fq.cpp0000664000372000037200000001132313255253220015641 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "fq.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::fq_t::fq_t () : active (0), last_in (NULL), current (0), more (false) { } zmq::fq_t::~fq_t () { zmq_assert (pipes.empty ()); } void zmq::fq_t::attach (pipe_t *pipe_) { pipes.push_back (pipe_); pipes.swap (active, pipes.size () - 1); active++; } void zmq::fq_t::pipe_terminated (pipe_t *pipe_) { const pipes_t::size_type index = pipes.index (pipe_); // Remove the pipe from the list; adjust number of active pipes // accordingly. if (index < active) { active--; pipes.swap (index, active); if (current == active) current = 0; } pipes.erase (pipe_); if (last_in == pipe_) { saved_credential.set_deep_copy (last_in->get_credential ()); last_in = NULL; } } void zmq::fq_t::activated (pipe_t *pipe_) { // Move the pipe to the list of active pipes. pipes.swap (pipes.index (pipe_), active); active++; } int zmq::fq_t::recv (msg_t *msg_) { return recvpipe (msg_, NULL); } int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_) { // Deallocate old content of the message. int rc = msg_->close (); errno_assert (rc == 0); // Round-robin over the pipes to get the next message. while (active > 0) { // Try to fetch new message. If we've already read part of the message // subsequent part should be immediately available. bool fetched = pipes[current]->read (msg_); // Note that when message is not fetched, current pipe is deactivated // and replaced by another active pipe. Thus we don't have to increase // the 'current' pointer. if (fetched) { if (pipe_) *pipe_ = pipes[current]; more = msg_->flags () & msg_t::more ? true : false; if (!more) { last_in = pipes[current]; current = (current + 1) % active; } return 0; } // Check the atomicity of the message. // If we've already received the first part of the message // we should get the remaining parts without blocking. zmq_assert (!more); active--; pipes.swap (current, active); if (current == active) current = 0; } // No message is available. Initialise the output parameter // to be a 0-byte message. rc = msg_->init (); errno_assert (rc == 0); errno = EAGAIN; return -1; } bool zmq::fq_t::has_in () { // There are subsequent parts of the partly-read message available. if (more) return true; // Note that messing with current doesn't break the fairness of fair // queueing algorithm. If there are no messages available current will // get back to its original value. Otherwise it'll point to the first // pipe holding messages, skipping only pipes with no messages available. while (active > 0) { if (pipes[current]->check_read ()) return true; // Deactivate the pipe. active--; pipes.swap (current, active); if (current == active) current = 0; } return false; } const zmq::blob_t &zmq::fq_t::get_credential () const { return last_in ? last_in->get_credential () : saved_credential; } zeromq-4.2.5/src/decoder_allocators.hpp0000664000372000037200000001042713255253220021074 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DECODER_ALLOCATORS_HPP_INCLUDED__ #define __ZMQ_DECODER_ALLOCATORS_HPP_INCLUDED__ #include #include #include "atomic_counter.hpp" #include "msg.hpp" #include "err.hpp" namespace zmq { // Static buffer policy. class c_single_allocator { public: explicit c_single_allocator (std::size_t bufsize_) : bufsize (bufsize_), buf (static_cast (std::malloc (bufsize))) { alloc_assert (buf); } ~c_single_allocator () { std::free (buf); } unsigned char *allocate () { return buf; } void deallocate () {} std::size_t size () const { return bufsize; } void resize (std::size_t new_size) { bufsize = new_size; } private: std::size_t bufsize; unsigned char *buf; c_single_allocator (c_single_allocator const &); c_single_allocator &operator= (c_single_allocator const &); }; // This allocator allocates a reference counted buffer which is used by v2_decoder_t // to use zero-copy msg::init_data to create messages with memory from this buffer as // data storage. // // The buffer is allocated with a reference count of 1 to make sure that is is alive while // decoding messages. Otherwise, it is possible that e.g. the first message increases the count // from zero to one, gets passed to the user application, processed in the user thread and deleted // which would then deallocate the buffer. The drawback is that the buffer may be allocated longer // than necessary because it is only deleted when allocate is called the next time. class shared_message_memory_allocator { public: explicit shared_message_memory_allocator (std::size_t bufsize_); // Create an allocator for a maximum number of messages shared_message_memory_allocator (std::size_t bufsize_, std::size_t maxMessages); ~shared_message_memory_allocator (); // Allocate a new buffer // // This releases the current buffer to be bound to the lifetime of the messages // created on this buffer. unsigned char *allocate (); // force deallocation of buffer. void deallocate (); // Give up ownership of the buffer. The buffer's lifetime is now coupled to // the messages constructed on top of it. unsigned char *release (); void inc_ref (); static void call_dec_ref (void *, void *buffer); std::size_t size () const; // Return pointer to the first message data byte. unsigned char *data (); // Return pointer to the first byte of the buffer. unsigned char *buffer () { return buf; } void resize (std::size_t new_size) { bufsize = new_size; } zmq::msg_t::content_t *provide_content () { return msg_content; } void advance_content () { msg_content++; } private: unsigned char *buf; std::size_t bufsize; const std::size_t max_size; zmq::msg_t::content_t *msg_content; std::size_t maxCounters; }; } #endif zeromq-4.2.5/src/udp_engine.hpp0000664000372000037200000000322613255253220017360 0ustar00travistravis00000000000000 #ifndef __ZMQ_UDP_ENGINE_HPP_INCLUDED__ #define __ZMQ_UDP_ENGINE_HPP_INCLUDED__ #include "io_object.hpp" #include "i_engine.hpp" #include "address.hpp" #include "udp_address.hpp" #include "msg.hpp" #define MAX_UDP_MSG 8192 namespace zmq { class io_thread_t; class session_base_t; class udp_engine_t : public io_object_t, public i_engine { public: udp_engine_t (const options_t &options_); ~udp_engine_t (); int init (address_t *address_, bool send_, bool recv_); // i_engine interface implementation. // Plug the engine to the session. void plug (zmq::io_thread_t *io_thread_, class session_base_t *session_); // Terminate and deallocate the engine. Note that 'detached' // events are not fired on termination. void terminate (); // This method is called by the session to signalise that more // messages can be written to the pipe. void restart_input (); // This method is called by the session to signalise that there // are messages to send available. void restart_output (); void zap_msg_available (){}; void in_event (); void out_event (); const char *get_endpoint () const; private: int resolve_raw_address (char *addr_, size_t length_); void sockaddr_to_msg (zmq::msg_t *msg, sockaddr_in *addr); bool plugged; fd_t fd; session_base_t *session; handle_t handle; address_t *address; options_t options; sockaddr_in raw_address; const struct sockaddr *out_address; socklen_t out_addrlen; unsigned char out_buffer[MAX_UDP_MSG]; unsigned char in_buffer[MAX_UDP_MSG]; bool send_enabled; bool recv_enabled; }; } #endif zeromq-4.2.5/src/i_encoder.hpp0000664000372000037200000000406113255253220017170 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_I_ENCODER_HPP_INCLUDED__ #define __ZMQ_I_ENCODER_HPP_INCLUDED__ #include "stdint.hpp" namespace zmq { // Forward declaration class msg_t; // Interface to be implemented by message encoder. struct i_encoder { virtual ~i_encoder () {} // The function returns a batch of binary data. The data // are filled to a supplied buffer. If no buffer is supplied (data_ // is NULL) encoder will provide buffer of its own. // Function returns 0 when a new message is required. virtual size_t encode (unsigned char **data_, size_t size) = 0; // Load a new message into encoder. virtual void load_msg (msg_t *msg_) = 0; }; } #endif zeromq-4.2.5/src/session_base.cpp0000664000372000037200000005073213255253220017717 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "session_base.hpp" #include "i_engine.hpp" #include "err.hpp" #include "pipe.hpp" #include "likely.hpp" #include "tcp_connecter.hpp" #include "ipc_connecter.hpp" #include "tipc_connecter.hpp" #include "socks_connecter.hpp" #include "vmci_connecter.hpp" #include "pgm_sender.hpp" #include "pgm_receiver.hpp" #include "address.hpp" #include "norm_engine.hpp" #include "udp_engine.hpp" #include "ctx.hpp" #include "req.hpp" #include "radio.hpp" #include "dish.hpp" zmq::session_base_t *zmq::session_base_t::create (class io_thread_t *io_thread_, bool active_, class socket_base_t *socket_, const options_t &options_, address_t *addr_) { session_base_t *s = NULL; switch (options_.type) { case ZMQ_REQ: s = new (std::nothrow) req_session_t (io_thread_, active_, socket_, options_, addr_); break; case ZMQ_RADIO: s = new (std::nothrow) radio_session_t (io_thread_, active_, socket_, options_, addr_); break; case ZMQ_DISH: s = new (std::nothrow) dish_session_t (io_thread_, active_, socket_, options_, addr_); break; case ZMQ_DEALER: case ZMQ_REP: case ZMQ_ROUTER: case ZMQ_PUB: case ZMQ_XPUB: case ZMQ_SUB: case ZMQ_XSUB: case ZMQ_PUSH: case ZMQ_PULL: case ZMQ_PAIR: case ZMQ_STREAM: case ZMQ_SERVER: case ZMQ_CLIENT: case ZMQ_GATHER: case ZMQ_SCATTER: case ZMQ_DGRAM: s = new (std::nothrow) session_base_t (io_thread_, active_, socket_, options_, addr_); break; default: errno = EINVAL; return NULL; } alloc_assert (s); return s; } zmq::session_base_t::session_base_t (class io_thread_t *io_thread_, bool active_, class socket_base_t *socket_, const options_t &options_, address_t *addr_) : own_t (io_thread_, options_), io_object_t (io_thread_), active (active_), pipe (NULL), zap_pipe (NULL), incomplete_in (false), pending (false), engine (NULL), socket (socket_), io_thread (io_thread_), has_linger_timer (false), addr (addr_) { } const char *zmq::session_base_t::get_endpoint () const { return engine->get_endpoint (); } zmq::session_base_t::~session_base_t () { zmq_assert (!pipe); zmq_assert (!zap_pipe); // If there's still a pending linger timer, remove it. if (has_linger_timer) { cancel_timer (linger_timer_id); has_linger_timer = false; } // Close the engine. if (engine) engine->terminate (); LIBZMQ_DELETE (addr); } void zmq::session_base_t::attach_pipe (pipe_t *pipe_) { zmq_assert (!is_terminating ()); zmq_assert (!pipe); zmq_assert (pipe_); pipe = pipe_; pipe->set_event_sink (this); } int zmq::session_base_t::pull_msg (msg_t *msg_) { if (!pipe || !pipe->read (msg_)) { errno = EAGAIN; return -1; } incomplete_in = msg_->flags () & msg_t::more ? true : false; return 0; } int zmq::session_base_t::push_msg (msg_t *msg_) { if (msg_->flags () & msg_t::command) return 0; if (pipe && pipe->write (msg_)) { int rc = msg_->init (); errno_assert (rc == 0); return 0; } errno = EAGAIN; return -1; } int zmq::session_base_t::read_zap_msg (msg_t *msg_) { if (zap_pipe == NULL) { errno = ENOTCONN; return -1; } if (!zap_pipe->read (msg_)) { errno = EAGAIN; return -1; } return 0; } int zmq::session_base_t::write_zap_msg (msg_t *msg_) { if (zap_pipe == NULL || !zap_pipe->write (msg_)) { errno = ENOTCONN; return -1; } if ((msg_->flags () & msg_t::more) == 0) zap_pipe->flush (); const int rc = msg_->init (); errno_assert (rc == 0); return 0; } void zmq::session_base_t::reset () { } void zmq::session_base_t::flush () { if (pipe) pipe->flush (); } void zmq::session_base_t::clean_pipes () { zmq_assert (pipe != NULL); // Get rid of half-processed messages in the out pipe. Flush any // unflushed messages upstream. pipe->rollback (); pipe->flush (); // Remove any half-read message from the in pipe. while (incomplete_in) { msg_t msg; int rc = msg.init (); errno_assert (rc == 0); rc = pull_msg (&msg); errno_assert (rc == 0); rc = msg.close (); errno_assert (rc == 0); } } void zmq::session_base_t::pipe_terminated (pipe_t *pipe_) { // Drop the reference to the deallocated pipe if required. zmq_assert (pipe_ == pipe || pipe_ == zap_pipe || terminating_pipes.count (pipe_) == 1); if (pipe_ == pipe) { // If this is our current pipe, remove it pipe = NULL; if (has_linger_timer) { cancel_timer (linger_timer_id); has_linger_timer = false; } } else if (pipe_ == zap_pipe) zap_pipe = NULL; else // Remove the pipe from the detached pipes set terminating_pipes.erase (pipe_); if (!is_terminating () && options.raw_socket) { if (engine) { engine->terminate (); engine = NULL; } terminate (); } // If we are waiting for pending messages to be sent, at this point // we are sure that there will be no more messages and we can proceed // with termination safely. if (pending && !pipe && !zap_pipe && terminating_pipes.empty ()) { pending = false; own_t::process_term (0); } } void zmq::session_base_t::read_activated (pipe_t *pipe_) { // Skip activating if we're detaching this pipe if (unlikely (pipe_ != pipe && pipe_ != zap_pipe)) { zmq_assert (terminating_pipes.count (pipe_) == 1); return; } if (unlikely (engine == NULL)) { pipe->check_read (); return; } if (likely (pipe_ == pipe)) engine->restart_output (); else { // i.e. pipe_ == zap_pipe engine->zap_msg_available (); } } void zmq::session_base_t::write_activated (pipe_t *pipe_) { // Skip activating if we're detaching this pipe if (pipe != pipe_) { zmq_assert (terminating_pipes.count (pipe_) == 1); return; } if (engine) engine->restart_input (); } void zmq::session_base_t::hiccuped (pipe_t *) { // Hiccups are always sent from session to socket, not the other // way round. zmq_assert (false); } zmq::socket_base_t *zmq::session_base_t::get_socket () { return socket; } void zmq::session_base_t::process_plug () { if (active) start_connecting (false); } // This functions can return 0 on success or -1 and errno=ECONNREFUSED if ZAP // is not setup (IE: inproc://zeromq.zap.01 does not exist in the same context) // or it aborts on any other error. In other words, either ZAP is not // configured or if it is configured it MUST be configured correctly and it // MUST work, otherwise authentication cannot be guaranteed and it would be a // security flaw. int zmq::session_base_t::zap_connect () { if (zap_pipe != NULL) return 0; endpoint_t peer = find_endpoint ("inproc://zeromq.zap.01"); if (peer.socket == NULL) { errno = ECONNREFUSED; return -1; } zmq_assert (peer.options.type == ZMQ_REP || peer.options.type == ZMQ_ROUTER || peer.options.type == ZMQ_SERVER); // Create a bi-directional pipe that will connect // session with zap socket. object_t *parents[2] = {this, peer.socket}; pipe_t *new_pipes[2] = {NULL, NULL}; int hwms[2] = {0, 0}; bool conflates[2] = {false, false}; int rc = pipepair (parents, new_pipes, hwms, conflates); errno_assert (rc == 0); // Attach local end of the pipe to this socket object. zap_pipe = new_pipes[0]; zap_pipe->set_nodelay (); zap_pipe->set_event_sink (this); send_bind (peer.socket, new_pipes[1], false); // Send empty routing id if required by the peer. if (peer.options.recv_routing_id) { msg_t id; rc = id.init (); errno_assert (rc == 0); id.set_flags (msg_t::routing_id); bool ok = zap_pipe->write (&id); zmq_assert (ok); zap_pipe->flush (); } return 0; } bool zmq::session_base_t::zap_enabled () { return (options.mechanism != ZMQ_NULL || !options.zap_domain.empty ()); } void zmq::session_base_t::process_attach (i_engine *engine_) { zmq_assert (engine_ != NULL); // Create the pipe if it does not exist yet. if (!pipe && !is_terminating ()) { object_t *parents[2] = {this, socket}; pipe_t *pipes[2] = {NULL, NULL}; bool conflate = options.conflate && (options.type == ZMQ_DEALER || options.type == ZMQ_PULL || options.type == ZMQ_PUSH || options.type == ZMQ_PUB || options.type == ZMQ_SUB); int hwms[2] = {conflate ? -1 : options.rcvhwm, conflate ? -1 : options.sndhwm}; bool conflates[2] = {conflate, conflate}; int rc = pipepair (parents, pipes, hwms, conflates); errno_assert (rc == 0); // Plug the local end of the pipe. pipes[0]->set_event_sink (this); // Remember the local end of the pipe. zmq_assert (!pipe); pipe = pipes[0]; // Ask socket to plug into the remote end of the pipe. send_bind (socket, pipes[1]); } // Plug in the engine. zmq_assert (!engine); engine = engine_; engine->plug (io_thread, this); } void zmq::session_base_t::engine_error ( zmq::stream_engine_t::error_reason_t reason) { // Engine is dead. Let's forget about it. engine = NULL; // Remove any half-done messages from the pipes. if (pipe) clean_pipes (); zmq_assert (reason == stream_engine_t::connection_error || reason == stream_engine_t::timeout_error || reason == stream_engine_t::protocol_error); switch (reason) { case stream_engine_t::timeout_error: /* FALLTHROUGH */ case stream_engine_t::connection_error: if (active) { reconnect (); break; } /* FALLTHROUGH */ case stream_engine_t::protocol_error: if (pending) { if (pipe) pipe->terminate (0); if (zap_pipe) zap_pipe->terminate (0); } else { terminate (); } break; } // Just in case there's only a delimiter in the pipe. if (pipe) pipe->check_read (); if (zap_pipe) zap_pipe->check_read (); } void zmq::session_base_t::process_term (int linger_) { zmq_assert (!pending); // If the termination of the pipe happens before the term command is // delivered there's nothing much to do. We can proceed with the // standard termination immediately. if (!pipe && !zap_pipe && terminating_pipes.empty ()) { own_t::process_term (0); return; } pending = true; if (pipe != NULL) { // If there's finite linger value, delay the termination. // If linger is infinite (negative) we don't even have to set // the timer. if (linger_ > 0) { zmq_assert (!has_linger_timer); add_timer (linger_, linger_timer_id); has_linger_timer = true; } // Start pipe termination process. Delay the termination till all messages // are processed in case the linger time is non-zero. pipe->terminate (linger_ != 0); // TODO: Should this go into pipe_t::terminate ? // In case there's no engine and there's only delimiter in the // pipe it wouldn't be ever read. Thus we check for it explicitly. if (!engine) pipe->check_read (); } if (zap_pipe != NULL) zap_pipe->terminate (false); } void zmq::session_base_t::timer_event (int id_) { // Linger period expired. We can proceed with termination even though // there are still pending messages to be sent. zmq_assert (id_ == linger_timer_id); has_linger_timer = false; // Ask pipe to terminate even though there may be pending messages in it. zmq_assert (pipe); pipe->terminate (false); } void zmq::session_base_t::reconnect () { // For delayed connect situations, terminate the pipe // and reestablish later on if (pipe && options.immediate == 1 && addr->protocol != "pgm" && addr->protocol != "epgm" && addr->protocol != "norm" && addr->protocol != "udp") { pipe->hiccup (); pipe->terminate (false); terminating_pipes.insert (pipe); pipe = NULL; if (has_linger_timer) { cancel_timer (linger_timer_id); has_linger_timer = false; } } reset (); // Reconnect. if (options.reconnect_ivl != -1) start_connecting (true); else { std::string *ep = new (std::string); addr->to_string (*ep); send_term_endpoint (socket, ep); } // For subscriber sockets we hiccup the inbound pipe, which will cause // the socket object to resend all the subscriptions. if (pipe && (options.type == ZMQ_SUB || options.type == ZMQ_XSUB || options.type == ZMQ_DISH)) pipe->hiccup (); } void zmq::session_base_t::start_connecting (bool wait_) { zmq_assert (active); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); // Create the connecter object. if (addr->protocol == "tcp") { if (!options.socks_proxy_address.empty ()) { address_t *proxy_address = new (std::nothrow) address_t ("tcp", options.socks_proxy_address, this->get_ctx ()); alloc_assert (proxy_address); socks_connecter_t *connecter = new (std::nothrow) socks_connecter_t (io_thread, this, options, addr, proxy_address, wait_); alloc_assert (connecter); launch_child (connecter); } else { tcp_connecter_t *connecter = new (std::nothrow) tcp_connecter_t (io_thread, this, options, addr, wait_); alloc_assert (connecter); launch_child (connecter); } return; } #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS if (addr->protocol == "ipc") { ipc_connecter_t *connecter = new (std::nothrow) ipc_connecter_t (io_thread, this, options, addr, wait_); alloc_assert (connecter); launch_child (connecter); return; } #endif #if defined ZMQ_HAVE_TIPC if (addr->protocol == "tipc") { tipc_connecter_t *connecter = new (std::nothrow) tipc_connecter_t (io_thread, this, options, addr, wait_); alloc_assert (connecter); launch_child (connecter); return; } #endif if (addr->protocol == "udp") { zmq_assert (options.type == ZMQ_DISH || options.type == ZMQ_RADIO || options.type == ZMQ_DGRAM); udp_engine_t *engine = new (std::nothrow) udp_engine_t (options); alloc_assert (engine); bool recv = false; bool send = false; if (options.type == ZMQ_RADIO) { send = true; recv = false; } else if (options.type == ZMQ_DISH) { send = false; recv = true; } else if (options.type == ZMQ_DGRAM) { send = true; recv = true; } int rc = engine->init (addr, send, recv); errno_assert (rc == 0); send_attach (this, engine); return; } #ifdef ZMQ_HAVE_OPENPGM // Both PGM and EPGM transports are using the same infrastructure. if (addr->protocol == "pgm" || addr->protocol == "epgm") { zmq_assert (options.type == ZMQ_PUB || options.type == ZMQ_XPUB || options.type == ZMQ_SUB || options.type == ZMQ_XSUB); // For EPGM transport with UDP encapsulation of PGM is used. bool const udp_encapsulation = addr->protocol == "epgm"; // At this point we'll create message pipes to the session straight // away. There's no point in delaying it as no concept of 'connect' // exists with PGM anyway. if (options.type == ZMQ_PUB || options.type == ZMQ_XPUB) { // PGM sender. pgm_sender_t *pgm_sender = new (std::nothrow) pgm_sender_t (io_thread, options); alloc_assert (pgm_sender); int rc = pgm_sender->init (udp_encapsulation, addr->address.c_str ()); errno_assert (rc == 0); send_attach (this, pgm_sender); } else { // PGM receiver. pgm_receiver_t *pgm_receiver = new (std::nothrow) pgm_receiver_t (io_thread, options); alloc_assert (pgm_receiver); int rc = pgm_receiver->init (udp_encapsulation, addr->address.c_str ()); errno_assert (rc == 0); send_attach (this, pgm_receiver); } return; } #endif #ifdef ZMQ_HAVE_NORM if (addr->protocol == "norm") { // At this point we'll create message pipes to the session straight // away. There's no point in delaying it as no concept of 'connect' // exists with NORM anyway. if (options.type == ZMQ_PUB || options.type == ZMQ_XPUB) { // NORM sender. norm_engine_t *norm_sender = new (std::nothrow) norm_engine_t (io_thread, options); alloc_assert (norm_sender); int rc = norm_sender->init (addr->address.c_str (), true, false); errno_assert (rc == 0); send_attach (this, norm_sender); } else { // ZMQ_SUB or ZMQ_XSUB // NORM receiver. norm_engine_t *norm_receiver = new (std::nothrow) norm_engine_t (io_thread, options); alloc_assert (norm_receiver); int rc = norm_receiver->init (addr->address.c_str (), false, true); errno_assert (rc == 0); send_attach (this, norm_receiver); } return; } #endif // ZMQ_HAVE_NORM #if defined ZMQ_HAVE_VMCI if (addr->protocol == "vmci") { vmci_connecter_t *connecter = new (std::nothrow) vmci_connecter_t (io_thread, this, options, addr, wait_); alloc_assert (connecter); launch_child (connecter); return; } #endif zmq_assert (false); } zeromq-4.2.5/src/server.hpp0000664000372000037200000000550413255253220016552 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SERVER_HPP_INCLUDED__ #define __ZMQ_SERVER_HPP_INCLUDED__ #include #include "socket_base.hpp" #include "session_base.hpp" #include "stdint.hpp" #include "blob.hpp" #include "msg.hpp" #include "fq.hpp" namespace zmq { class ctx_t; class pipe_t; // TODO: This class uses O(n) scheduling. Rewrite it to use O(1) algorithm. class server_t : public socket_base_t { public: server_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~server_t (); // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); protected: const blob_t &get_credential () const; private: // Fair queueing object for inbound pipes. fq_t fq; struct outpipe_t { zmq::pipe_t *pipe; bool active; }; // Outbound pipes indexed by the peer IDs. typedef std::map outpipes_t; outpipes_t outpipes; // Routing IDs are generated. It's a simple increment and wrap-over // algorithm. This value is the next ID to use (if not used already). uint32_t next_routing_id; server_t (const server_t &); const server_t &operator= (const server_t &); }; } #endif zeromq-4.2.5/src/ipc_listener.cpp0000664000372000037200000003057113255253220017721 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "ipc_listener.hpp" #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include #include #include "stream_engine.hpp" #include "ipc_address.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" #include "socket_base.hpp" #include #include #include #include #include #ifdef ZMQ_HAVE_LOCAL_PEERCRED #include #include #endif #ifdef ZMQ_HAVE_SO_PEERCRED #include #include #include #if defined ZMQ_HAVE_OPENBSD #define ucred sockpeercred #endif #endif const char *zmq::ipc_listener_t::tmp_env_vars[] = { "TMPDIR", "TEMPDIR", "TMP", 0 // Sentinel }; int zmq::ipc_listener_t::create_wildcard_address (std::string &path_, std::string &file_) { std::string tmp_path; // If TMPDIR, TEMPDIR, or TMP are available and are directories, create // the socket directory there. const char **tmp_env = tmp_env_vars; while (tmp_path.empty () && *tmp_env != 0) { char *tmpdir = getenv (*tmp_env); struct stat statbuf; // Confirm it is actually a directory before trying to use if (tmpdir != 0 && ::stat (tmpdir, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) { tmp_path.assign (tmpdir); if (*(tmp_path.rbegin ()) != '/') { tmp_path.push_back ('/'); } } // Try the next environment variable ++tmp_env; } // Append a directory name tmp_path.append ("tmpXXXXXX"); // We need room for tmp_path + trailing NUL std::vector buffer (tmp_path.length () + 1); strcpy (&buffer[0], tmp_path.c_str ()); #ifdef HAVE_MKDTEMP // Create the directory. POSIX requires that mkdtemp() creates the // directory with 0700 permissions, meaning the only possible race // with socket creation could be the same user. However, since // each socket is created in a directory created by mkdtemp(), and // mkdtemp() guarantees a unique directory name, there will be no // collision. if (mkdtemp (&buffer[0]) == 0) { return -1; } path_.assign (&buffer[0]); file_.assign (path_ + "/socket"); #else // Silence -Wunused-parameter. #pragma and __attribute__((unused)) are not // very portable unfortunately... (void) path_; int fd = mkstemp (&buffer[0]); if (fd == -1) return -1; ::close (fd); file_.assign (&buffer[0]); #endif return 0; } zmq::ipc_listener_t::ipc_listener_t (io_thread_t *io_thread_, socket_base_t *socket_, const options_t &options_) : own_t (io_thread_, options_), io_object_t (io_thread_), has_file (false), s (retired_fd), socket (socket_) { } zmq::ipc_listener_t::~ipc_listener_t () { zmq_assert (s == retired_fd); } void zmq::ipc_listener_t::process_plug () { // Start polling for incoming connections. handle = add_fd (s); set_pollin (handle); } void zmq::ipc_listener_t::process_term (int linger_) { rm_fd (handle); close (); own_t::process_term (linger_); } void zmq::ipc_listener_t::in_event () { fd_t fd = accept (); // If connection was reset by the peer in the meantime, just ignore it. // TODO: Handle specific errors like ENFILE/EMFILE etc. if (fd == retired_fd) { socket->event_accept_failed (endpoint, zmq_errno ()); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); // Create and launch a session object. session_base_t *session = session_base_t::create (io_thread, false, socket, options, NULL); errno_assert (session); session->inc_seqnum (); launch_child (session); send_attach (session, engine, false); socket->event_accepted (endpoint, fd); } int zmq::ipc_listener_t::get_address (std::string &addr_) { struct sockaddr_storage ss; #ifdef ZMQ_HAVE_HPUX int sl = sizeof (ss); #else socklen_t sl = sizeof (ss); #endif int rc = getsockname (s, (sockaddr *) &ss, &sl); if (rc != 0) { addr_.clear (); return rc; } ipc_address_t addr ((struct sockaddr *) &ss, sl); return addr.to_string (addr_); } int zmq::ipc_listener_t::set_address (const char *addr_) { // Create addr on stack for auto-cleanup std::string addr (addr_); // Allow wildcard file if (options.use_fd == -1 && addr[0] == '*') { if (create_wildcard_address (tmp_socket_dirname, addr) < 0) { return -1; } } // Get rid of the file associated with the UNIX domain socket that // may have been left behind by the previous run of the application. // MUST NOT unlink if the FD is managed by the user, or it will stop // working after the first client connects. The user will take care of // cleaning up the file after the service is stopped. if (options.use_fd == -1) { ::unlink (addr.c_str ()); } filename.clear (); // Initialise the address structure. ipc_address_t address; int rc = address.resolve (addr.c_str ()); if (rc != 0) { if (!tmp_socket_dirname.empty ()) { // We need to preserve errno to return to the user int errno_ = errno; ::rmdir (tmp_socket_dirname.c_str ()); tmp_socket_dirname.clear (); errno = errno_; } return -1; } address.to_string (endpoint); if (options.use_fd != -1) { s = options.use_fd; } else { // Create a listening socket. s = open_socket (AF_UNIX, SOCK_STREAM, 0); if (s == -1) { if (!tmp_socket_dirname.empty ()) { // We need to preserve errno to return to the user int errno_ = errno; ::rmdir (tmp_socket_dirname.c_str ()); tmp_socket_dirname.clear (); errno = errno_; } return -1; } // Bind the socket to the file path. rc = bind (s, (sockaddr *) address.addr (), address.addrlen ()); if (rc != 0) goto error; // Listen for incoming connections. rc = listen (s, options.backlog); if (rc != 0) goto error; } filename.assign (addr.c_str ()); has_file = true; socket->event_listening (endpoint, s); return 0; error: int err = errno; close (); errno = err; return -1; } int zmq::ipc_listener_t::close () { zmq_assert (s != retired_fd); int fd_for_event = s; int rc = ::close (s); errno_assert (rc == 0); s = retired_fd; if (has_file && options.use_fd == -1) { rc = 0; if (rc == 0 && !tmp_socket_dirname.empty ()) { rc = ::rmdir (tmp_socket_dirname.c_str ()); tmp_socket_dirname.clear (); } if (rc != 0) { socket->event_close_failed (endpoint, zmq_errno ()); return -1; } } socket->event_closed (endpoint, fd_for_event); return 0; } #if defined ZMQ_HAVE_SO_PEERCRED bool zmq::ipc_listener_t::filter (fd_t sock) { if (options.ipc_uid_accept_filters.empty () && options.ipc_pid_accept_filters.empty () && options.ipc_gid_accept_filters.empty ()) return true; struct ucred cred; socklen_t size = sizeof (cred); if (getsockopt (sock, SOL_SOCKET, SO_PEERCRED, &cred, &size)) return false; if (options.ipc_uid_accept_filters.find (cred.uid) != options.ipc_uid_accept_filters.end () || options.ipc_gid_accept_filters.find (cred.gid) != options.ipc_gid_accept_filters.end () || options.ipc_pid_accept_filters.find (cred.pid) != options.ipc_pid_accept_filters.end ()) return true; struct passwd *pw; struct group *gr; if (!(pw = getpwuid (cred.uid))) return false; for (options_t::ipc_gid_accept_filters_t::const_iterator it = options.ipc_gid_accept_filters.begin (); it != options.ipc_gid_accept_filters.end (); it++) { if (!(gr = getgrgid (*it))) continue; for (char **mem = gr->gr_mem; *mem; mem++) { if (!strcmp (*mem, pw->pw_name)) return true; } } return false; } #elif defined ZMQ_HAVE_LOCAL_PEERCRED bool zmq::ipc_listener_t::filter (fd_t sock) { if (options.ipc_uid_accept_filters.empty () && options.ipc_gid_accept_filters.empty ()) return true; struct xucred cred; socklen_t size = sizeof (cred); if (getsockopt (sock, 0, LOCAL_PEERCRED, &cred, &size)) return false; if (cred.cr_version != XUCRED_VERSION) return false; if (options.ipc_uid_accept_filters.find (cred.cr_uid) != options.ipc_uid_accept_filters.end ()) return true; for (int i = 0; i < cred.cr_ngroups; i++) { if (options.ipc_gid_accept_filters.find (cred.cr_groups[i]) != options.ipc_gid_accept_filters.end ()) return true; } return false; } #endif zmq::fd_t zmq::ipc_listener_t::accept () { // Accept one connection and deal with different failure modes. // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. zmq_assert (s != retired_fd); #if defined ZMQ_HAVE_SOCK_CLOEXEC && defined HAVE_ACCEPT4 fd_t sock = ::accept4 (s, NULL, NULL, SOCK_CLOEXEC); #else fd_t sock = ::accept (s, NULL, NULL); #endif if (sock == -1) { errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR || errno == ECONNABORTED || errno == EPROTO || errno == ENFILE); return retired_fd; } #if (!defined ZMQ_HAVE_SOCK_CLOEXEC || !defined HAVE_ACCEPT4) \ && defined FD_CLOEXEC // Race condition can cause socket not to be closed (if fork happens // between accept and this point). int rc = fcntl (sock, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif // IPC accept() filters #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED if (!filter (sock)) { int rc = ::close (sock); errno_assert (rc == 0); return retired_fd; } #endif if (zmq::set_nosigpipe (sock)) { #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (sock); wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (sock); errno_assert (rc == 0); #endif return retired_fd; } return sock; } #endif zeromq-4.2.5/src/stream.hpp0000664000372000037200000000635013255253220016537 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_STREAM_HPP_INCLUDED__ #define __ZMQ_STREAM_HPP_INCLUDED__ #include #include "router.hpp" namespace zmq { class ctx_t; class pipe_t; class stream_t : public socket_base_t { public: stream_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~stream_t (); // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); private: // Generate peer's id and update lookup map void identify_peer (pipe_t *pipe_); // Fair queueing object for inbound pipes. fq_t fq; // True iff there is a message held in the pre-fetch buffer. bool prefetched; // If true, the receiver got the message part with // the peer's identity. bool routing_id_sent; // Holds the prefetched identity. msg_t prefetched_routing_id; // Holds the prefetched message. msg_t prefetched_msg; struct outpipe_t { zmq::pipe_t *pipe; bool active; }; // Outbound pipes indexed by the peer IDs. typedef std::map outpipes_t; outpipes_t outpipes; // The pipe we are currently writing to. zmq::pipe_t *current_out; // If true, more outgoing message parts are expected. bool more_out; // Routing IDs are generated. It's a simple increment and wrap-over // algorithm. This value is the next ID to use (if not used already). uint32_t next_integral_routing_id; stream_t (const stream_t &); const stream_t &operator= (const stream_t &); }; } #endif zeromq-4.2.5/src/plain_client.hpp0000664000372000037200000000466013255253220017707 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PLAIN_CLIENT_HPP_INCLUDED__ #define __ZMQ_PLAIN_CLIENT_HPP_INCLUDED__ #include "mechanism_base.hpp" #include "options.hpp" namespace zmq { class msg_t; class plain_client_t : public mechanism_base_t { public: plain_client_t (session_base_t *const session_, const options_t &options_); virtual ~plain_client_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual status_t status () const; private: enum state_t { sending_hello, waiting_for_welcome, sending_initiate, waiting_for_ready, error_command_received, ready }; state_t state; int produce_hello (msg_t *msg_) const; int produce_initiate (msg_t *msg_) const; int process_welcome (const unsigned char *cmd_data, size_t data_size); int process_ready (const unsigned char *cmd_data, size_t data_size); int process_error (const unsigned char *cmd_data, size_t data_size); }; } #endif zeromq-4.2.5/src/thread.cpp0000664000372000037200000002256413255253220016513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "thread.hpp" #include "err.hpp" bool zmq::thread_t::get_started () const { return started; } #ifdef ZMQ_HAVE_WINDOWS extern "C" { #if defined _WIN32_WCE static DWORD thread_routine (LPVOID arg_) #else static unsigned int __stdcall thread_routine (void *arg_) #endif { zmq::thread_t *self = (zmq::thread_t *) arg_; self->tfn (self->arg); return 0; } } void zmq::thread_t::start (thread_fn *tfn_, void *arg_) { tfn = tfn_; arg = arg_; #if defined _WIN32_WCE descriptor = (HANDLE) CreateThread (NULL, 0, &::thread_routine, this, 0, NULL); #else descriptor = (HANDLE) _beginthreadex (NULL, 0, &::thread_routine, this, 0, NULL); #endif win_assert (descriptor != NULL); started = true; } bool zmq::thread_t::is_current_thread () const { return GetCurrentThreadId () == GetThreadId (descriptor); } void zmq::thread_t::stop () { if (started) { DWORD rc = WaitForSingleObject (descriptor, INFINITE); win_assert (rc != WAIT_FAILED); BOOL rc2 = CloseHandle (descriptor); win_assert (rc2 != 0); } } void zmq::thread_t::setSchedulingParameters ( int priority_, int schedulingPolicy_, const std::set &affinity_cpus_) { // not implemented LIBZMQ_UNUSED (priority_); LIBZMQ_UNUSED (schedulingPolicy_); LIBZMQ_UNUSED (affinity_cpus_); } void zmq::thread_t::setThreadName (const char *name_) { // not implemented LIBZMQ_UNUSED (name_); } #elif defined ZMQ_HAVE_VXWORKS extern "C" { static void *thread_routine (void *arg_) { zmq::thread_t *self = (zmq::thread_t *) arg_; self->applySchedulingParameters (); self->tfn (self->arg); return NULL; } } void zmq::thread_t::start (thread_fn *tfn_, void *arg_) { tfn = tfn_; arg = arg_; descriptor = taskSpawn (NULL, DEFAULT_PRIORITY, DEFAULT_OPTIONS, DEFAULT_STACK_SIZE, (FUNCPTR) thread_routine, (int) this, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (descriptor != NULL || descriptor > 0) started = true; } void zmq::thread_t::stop () { if (started) while ((descriptor != NULL || descriptor > 0) && taskIdVerify (descriptor) == 0) { } } bool zmq::thread_t::is_current_thread () const { return taskIdSelf () == descriptor; } void zmq::thread_t::setSchedulingParameters ( int priority_, int schedulingPolicy_, const std::set &affinity_cpus_) { thread_priority = priority_; thread_sched_policy = schedulingPolicy_; thread_affinity_cpus = affinity_cpus_; } void zmq::thread_t:: applySchedulingParameters () // to be called in secondary thread context { int priority = (thread_priority >= 0 ? thread_priority : DEFAULT_PRIORITY); priority = (priority < 255 ? priority : DEFAULT_PRIORITY); if (descriptor != NULL || descriptor > 0) { taskPrioritySet (descriptor, priority); } } void zmq::thread_t::setThreadName (const char *name_) { // not implemented LIBZMQ_UNUSED (name_); } #else #include #include #include #include extern "C" { static void *thread_routine (void *arg_) { #if !defined ZMQ_HAVE_OPENVMS && !defined ZMQ_HAVE_ANDROID // Following code will guarantee more predictable latencies as it'll // disallow any signal handling in the I/O thread. sigset_t signal_set; int rc = sigfillset (&signal_set); errno_assert (rc == 0); rc = pthread_sigmask (SIG_BLOCK, &signal_set, NULL); posix_assert (rc); #endif zmq::thread_t *self = (zmq::thread_t *) arg_; self->applySchedulingParameters (); self->tfn (self->arg); return NULL; } } void zmq::thread_t::start (thread_fn *tfn_, void *arg_) { tfn = tfn_; arg = arg_; int rc = pthread_create (&descriptor, NULL, thread_routine, this); posix_assert (rc); started = true; } void zmq::thread_t::stop () { if (started) { int rc = pthread_join (descriptor, NULL); posix_assert (rc); } } bool zmq::thread_t::is_current_thread () const { return pthread_self () == descriptor; } void zmq::thread_t::setSchedulingParameters ( int priority_, int schedulingPolicy_, const std::set &affinity_cpus_) { thread_priority = priority_; thread_sched_policy = schedulingPolicy_; thread_affinity_cpus = affinity_cpus_; } void zmq::thread_t:: applySchedulingParameters () // to be called in secondary thread context { #if defined _POSIX_THREAD_PRIORITY_SCHEDULING \ && _POSIX_THREAD_PRIORITY_SCHEDULING >= 0 int policy = 0; struct sched_param param; #if _POSIX_THREAD_PRIORITY_SCHEDULING == 0 \ && defined _SC_THREAD_PRIORITY_SCHEDULING if (sysconf (_SC_THREAD_PRIORITY_SCHEDULING) < 0) { return; } #endif int rc = pthread_getschedparam (descriptor, &policy, ¶m); posix_assert (rc); if (thread_sched_policy != ZMQ_THREAD_SCHED_POLICY_DFLT) { policy = thread_sched_policy; } /* Quoting docs: "Linux allows the static priority range 1 to 99 for the SCHED_FIFO and SCHED_RR policies, and the priority 0 for the remaining policies." Other policies may use the "nice value" in place of the priority: */ bool use_nice_instead_priority = (policy != SCHED_FIFO) && (policy != SCHED_RR); if (thread_priority != ZMQ_THREAD_PRIORITY_DFLT) { if (use_nice_instead_priority) param.sched_priority = 0; // this is the only supported priority for most scheduling policies else param.sched_priority = thread_priority; // user should provide a value between 1 and 99 } #ifdef __NetBSD__ if (policy == SCHED_OTHER) param.sched_priority = -1; #endif rc = pthread_setschedparam (descriptor, policy, ¶m); #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) // If this feature is unavailable at run-time, don't abort. if (rc == ENOSYS) return; #endif posix_assert (rc); #if !defined ZMQ_HAVE_VXWORKS if (use_nice_instead_priority && thread_priority != ZMQ_THREAD_PRIORITY_DFLT) { // assume the user wants to decrease the thread's nice value // i.e., increase the chance of this thread being scheduled: try setting that to // maximum priority. rc = nice (-20); errno_assert (rc != -1); // IMPORTANT: EPERM is typically returned for unprivileged processes: that's because // CAP_SYS_NICE capability is required or RLIMIT_NICE resource limit should be changed to avoid EPERM! } #endif #ifdef ZMQ_HAVE_PTHREAD_SET_AFFINITY if (!thread_affinity_cpus.empty ()) { cpu_set_t cpuset; CPU_ZERO (&cpuset); for (std::set::const_iterator it = thread_affinity_cpus.begin (); it != thread_affinity_cpus.end (); it++) { CPU_SET ((int) (*it), &cpuset); } rc = pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); posix_assert (rc); } #endif #endif } void zmq::thread_t::setThreadName (const char *name_) { /* The thread name is a cosmetic string, added to ease debugging of * multi-threaded applications. It is not a big issue if this value * can not be set for any reason (such as Permission denied in some * cases where the application changes its EUID, etc.) The value of * "int rc" is retained where available, to help debuggers stepping * through code to see its value - but otherwise it is ignored. */ if (!name_) return; #if defined(ZMQ_HAVE_PTHREAD_SETNAME_1) int rc = pthread_setname_np (name_); if (rc) return; #elif defined(ZMQ_HAVE_PTHREAD_SETNAME_2) int rc = pthread_setname_np (descriptor, name_); if (rc) return; #elif defined(ZMQ_HAVE_PTHREAD_SETNAME_3) int rc = pthread_setname_np (descriptor, name_, NULL); if (rc) return; #elif defined(ZMQ_HAVE_PTHREAD_SET_NAME) pthread_set_name_np (descriptor, name_); #endif } #endif zeromq-4.2.5/src/proxy.cpp0000664000372000037200000006473013255253220016426 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ // On AIX platform, poll.h has to be included first to get consistent // definition of pollfd structure (AIX uses 'reqevents' and 'retnevents' // instead of 'events' and 'revents' and defines macros to map from POSIX-y // names to AIX-specific names). // zmq.h must be included *after* poll.h for AIX to build properly. // precompiled.hpp includes include/zmq.h #if defined ZMQ_POLL_BASED_ON_POLL && defined ZMQ_HAVE_AIX #include #endif #include "precompiled.hpp" #include #include "poller.hpp" #include "proxy.hpp" #include "likely.hpp" #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS \ && !defined ZMQ_HAVE_AIX #include #endif // These headers end up pulling in zmq.h somewhere in their include // dependency chain #include "socket_base.hpp" #include "err.hpp" #ifdef ZMQ_HAVE_POLLER #include "socket_poller.hpp" // Macros for repetitive code. // PROXY_CLEANUP() must not be used before these variables are initialized. #define PROXY_CLEANUP() \ do { \ delete poller_all; \ delete poller_in; \ delete poller_control; \ delete poller_receive_blocked; \ delete poller_send_blocked; \ delete poller_both_blocked; \ delete poller_frontend_only; \ delete poller_backend_only; \ } while (false) #define CHECK_RC_EXIT_ON_FAILURE() \ do { \ if (rc < 0) { \ PROXY_CLEANUP (); \ return close_and_return (&msg, -1); \ } \ } while (false) #endif // ZMQ_HAVE_POLLER // Control socket messages typedef struct { uint64_t msg_in; uint64_t bytes_in; uint64_t msg_out; uint64_t bytes_out; } zmq_socket_stats_t; // Utility functions int capture (class zmq::socket_base_t *capture_, zmq::msg_t &msg_, int more_ = 0) { // Copy message to capture socket if any if (capture_) { zmq::msg_t ctrl; int rc = ctrl.init (); if (unlikely (rc < 0)) return -1; rc = ctrl.copy (msg_); if (unlikely (rc < 0)) return -1; rc = capture_->send (&ctrl, more_ ? ZMQ_SNDMORE : 0); if (unlikely (rc < 0)) return -1; } return 0; } int forward (class zmq::socket_base_t *from_, zmq_socket_stats_t *from_stats, class zmq::socket_base_t *to_, zmq_socket_stats_t *to_stats, class zmq::socket_base_t *capture_, zmq::msg_t &msg_) { int more; size_t moresz; size_t complete_msg_size = 0; while (true) { int rc = from_->recv (&msg_, 0); if (unlikely (rc < 0)) return -1; complete_msg_size += msg_.size (); moresz = sizeof more; rc = from_->getsockopt (ZMQ_RCVMORE, &more, &moresz); if (unlikely (rc < 0)) return -1; // Copy message to capture socket if any rc = capture (capture_, msg_, more); if (unlikely (rc < 0)) return -1; rc = to_->send (&msg_, more ? ZMQ_SNDMORE : 0); if (unlikely (rc < 0)) return -1; if (more == 0) break; } // A multipart message counts as 1 packet: from_stats->msg_in++; from_stats->bytes_in += complete_msg_size; to_stats->msg_out++; to_stats->bytes_out += complete_msg_size; return 0; } static int loop_and_send_multipart_stat (zmq::socket_base_t *control_, uint64_t stat, bool first, bool more) { int rc; zmq::msg_t msg; // VSM of 8 bytes can't fail to init msg.init_size (sizeof (uint64_t)); memcpy (msg.data (), (const void *) &stat, sizeof (uint64_t)); // if the first message is handed to the pipe successfully then the HWM // is not full, which means failures are due to interrupts (on Windows pipes // are TCP sockets), so keep retrying do { rc = control_->send (&msg, more ? ZMQ_SNDMORE : 0); } while (!first && rc != 0 && errno == EAGAIN); return rc; } int reply_stats (class zmq::socket_base_t *control_, zmq_socket_stats_t *frontend_stats, zmq_socket_stats_t *backend_stats) { // first part: frontend stats - the first send might fail due to HWM if (loop_and_send_multipart_stat (control_, frontend_stats->msg_in, true, true) != 0) return -1; loop_and_send_multipart_stat (control_, frontend_stats->bytes_in, false, true); loop_and_send_multipart_stat (control_, frontend_stats->msg_out, false, true); loop_and_send_multipart_stat (control_, frontend_stats->bytes_out, false, true); // second part: backend stats loop_and_send_multipart_stat (control_, backend_stats->msg_in, false, true); loop_and_send_multipart_stat (control_, backend_stats->bytes_in, false, true); loop_and_send_multipart_stat (control_, backend_stats->msg_out, false, true); loop_and_send_multipart_stat (control_, backend_stats->bytes_out, false, false); return 0; } #ifdef ZMQ_HAVE_POLLER int zmq::proxy (class socket_base_t *frontend_, class socket_base_t *backend_, class socket_base_t *capture_, class socket_base_t *control_) { msg_t msg; int rc = msg.init (); if (rc != 0) return -1; // The algorithm below assumes ratio of requests and replies processed // under full load to be 1:1. int more; size_t moresz = sizeof (more); // Proxy can be in these three states enum { active, paused, terminated } state = active; bool frontend_equal_to_backend; bool frontend_in = false; bool frontend_out = false; bool backend_in = false; bool backend_out = false; bool control_in = false; zmq::socket_poller_t::event_t events[3]; zmq_socket_stats_t frontend_stats; zmq_socket_stats_t backend_stats; memset (&frontend_stats, 0, sizeof (frontend_stats)); memset (&backend_stats, 0, sizeof (backend_stats)); // Don't allocate these pollers from stack because they will take more than 900 kB of stack! // On Windows this blows up default stack of 1 MB and aborts the program. // I wanted to use std::shared_ptr here as the best solution but that requires C++11... zmq::socket_poller_t *poller_all = new (std::nothrow) zmq::socket_poller_t; // Poll for everything. zmq::socket_poller_t *poller_in = new (std::nothrow) zmq:: socket_poller_t; // Poll only 'ZMQ_POLLIN' on all sockets. Initial blocking poll in loop. zmq::socket_poller_t *poller_control = new (std::nothrow) zmq:: socket_poller_t; // Poll only for 'ZMQ_POLLIN' on 'control_', when proxy is paused. zmq::socket_poller_t *poller_receive_blocked = new (std::nothrow) zmq::socket_poller_t; // All except 'ZMQ_POLLIN' on 'frontend_'. // If frontend_==backend_ 'poller_send_blocked' and 'poller_receive_blocked' are the same, 'ZMQ_POLLIN' is ignored. // In that case 'poller_send_blocked' is not used. We need only 'poller_receive_blocked'. // We also don't need 'poller_both_blocked', 'poller_backend_only' nor 'poller_frontend_only' no need to initialize it. // We save some RAM and time for initialization. zmq::socket_poller_t *poller_send_blocked = NULL; // All except 'ZMQ_POLLIN' on 'backend_'. zmq::socket_poller_t *poller_both_blocked = NULL; // All except 'ZMQ_POLLIN' on both 'frontend_' and 'backend_'. zmq::socket_poller_t *poller_frontend_only = NULL; // Only 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' on 'frontend_'. zmq::socket_poller_t *poller_backend_only = NULL; // Only 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' on 'backend_'. if (frontend_ != backend_) { poller_send_blocked = new (std::nothrow) zmq::socket_poller_t; // All except 'ZMQ_POLLIN' on 'backend_'. poller_both_blocked = new (std::nothrow) zmq:: socket_poller_t; // All except 'ZMQ_POLLIN' on both 'frontend_' and 'backend_'. poller_frontend_only = new (std::nothrow) zmq:: socket_poller_t; // Only 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' on 'frontend_'. poller_backend_only = new (std::nothrow) zmq:: socket_poller_t; // Only 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' on 'backend_'. frontend_equal_to_backend = false; } else frontend_equal_to_backend = true; if (poller_all == NULL || poller_in == NULL || poller_control == NULL || poller_receive_blocked == NULL || ((poller_send_blocked == NULL || poller_both_blocked == NULL) && !frontend_equal_to_backend)) { PROXY_CLEANUP (); return close_and_return (&msg, -1); } zmq::socket_poller_t *poller_wait = poller_in; // Poller for blocking wait, initially all 'ZMQ_POLLIN'. // Register 'frontend_' and 'backend_' with pollers. rc = poller_all->add (frontend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); // Everything. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_in->add (frontend_, NULL, ZMQ_POLLIN); // All 'ZMQ_POLLIN's. CHECK_RC_EXIT_ON_FAILURE (); if (frontend_equal_to_backend) { // If frontend_==backend_ 'poller_send_blocked' and 'poller_receive_blocked' are the same, // so we don't need 'poller_send_blocked'. We need only 'poller_receive_blocked'. // We also don't need 'poller_both_blocked', no need to initialize it. rc = poller_receive_blocked->add (frontend_, NULL, ZMQ_POLLOUT); CHECK_RC_EXIT_ON_FAILURE (); } else { rc = poller_all->add (backend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); // Everything. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_in->add (backend_, NULL, ZMQ_POLLIN); // All 'ZMQ_POLLIN's. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_both_blocked->add ( frontend_, NULL, ZMQ_POLLOUT); // Waiting only for 'ZMQ_POLLOUT'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_both_blocked->add ( backend_, NULL, ZMQ_POLLOUT); // Waiting only for 'ZMQ_POLLOUT'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_send_blocked->add ( backend_, NULL, ZMQ_POLLOUT); // All except 'ZMQ_POLLIN' on 'backend_'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_send_blocked->add ( frontend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); // All except 'ZMQ_POLLIN' on 'backend_'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_receive_blocked->add ( frontend_, NULL, ZMQ_POLLOUT); // All except 'ZMQ_POLLIN' on 'frontend_'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_receive_blocked->add ( backend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); // All except 'ZMQ_POLLIN' on 'frontend_'. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_frontend_only->add (frontend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_backend_only->add (backend_, NULL, ZMQ_POLLIN | ZMQ_POLLOUT); CHECK_RC_EXIT_ON_FAILURE (); } // Register 'control_' with pollers. if (control_ != NULL) { rc = poller_all->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_in->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_control->add ( control_, NULL, ZMQ_POLLIN); // When proxy is paused we wait only for ZMQ_POLLIN on 'control_' socket. CHECK_RC_EXIT_ON_FAILURE (); rc = poller_receive_blocked->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); if (!frontend_equal_to_backend) { rc = poller_send_blocked->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_both_blocked->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_frontend_only->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); rc = poller_backend_only->add (control_, NULL, ZMQ_POLLIN); CHECK_RC_EXIT_ON_FAILURE (); } } int i; bool request_processed, reply_processed; while (state != terminated) { // Blocking wait initially only for 'ZMQ_POLLIN' - 'poller_wait' points to 'poller_in'. // If one of receiving end's queue is full ('ZMQ_POLLOUT' not available), // 'poller_wait' is pointed to 'poller_receive_blocked', 'poller_send_blocked' or 'poller_both_blocked'. rc = poller_wait->wait (events, 3, -1); if (rc < 0 && errno == EAGAIN) rc = 0; CHECK_RC_EXIT_ON_FAILURE (); // Some of events waited for by 'poller_wait' have arrived, now poll for everything without blocking. rc = poller_all->wait (events, 3, 0); if (rc < 0 && errno == EAGAIN) rc = 0; CHECK_RC_EXIT_ON_FAILURE (); // Process events. for (i = 0; i < rc; i++) { if (events[i].socket == frontend_) { frontend_in = (events[i].events & ZMQ_POLLIN) != 0; frontend_out = (events[i].events & ZMQ_POLLOUT) != 0; } else // This 'if' needs to be after check for 'frontend_' in order never // to be reached in case frontend_==backend_, so we ensure backend_in=false in that case. if (events[i].socket == backend_) { backend_in = (events[i].events & ZMQ_POLLIN) != 0; backend_out = (events[i].events & ZMQ_POLLOUT) != 0; } else if (events[i].socket == control_) control_in = (events[i].events & ZMQ_POLLIN) != 0; } // Process a control command if any. if (control_in) { rc = control_->recv (&msg, 0); CHECK_RC_EXIT_ON_FAILURE (); rc = control_->getsockopt (ZMQ_RCVMORE, &more, &moresz); if (unlikely (rc < 0) || more) { PROXY_CLEANUP (); return close_and_return (&msg, -1); } // Copy message to capture socket if any. rc = capture (capture_, msg); CHECK_RC_EXIT_ON_FAILURE (); if (msg.size () == 5 && memcmp (msg.data (), "PAUSE", 5) == 0) { state = paused; poller_wait = poller_control; } else if (msg.size () == 6 && memcmp (msg.data (), "RESUME", 6) == 0) { state = active; poller_wait = poller_in; } else { if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0) state = terminated; else { #ifdef ZMQ_BUILD_DRAFT_API if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0) { rc = reply_stats (control_, &frontend_stats, &backend_stats); CHECK_RC_EXIT_ON_FAILURE (); } else { #endif // This is an API error, we assert puts ("E: invalid command sent to proxy"); zmq_assert (false); #ifdef ZMQ_BUILD_DRAFT_API } #endif } } control_in = false; } if (state == active) { // Process a request, 'ZMQ_POLLIN' on 'frontend_' and 'ZMQ_POLLOUT' on 'backend_'. // In case of frontend_==backend_ there's no 'ZMQ_POLLOUT' event. if (frontend_in && (backend_out || frontend_equal_to_backend)) { rc = forward (frontend_, &frontend_stats, backend_, &backend_stats, capture_, msg); CHECK_RC_EXIT_ON_FAILURE (); request_processed = true; frontend_in = backend_out = false; } else request_processed = false; // Process a reply, 'ZMQ_POLLIN' on 'backend_' and 'ZMQ_POLLOUT' on 'frontend_'. // If 'frontend_' and 'backend_' are the same this is not needed because previous processing // covers all of the cases. 'backend_in' is always false if frontend_==backend_ due to // design in 'for' event processing loop. if (backend_in && frontend_out) { rc = forward (backend_, &backend_stats, frontend_, &frontend_stats, capture_, msg); CHECK_RC_EXIT_ON_FAILURE (); reply_processed = true; backend_in = frontend_out = false; } else reply_processed = false; if (request_processed || reply_processed) { // If request/reply is processed that means we had at least one 'ZMQ_POLLOUT' event. // Enable corresponding 'ZMQ_POLLIN' for blocking wait if any was disabled. if (poller_wait != poller_in) { if (request_processed) { // 'frontend_' -> 'backend_' if (poller_wait == poller_both_blocked) poller_wait = poller_send_blocked; else if (poller_wait == poller_receive_blocked || poller_wait == poller_frontend_only) poller_wait = poller_in; } if (reply_processed) { // 'backend_' -> 'frontend_' if (poller_wait == poller_both_blocked) poller_wait = poller_receive_blocked; else if (poller_wait == poller_send_blocked || poller_wait == poller_backend_only) poller_wait = poller_in; } } } else { // No requests have been processed, there were no 'ZMQ_POLLIN' with corresponding 'ZMQ_POLLOUT' events. // That means that out queue(s) is/are full or one out queue is full and second one has no messages to process. // Disable receiving 'ZMQ_POLLIN' for sockets for which there's no 'ZMQ_POLLOUT', // or wait only on both 'backend_''s or 'frontend_''s 'ZMQ_POLLIN' and 'ZMQ_POLLOUT'. if (frontend_in) { if (frontend_out) // If frontend_in and frontend_out are true, obviously backend_in and backend_out are both false. // In that case we need to wait for both 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' only on 'backend_'. // We'll never get here in case of frontend_==backend_ because then frontend_out will always be false. poller_wait = poller_backend_only; else { if (poller_wait == poller_send_blocked) poller_wait = poller_both_blocked; else if (poller_wait == poller_in) poller_wait = poller_receive_blocked; } } if (backend_in) { // Will never be reached if frontend_==backend_, 'backend_in' will // always be false due to design in 'for' event processing loop. if (backend_out) // If backend_in and backend_out are true, obviously frontend_in and frontend_out are both false. // In that case we need to wait for both 'ZMQ_POLLIN' and 'ZMQ_POLLOUT' only on 'frontend_'. poller_wait = poller_frontend_only; else { if (poller_wait == poller_receive_blocked) poller_wait = poller_both_blocked; else if (poller_wait == poller_in) poller_wait = poller_send_blocked; } } } } } PROXY_CLEANUP (); return close_and_return (&msg, 0); } #else // ZMQ_HAVE_POLLER int zmq::proxy (class socket_base_t *frontend_, class socket_base_t *backend_, class socket_base_t *capture_, class socket_base_t *control_) { msg_t msg; int rc = msg.init (); if (rc != 0) return -1; // The algorithm below assumes ratio of requests and replies processed // under full load to be 1:1. int more; size_t moresz; zmq_pollitem_t items[] = {{frontend_, 0, ZMQ_POLLIN, 0}, {backend_, 0, ZMQ_POLLIN, 0}, {control_, 0, ZMQ_POLLIN, 0}}; int qt_poll_items = (control_ ? 3 : 2); zmq_pollitem_t itemsout[] = {{frontend_, 0, ZMQ_POLLOUT, 0}, {backend_, 0, ZMQ_POLLOUT, 0}}; zmq_socket_stats_t frontend_stats; memset (&frontend_stats, 0, sizeof (frontend_stats)); zmq_socket_stats_t backend_stats; memset (&backend_stats, 0, sizeof (backend_stats)); // Proxy can be in these three states enum { active, paused, terminated } state = active; while (state != terminated) { // Wait while there are either requests or replies to process. rc = zmq_poll (&items[0], qt_poll_items, -1); if (unlikely (rc < 0)) return close_and_return (&msg, -1); // Get the pollout separately because when combining this with pollin it maxes the CPU // because pollout shall most of the time return directly. // POLLOUT is only checked when frontend and backend sockets are not the same. if (frontend_ != backend_) { rc = zmq_poll (&itemsout[0], 2, 0); if (unlikely (rc < 0)) { return close_and_return (&msg, -1); } } // Process a control command if any if (control_ && items[2].revents & ZMQ_POLLIN) { rc = control_->recv (&msg, 0); if (unlikely (rc < 0)) return close_and_return (&msg, -1); moresz = sizeof more; rc = control_->getsockopt (ZMQ_RCVMORE, &more, &moresz); if (unlikely (rc < 0) || more) return close_and_return (&msg, -1); // Copy message to capture socket if any rc = capture (capture_, msg); if (unlikely (rc < 0)) return close_and_return (&msg, -1); if (msg.size () == 5 && memcmp (msg.data (), "PAUSE", 5) == 0) state = paused; else if (msg.size () == 6 && memcmp (msg.data (), "RESUME", 6) == 0) state = active; else if (msg.size () == 9 && memcmp (msg.data (), "TERMINATE", 9) == 0) state = terminated; else { #ifdef ZMQ_BUILD_DRAFT_API if (msg.size () == 10 && memcmp (msg.data (), "STATISTICS", 10) == 0) { rc = reply_stats (control_, &frontend_stats, &backend_stats); if (unlikely (rc < 0)) return close_and_return (&msg, -1); } else { #endif // This is an API error, we assert puts ("E: invalid command sent to proxy"); zmq_assert (false); #ifdef ZMQ_BUILD_DRAFT_API } #endif } } // Process a request if (state == active && items[0].revents & ZMQ_POLLIN && (frontend_ == backend_ || itemsout[1].revents & ZMQ_POLLOUT)) { rc = forward (frontend_, &frontend_stats, backend_, &backend_stats, capture_, msg); if (unlikely (rc < 0)) return close_and_return (&msg, -1); } // Process a reply if (state == active && frontend_ != backend_ && items[1].revents & ZMQ_POLLIN && itemsout[0].revents & ZMQ_POLLOUT) { rc = forward (backend_, &backend_stats, frontend_, &frontend_stats, capture_, msg); if (unlikely (rc < 0)) return close_and_return (&msg, -1); } } return close_and_return (&msg, 0); } #endif // ZMQ_HAVE_POLLER zeromq-4.2.5/src/req.cpp0000664000372000037200000002234013255253220016023 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "req.hpp" #include "err.hpp" #include "msg.hpp" #include "wire.hpp" #include "random.hpp" #include "likely.hpp" extern "C" { static void free_id (void *data, void *hint) { LIBZMQ_UNUSED (hint); free (data); } } zmq::req_t::req_t (class ctx_t *parent_, uint32_t tid_, int sid_) : dealer_t (parent_, tid_, sid_), receiving_reply (false), message_begins (true), reply_pipe (NULL), request_id_frames_enabled (false), request_id (generate_random ()), strict (true) { options.type = ZMQ_REQ; } zmq::req_t::~req_t () { } int zmq::req_t::xsend (msg_t *msg_) { // If we've sent a request and we still haven't got the reply, // we can't send another request unless the strict option is disabled. if (receiving_reply) { if (strict) { errno = EFSM; return -1; } receiving_reply = false; message_begins = true; } // First part of the request is the request routing id. if (message_begins) { reply_pipe = NULL; if (request_id_frames_enabled) { request_id++; // Copy request id before sending (see issue #1695 for details). uint32_t *request_id_copy = (uint32_t *) malloc (sizeof (uint32_t)); zmq_assert (request_id_copy); *request_id_copy = request_id; msg_t id; int rc = id.init_data (request_id_copy, sizeof (uint32_t), free_id, NULL); errno_assert (rc == 0); id.set_flags (msg_t::more); rc = dealer_t::sendpipe (&id, &reply_pipe); if (rc != 0) return -1; } msg_t bottom; int rc = bottom.init (); errno_assert (rc == 0); bottom.set_flags (msg_t::more); rc = dealer_t::sendpipe (&bottom, &reply_pipe); if (rc != 0) return -1; zmq_assert (reply_pipe); message_begins = false; // Eat all currently available messages before the request is fully // sent. This is done to avoid: // REQ sends request to A, A replies, B replies too. // A's reply was first and matches, that is used. // An hour later REQ sends a request to B. B's old reply is used. msg_t drop; while (true) { rc = drop.init (); errno_assert (rc == 0); rc = dealer_t::xrecv (&drop); if (rc != 0) break; drop.close (); } } bool more = msg_->flags () & msg_t::more ? true : false; int rc = dealer_t::xsend (msg_); if (rc != 0) return rc; // If the request was fully sent, flip the FSM into reply-receiving state. if (!more) { receiving_reply = true; message_begins = true; } return 0; } int zmq::req_t::xrecv (msg_t *msg_) { // If request wasn't send, we can't wait for reply. if (!receiving_reply) { errno = EFSM; return -1; } // Skip messages until one with the right first frames is found. while (message_begins) { // If enabled, the first frame must have the correct request_id. if (request_id_frames_enabled) { int rc = recv_reply_pipe (msg_); if (rc != 0) return rc; if (unlikely (!(msg_->flags () & msg_t::more) || msg_->size () != sizeof (request_id) || *static_cast (msg_->data ()) != request_id)) { // Skip the remaining frames and try the next message while (msg_->flags () & msg_t::more) { rc = recv_reply_pipe (msg_); errno_assert (rc == 0); } continue; } } // The next frame must be 0. // TODO: Failing this check should also close the connection with the peer! int rc = recv_reply_pipe (msg_); if (rc != 0) return rc; if (unlikely (!(msg_->flags () & msg_t::more) || msg_->size () != 0)) { // Skip the remaining frames and try the next message while (msg_->flags () & msg_t::more) { rc = recv_reply_pipe (msg_); errno_assert (rc == 0); } continue; } message_begins = false; } int rc = recv_reply_pipe (msg_); if (rc != 0) return rc; // If the reply is fully received, flip the FSM into request-sending state. if (!(msg_->flags () & msg_t::more)) { receiving_reply = false; message_begins = true; } return 0; } bool zmq::req_t::xhas_in () { // TODO: Duplicates should be removed here. if (!receiving_reply) return false; return dealer_t::xhas_in (); } bool zmq::req_t::xhas_out () { if (receiving_reply && strict) return false; return dealer_t::xhas_out (); } int zmq::req_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { bool is_int = (optvallen_ == sizeof (int)); int value = 0; if (is_int) memcpy (&value, optval_, sizeof (int)); switch (option_) { case ZMQ_REQ_CORRELATE: if (is_int && value >= 0) { request_id_frames_enabled = (value != 0); return 0; } break; case ZMQ_REQ_RELAXED: if (is_int && value >= 0) { strict = (value == 0); return 0; } break; default: break; } return dealer_t::xsetsockopt (option_, optval_, optvallen_); } void zmq::req_t::xpipe_terminated (pipe_t *pipe_) { if (reply_pipe == pipe_) reply_pipe = NULL; dealer_t::xpipe_terminated (pipe_); } int zmq::req_t::recv_reply_pipe (msg_t *msg_) { while (true) { pipe_t *pipe = NULL; int rc = dealer_t::recvpipe (msg_, &pipe); if (rc != 0) return rc; if (!reply_pipe || pipe == reply_pipe) return 0; } } zmq::req_session_t::req_session_t (io_thread_t *io_thread_, bool connect_, socket_base_t *socket_, const options_t &options_, address_t *addr_) : session_base_t (io_thread_, connect_, socket_, options_, addr_), state (bottom) { } zmq::req_session_t::~req_session_t () { } int zmq::req_session_t::push_msg (msg_t *msg_) { switch (state) { case bottom: if (msg_->flags () == msg_t::more) { // In case option ZMQ_CORRELATE is on, allow request_id to be // transfered as first frame (would be too cumbersome to check // whether the option is actually on or not). if (msg_->size () == sizeof (uint32_t)) { state = request_id; return session_base_t::push_msg (msg_); } else if (msg_->size () == 0) { state = body; return session_base_t::push_msg (msg_); } } break; case request_id: if (msg_->flags () == msg_t::more && msg_->size () == 0) { state = body; return session_base_t::push_msg (msg_); } break; case body: if (msg_->flags () == msg_t::more) return session_base_t::push_msg (msg_); if (msg_->flags () == 0) { state = bottom; return session_base_t::push_msg (msg_); } break; } errno = EFAULT; return -1; } void zmq::req_session_t::reset () { session_base_t::reset (); state = bottom; } zeromq-4.2.5/src/dgram.hpp0000664000372000037200000000461413255253220016337 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DGRAM_HPP_INCLUDED__ #define __ZMQ_DGRAM_HPP_INCLUDED__ #include "blob.hpp" #include "socket_base.hpp" #include "session_base.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class dgram_t : public socket_base_t { public: dgram_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~dgram_t (); // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: zmq::pipe_t *pipe; zmq::pipe_t *last_in; blob_t saved_credential; // If true, more outgoing message parts are expected. bool more_out; dgram_t (const dgram_t &); const dgram_t &operator= (const dgram_t &); }; } #endif zeromq-4.2.5/src/zmq_utils.cpp0000664000372000037200000002337313255253220017272 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "clock.hpp" #include "err.hpp" #include "thread.hpp" #include "atomic_counter.hpp" #include "atomic_ptr.hpp" #include "random.hpp" #include #include #if !defined ZMQ_HAVE_WINDOWS #include #endif #if defined(ZMQ_USE_TWEETNACL) #include "tweetnacl.h" #elif defined(ZMQ_USE_LIBSODIUM) #include "sodium.h" #endif void zmq_sleep (int seconds_) { #if defined ZMQ_HAVE_WINDOWS Sleep (seconds_ * 1000); #else sleep (seconds_); #endif } void *zmq_stopwatch_start () { uint64_t *watch = (uint64_t *) malloc (sizeof (uint64_t)); alloc_assert (watch); *watch = zmq::clock_t::now_us (); return (void *) watch; } unsigned long zmq_stopwatch_intermediate (void *watch_) { uint64_t end = zmq::clock_t::now_us (); uint64_t start = *(uint64_t *) watch_; return (unsigned long) (end - start); } unsigned long zmq_stopwatch_stop (void *watch_) { unsigned long res = zmq_stopwatch_intermediate (watch_); free (watch_); return res; } void *zmq_threadstart (zmq_thread_fn *func, void *arg) { zmq::thread_t *thread = new (std::nothrow) zmq::thread_t; alloc_assert (thread); thread->start (func, arg); return thread; } void zmq_threadclose (void *thread) { zmq::thread_t *pThread = static_cast (thread); pThread->stop (); LIBZMQ_DELETE (pThread); } // Z85 codec, taken from 0MQ RFC project, implements RFC32 Z85 encoding // Maps base 256 to base 85 static char encoder[85 + 1] = {"0123456789" "abcdefghij" "klmnopqrst" "uvwxyzABCD" "EFGHIJKLMN" "OPQRSTUVWX" "YZ.-:+=^!/" "*?&<>()[]{" "}@%$#"}; // Maps base 85 to base 256 // We chop off lower 32 and higher 128 ranges // 0xFF denotes invalid characters within this range static uint8_t decoder[96] = { 0xFF, 0x44, 0xFF, 0x54, 0x53, 0x52, 0x48, 0xFF, 0x4B, 0x4C, 0x46, 0x41, 0xFF, 0x3F, 0x3E, 0x45, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x40, 0xFF, 0x49, 0x42, 0x4A, 0x47, 0x51, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x4D, 0xFF, 0x4E, 0x43, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x4F, 0xFF, 0x50, 0xFF, 0xFF}; // -------------------------------------------------------------------------- // Encode a binary frame as a string; destination string MUST be at least // size * 5 / 4 bytes long plus 1 byte for the null terminator. Returns // dest. Size must be a multiple of 4. // Returns NULL and sets errno = EINVAL for invalid input. char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size) { if (size % 4 != 0) { errno = EINVAL; return NULL; } unsigned int char_nbr = 0; unsigned int byte_nbr = 0; uint32_t value = 0; while (byte_nbr < size) { // Accumulate value in base 256 (binary) value = value * 256 + data[byte_nbr++]; if (byte_nbr % 4 == 0) { // Output value in base 85 unsigned int divisor = 85 * 85 * 85 * 85; while (divisor) { dest[char_nbr++] = encoder[value / divisor % 85]; divisor /= 85; } value = 0; } } assert (char_nbr == size * 5 / 4); dest[char_nbr] = 0; return dest; } // -------------------------------------------------------------------------- // Decode an encoded string into a binary frame; dest must be at least // strlen (string) * 4 / 5 bytes long. Returns dest. strlen (string) // must be a multiple of 5. // Returns NULL and sets errno = EINVAL for invalid input. uint8_t *zmq_z85_decode (uint8_t *dest, const char *string) { unsigned int byte_nbr = 0; unsigned int char_nbr = 0; uint32_t value = 0; while (string[char_nbr]) { // Accumulate value in base 85 if (UINT32_MAX / 85 < value) { // Invalid z85 encoding, represented value exceeds 0xffffffff goto error_inval; } value *= 85; uint8_t index = string[char_nbr++] - 32; if (index >= sizeof (decoder)) { // Invalid z85 encoding, character outside range goto error_inval; } uint32_t summand = decoder[index]; if (summand == 0xFF || summand > (UINT32_MAX - value)) { // Invalid z85 encoding, invalid character or represented value exceeds 0xffffffff goto error_inval; } value += summand; if (char_nbr % 5 == 0) { // Output value in base 256 unsigned int divisor = 256 * 256 * 256; while (divisor) { dest[byte_nbr++] = value / divisor % 256; divisor /= 256; } value = 0; } } if (char_nbr % 5 != 0) { goto error_inval; } assert (byte_nbr == strlen (string) * 4 / 5); return dest; error_inval: errno = EINVAL; return NULL; } // -------------------------------------------------------------------------- // Generate a public/private keypair with tweetnacl or libsodium. // Generated keys will be 40 byte z85-encoded strings. // Returns 0 on success, -1 on failure, setting errno. // Sets errno = ENOTSUP in the absence of a CURVE library. int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key) { #if defined(ZMQ_HAVE_CURVE) #if crypto_box_PUBLICKEYBYTES != 32 || crypto_box_SECRETKEYBYTES != 32 #error "CURVE encryption library not built correctly" #endif uint8_t public_key[32]; uint8_t secret_key[32]; zmq::random_open (); int res = crypto_box_keypair (public_key, secret_key); zmq_z85_encode (z85_public_key, public_key, 32); zmq_z85_encode (z85_secret_key, secret_key, 32); zmq::random_close (); return res; #else (void) z85_public_key, (void) z85_secret_key; errno = ENOTSUP; return -1; #endif } // -------------------------------------------------------------------------- // Derive the public key from a private key using tweetnacl or libsodium. // Derived key will be 40 byte z85-encoded string. // Returns 0 on success, -1 on failure, setting errno. // Sets errno = ENOTSUP in the absence of a CURVE library. int zmq_curve_public (char *z85_public_key, const char *z85_secret_key) { #if defined(ZMQ_HAVE_CURVE) #if crypto_box_PUBLICKEYBYTES != 32 || crypto_box_SECRETKEYBYTES != 32 #error "CURVE encryption library not built correctly" #endif uint8_t public_key[32]; uint8_t secret_key[32]; zmq::random_open (); if (zmq_z85_decode (secret_key, z85_secret_key) == NULL) return -1; // Return codes are suppressed as none of these can actually fail. crypto_scalarmult_base (public_key, secret_key); zmq_z85_encode (z85_public_key, public_key, 32); zmq::random_close (); return 0; #else (void) z85_public_key, (void) z85_secret_key; errno = ENOTSUP; return -1; #endif } // -------------------------------------------------------------------------- // Initialize a new atomic counter, which is set to zero void *zmq_atomic_counter_new (void) { zmq::atomic_counter_t *counter = new (std::nothrow) zmq::atomic_counter_t; alloc_assert (counter); return counter; } // Se the value of the atomic counter void zmq_atomic_counter_set (void *counter_, int value_) { ((zmq::atomic_counter_t *) counter_)->set (value_); } // Increment the atomic counter, and return the old value int zmq_atomic_counter_inc (void *counter_) { return ((zmq::atomic_counter_t *) counter_)->add (1); } // Decrement the atomic counter and return 1 (if counter >= 1), or // 0 if counter hit zero. int zmq_atomic_counter_dec (void *counter_) { return ((zmq::atomic_counter_t *) counter_)->sub (1) ? 1 : 0; } // Return actual value of atomic counter int zmq_atomic_counter_value (void *counter_) { return ((zmq::atomic_counter_t *) counter_)->get (); } // Destroy atomic counter, and set reference to NULL void zmq_atomic_counter_destroy (void **counter_p_) { delete ((zmq::atomic_counter_t *) *counter_p_); *counter_p_ = NULL; } zeromq-4.2.5/src/tcp_address.hpp0000664000372000037200000000735013255253220017540 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TCP_ADDRESS_HPP_INCLUDED__ #define __ZMQ_TCP_ADDRESS_HPP_INCLUDED__ #if !defined ZMQ_HAVE_WINDOWS #include #include #endif namespace zmq { class tcp_address_t { public: tcp_address_t (); tcp_address_t (const sockaddr *sa, socklen_t sa_len); virtual ~tcp_address_t (); // This function translates textual TCP address into an address // structure. If 'local' is true, names are resolved as local interface // names. If it is false, names are resolved as remote hostnames. // If 'ipv6' is true, the name may resolve to IPv6 address. int resolve (const char *name_, bool local_, bool ipv6_, bool is_src_ = false); // The opposite to resolve() virtual int to_string (std::string &addr_); #if defined ZMQ_HAVE_WINDOWS unsigned short family () const; #else sa_family_t family () const; #endif const sockaddr *addr () const; socklen_t addrlen () const; const sockaddr *src_addr () const; socklen_t src_addrlen () const; bool has_src_addr () const; protected: int resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_ = false); int resolve_interface (const char *interface_, bool ipv6_, bool is_src_ = false); int resolve_hostname (const char *hostname_, bool ipv6_, bool is_src_ = false); #if defined ZMQ_HAVE_WINDOWS int get_interface_name (unsigned long index, char **dest) const; int wchar_to_utf8 (const WCHAR *src, char **dest) const; #endif union { sockaddr generic; sockaddr_in ipv4; sockaddr_in6 ipv6; } address; union { sockaddr generic; sockaddr_in ipv4; sockaddr_in6 ipv6; } source_address; bool _has_src_addr; }; class tcp_address_mask_t : public tcp_address_t { public: tcp_address_mask_t (); // This function enhances tcp_address_t::resolve() with ability to parse // additional cidr-like(/xx) mask value at the end of the name string. // Works only with remote hostnames. int resolve (const char *name_, bool ipv6_); // The opposite to resolve() int to_string (std::string &addr_); int mask () const; bool match_address (const struct sockaddr *ss, const socklen_t ss_len) const; private: int address_mask; }; } #endif zeromq-4.2.5/src/gather.hpp0000664000372000037200000000433413255253220016516 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GATHER_HPP_INCLUDED__ #define __ZMQ_GATHER_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "fq.hpp" namespace zmq { class ctx_t; class pipe_t; class msg_t; class io_thread_t; class gather_t : public socket_base_t { public: gather_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~gather_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Fair queueing object for inbound pipes. fq_t fq; gather_t (const gather_t &); const gather_t &operator= (const gather_t &); }; } #endif zeromq-4.2.5/src/dish.cpp0000664000372000037200000002221313255253220016162 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "macros.hpp" #include "dish.hpp" #include "err.hpp" zmq::dish_t::dish_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true), has_message (false) { options.type = ZMQ_DISH; // When socket is being closed down we don't want to wait till pending // subscription commands are sent to the wire. options.linger.store (0); int rc = message.init (); errno_assert (rc == 0); } zmq::dish_t::~dish_t () { int rc = message.close (); errno_assert (rc == 0); } void zmq::dish_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); fq.attach (pipe_); dist.attach (pipe_); // Send all the cached subscriptions to the new upstream peer. send_subscriptions (pipe_); } void zmq::dish_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::dish_t::xwrite_activated (pipe_t *pipe_) { dist.activated (pipe_); } void zmq::dish_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); dist.pipe_terminated (pipe_); } void zmq::dish_t::xhiccuped (pipe_t *pipe_) { // Send all the cached subscriptions to the hiccuped pipe. send_subscriptions (pipe_); } int zmq::dish_t::xjoin (const char *group_) { std::string group = std::string (group_); if (group.length () > ZMQ_GROUP_MAX_LENGTH) { errno = EINVAL; return -1; } subscriptions_t::iterator it = subscriptions.find (group); // User cannot join same group twice if (it != subscriptions.end ()) { errno = EINVAL; return -1; } subscriptions.insert (group); msg_t msg; int rc = msg.init_join (); errno_assert (rc == 0); rc = msg.set_group (group_); errno_assert (rc == 0); int err = 0; rc = dist.send_to_all (&msg); if (rc != 0) err = errno; int rc2 = msg.close (); errno_assert (rc2 == 0); if (rc != 0) errno = err; return rc; } int zmq::dish_t::xleave (const char *group_) { std::string group = std::string (group_); if (group.length () > ZMQ_GROUP_MAX_LENGTH) { errno = EINVAL; return -1; } subscriptions_t::iterator it = std::find (subscriptions.begin (), subscriptions.end (), group); if (it == subscriptions.end ()) { errno = EINVAL; return -1; } subscriptions.erase (it); msg_t msg; int rc = msg.init_leave (); errno_assert (rc == 0); rc = msg.set_group (group_); errno_assert (rc == 0); int err = 0; rc = dist.send_to_all (&msg); if (rc != 0) err = errno; int rc2 = msg.close (); errno_assert (rc2 == 0); if (rc != 0) errno = err; return rc; } int zmq::dish_t::xsend (msg_t *msg_) { LIBZMQ_UNUSED (msg_); errno = ENOTSUP; return -1; } bool zmq::dish_t::xhas_out () { // Subscription can be added/removed anytime. return true; } int zmq::dish_t::xrecv (msg_t *msg_) { // If there's already a message prepared by a previous call to zmq_poll, // return it straight ahead. if (has_message) { int rc = msg_->move (message); errno_assert (rc == 0); has_message = false; return 0; } while (true) { // Get a message using fair queueing algorithm. int rc = fq.recv (msg_); // If there's no message available, return immediately. // The same when error occurs. if (rc != 0) return -1; // Filtering non matching messages subscriptions_t::iterator it = subscriptions.find (std::string (msg_->group ())); if (it != subscriptions.end ()) return 0; } } bool zmq::dish_t::xhas_in () { // If there's already a message prepared by a previous call to zmq_poll, // return straight ahead. if (has_message) return true; while (true) { // Get a message using fair queueing algorithm. int rc = fq.recv (&message); // If there's no message available, return immediately. // The same when error occurs. if (rc != 0) { errno_assert (errno == EAGAIN); return false; } // Filtering non matching messages subscriptions_t::iterator it = subscriptions.find (std::string (message.group ())); if (it != subscriptions.end ()) { has_message = true; return true; } } } const zmq::blob_t &zmq::dish_t::get_credential () const { return fq.get_credential (); } void zmq::dish_t::send_subscriptions (pipe_t *pipe_) { for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end (); ++it) { msg_t msg; int rc = msg.init_join (); errno_assert (rc == 0); rc = msg.set_group (it->c_str ()); errno_assert (rc == 0); // Send it to the pipe. pipe_->write (&msg); msg.close (); } pipe_->flush (); } zmq::dish_session_t::dish_session_t (io_thread_t *io_thread_, bool connect_, socket_base_t *socket_, const options_t &options_, address_t *addr_) : session_base_t (io_thread_, connect_, socket_, options_, addr_), state (group) { } zmq::dish_session_t::~dish_session_t () { } int zmq::dish_session_t::push_msg (msg_t *msg_) { if (state == group) { if ((msg_->flags () & msg_t::more) != msg_t::more) { errno = EFAULT; return -1; } if (msg_->size () > ZMQ_GROUP_MAX_LENGTH) { errno = EFAULT; return -1; } group_msg = *msg_; state = body; int rc = msg_->init (); errno_assert (rc == 0); return 0; } else { const char *group_setting = msg_->group (); int rc; if (group_setting[0] != 0) goto has_group; // Set the message group rc = msg_->set_group ((char *) group_msg.data (), group_msg.size ()); errno_assert (rc == 0); // We set the group, so we don't need the group_msg anymore rc = group_msg.close (); errno_assert (rc == 0); has_group: // Thread safe socket doesn't support multipart messages if ((msg_->flags () & msg_t::more) == msg_t::more) { errno = EFAULT; return -1; } // Push message to dish socket rc = session_base_t::push_msg (msg_); if (rc == 0) state = group; return rc; } } int zmq::dish_session_t::pull_msg (msg_t *msg_) { int rc = session_base_t::pull_msg (msg_); if (rc != 0) return rc; if (!msg_->is_join () && !msg_->is_leave ()) return rc; else { int group_length = (int) strlen (msg_->group ()); msg_t command; int offset; if (msg_->is_join ()) { rc = command.init_size (group_length + 5); errno_assert (rc == 0); offset = 5; memcpy (command.data (), "\4JOIN", 5); } else { rc = command.init_size (group_length + 6); errno_assert (rc == 0); offset = 6; memcpy (command.data (), "\5LEAVE", 6); } command.set_flags (msg_t::command); char *command_data = (char *) command.data (); // Copy the group memcpy (command_data + offset, msg_->group (), group_length); // Close the join message rc = msg_->close (); errno_assert (rc == 0); *msg_ = command; return 0; } } void zmq::dish_session_t::reset () { session_base_t::reset (); state = group; } zeromq-4.2.5/src/norm_engine.hpp0000664000372000037200000001240313255253220017540 0ustar00travistravis00000000000000 #ifndef __ZMQ_NORM_ENGINE_HPP_INCLUDED__ #define __ZMQ_NORM_ENGINE_HPP_INCLUDED__ #if defined ZMQ_HAVE_NORM #include "io_object.hpp" #include "i_engine.hpp" #include "options.hpp" #include "v2_decoder.hpp" #include "v2_encoder.hpp" #include namespace zmq { class io_thread_t; class session_base_t; class norm_engine_t : public io_object_t, public i_engine { public: norm_engine_t (zmq::io_thread_t *parent_, const options_t &options_); ~norm_engine_t (); // create NORM instance, session, etc int init (const char *network_, bool send, bool recv); void shutdown (); // i_engine interface implementation. // Plug the engine to the session. virtual void plug (zmq::io_thread_t *io_thread_, class session_base_t *session_); // Terminate and deallocate the engine. Note that 'detached' // events are not fired on termination. virtual void terminate (); // This method is called by the session to signalise that more // messages can be written to the pipe. virtual void restart_input (); // This method is called by the session to signalise that there // are messages to send available. virtual void restart_output (); virtual void zap_msg_available (){}; virtual const char *get_endpoint () const; // i_poll_events interface implementation. // (we only need in_event() for NormEvent notification) // (i.e., don't have any output events or timers (yet)) void in_event (); private: void unplug (); void send_data (); void recv_data (NormObjectHandle stream); enum { BUFFER_SIZE = 2048 }; // Used to keep track of streams from multiple senders class NormRxStreamState { public: NormRxStreamState (NormObjectHandle normStream, int64_t maxMsgSize, bool zeroCopy); ~NormRxStreamState (); NormObjectHandle GetStreamHandle () const { return norm_stream; } bool Init (); void SetRxReady (bool state) { rx_ready = state; } bool IsRxReady () const { return rx_ready; } void SetSync (bool state) { in_sync = state; } bool InSync () const { return in_sync; } // These are used to feed data to decoder // and its underlying "msg" buffer char *AccessBuffer () { return (char *) (buffer_ptr + buffer_count); } size_t GetBytesNeeded () const { return (buffer_size - buffer_count); } void IncrementBufferCount (size_t count) { buffer_count += count; } msg_t *AccessMsg () { return zmq_decoder->msg (); } // This invokes the decoder "decode" method // returning 0 if more data is needed, // 1 if the message is complete, If an error // occurs the 'sync' is dropped and the // decoder re-initialized int Decode (); class List { public: List (); ~List (); void Append (NormRxStreamState &item); void Remove (NormRxStreamState &item); bool IsEmpty () const { return (NULL == head); } void Destroy (); class Iterator { public: Iterator (const List &list); NormRxStreamState *GetNextItem (); private: NormRxStreamState *next_item; }; friend class Iterator; private: NormRxStreamState *head; NormRxStreamState *tail; }; // end class zmq::norm_engine_t::NormRxStreamState::List friend class List; List *AccessList () { return list; } private: NormObjectHandle norm_stream; int64_t max_msg_size; bool zero_copy; bool in_sync; bool rx_ready; v2_decoder_t *zmq_decoder; bool skip_norm_sync; unsigned char *buffer_ptr; size_t buffer_size; size_t buffer_count; NormRxStreamState *prev; NormRxStreamState *next; NormRxStreamState::List *list; }; // end class zmq::norm_engine_t::NormRxStreamState session_base_t *zmq_session; options_t options; NormInstanceHandle norm_instance; handle_t norm_descriptor_handle; NormSessionHandle norm_session; bool is_sender; bool is_receiver; // Sender state msg_t tx_msg; v2_encoder_t zmq_encoder; // for tx messages (we use v2 for now) NormObjectHandle norm_tx_stream; bool tx_first_msg; bool tx_more_bit; bool zmq_output_ready; // zmq has msg(s) to send bool norm_tx_ready; // norm has tx queue vacancy // TBD - maybe don't need buffer if can access zmq message buffer directly? char tx_buffer[BUFFER_SIZE]; unsigned int tx_index; unsigned int tx_len; // Receiver state // Lists of norm rx streams from remote senders bool zmq_input_ready; // zmq ready to receive msg(s) NormRxStreamState::List rx_pending_list; // rx streams waiting for data reception NormRxStreamState::List rx_ready_list; // rx streams ready for NormStreamRead() NormRxStreamState::List msg_ready_list; // rx streams w/ msg ready for push to zmq }; // end class norm_engine_t } #endif // ZMQ_HAVE_NORM #endif // !__ZMQ_NORM_ENGINE_HPP_INCLUDED__ zeromq-4.2.5/src/curve_server.hpp0000664000372000037200000000566413255253220017765 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CURVE_SERVER_HPP_INCLUDED__ #define __ZMQ_CURVE_SERVER_HPP_INCLUDED__ #ifdef ZMQ_HAVE_CURVE #include "curve_mechanism_base.hpp" #include "options.hpp" #include "zap_client.hpp" namespace zmq { #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4250) #endif class curve_server_t : public zap_client_common_handshake_t, public curve_mechanism_base_t { public: curve_server_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_); virtual ~curve_server_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual int encode (msg_t *msg_); virtual int decode (msg_t *msg_); private: // Our secret key (s) uint8_t secret_key[crypto_box_SECRETKEYBYTES]; // Our short-term public key (S') uint8_t cn_public[crypto_box_PUBLICKEYBYTES]; // Our short-term secret key (s') uint8_t cn_secret[crypto_box_SECRETKEYBYTES]; // Client's short-term public key (C') uint8_t cn_client[crypto_box_PUBLICKEYBYTES]; // Key used to produce cookie uint8_t cookie_key[crypto_secretbox_KEYBYTES]; int process_hello (msg_t *msg_); int produce_welcome (msg_t *msg_); int process_initiate (msg_t *msg_); int produce_ready (msg_t *msg_); int produce_error (msg_t *msg_) const; void send_zap_request (const uint8_t *key); }; #ifdef _MSC_VER #pragma warning(pop) #endif } #endif #endif zeromq-4.2.5/src/scatter.hpp0000664000372000037200000000427713255253220016717 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SCATTER_HPP_INCLUDED__ #define __ZMQ_SCATTER_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "lb.hpp" namespace zmq { class ctx_t; class pipe_t; class msg_t; class io_thread_t; class scatter_t : public socket_base_t { public: scatter_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~scatter_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); bool xhas_out (); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Load balancer managing the outbound pipes. lb_t lb; scatter_t (const scatter_t &); const scatter_t &operator= (const scatter_t &); }; } #endif zeromq-4.2.5/src/options.hpp0000664000372000037200000002174613255253220016745 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_OPTIONS_HPP_INCLUDED__ #define __ZMQ_OPTIONS_HPP_INCLUDED__ #include #include #include #include #include "atomic_ptr.hpp" #include "stddef.h" #include "stdint.hpp" #include "tcp_address.hpp" #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED #include #endif #ifdef ZMQ_HAVE_LOCAL_PEERCRED #include #endif #if __cplusplus >= 201103L #include #endif // Normal base 256 key is 32 bytes #define CURVE_KEYSIZE 32 // Key encoded using Z85 is 40 bytes #define CURVE_KEYSIZE_Z85 40 namespace zmq { struct options_t { options_t (); int set_curve_key (uint8_t *destination, const void *optval_, size_t optvallen_); int setsockopt (int option_, const void *optval_, size_t optvallen_); int getsockopt (int option_, void *optval_, size_t *optvallen_) const; bool is_valid (int option_) const; // High-water marks for message pipes. int sndhwm; int rcvhwm; // I/O thread affinity. uint64_t affinity; // Socket routing id. unsigned char routing_id_size; unsigned char routing_id[256]; // Maximum transfer rate [kb/s]. Default 100kb/s. int rate; // Reliability time interval [ms]. Default 10 seconds. int recovery_ivl; // Sets the time-to-live field in every multicast packet sent. int multicast_hops; // Sets the maximum transport data unit size in every multicast // packet sent. int multicast_maxtpdu; // SO_SNDBUF and SO_RCVBUF to be passed to underlying transport sockets. int sndbuf; int rcvbuf; // Type of service (containing DSCP and ECN socket options) int tos; // Socket type. int type; // Linger time, in milliseconds. atomic_value_t linger; // Maximum interval in milliseconds beyond which userspace will // timeout connect(). // Default 0 (unused) int connect_timeout; // Maximum interval in milliseconds beyond which TCP will timeout // retransmitted packets. // Default 0 (unused) int tcp_maxrt; // Minimum interval between attempts to reconnect, in milliseconds. // Default 100ms int reconnect_ivl; // Maximum interval between attempts to reconnect, in milliseconds. // Default 0 (unused) int reconnect_ivl_max; // Maximum backlog for pending connections. int backlog; // Maximal size of message to handle. int64_t maxmsgsize; // The timeout for send/recv operations for this socket, in milliseconds. int rcvtimeo; int sndtimeo; // If true, IPv6 is enabled (as well as IPv4) bool ipv6; // If 1, connecting pipes are not attached immediately, meaning a send() // on a socket with only connecting pipes would block int immediate; // If 1, (X)SUB socket should filter the messages. If 0, it should not. bool filter; // If true, the subscription matching on (X)PUB and (X)SUB sockets // is reversed. Messages are sent to and received by non-matching // sockets. bool invert_matching; // If true, the routing id message is forwarded to the socket. bool recv_routing_id; // if true, router socket accepts non-zmq tcp connections bool raw_socket; bool raw_notify; // Provide connect notifications // Address of SOCKS proxy std::string socks_proxy_address; // TCP keep-alive settings. // Defaults to -1 = do not change socket options int tcp_keepalive; int tcp_keepalive_cnt; int tcp_keepalive_idle; int tcp_keepalive_intvl; // TCP accept() filters typedef std::vector tcp_accept_filters_t; tcp_accept_filters_t tcp_accept_filters; // IPC accept() filters #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED typedef std::set ipc_uid_accept_filters_t; ipc_uid_accept_filters_t ipc_uid_accept_filters; typedef std::set ipc_gid_accept_filters_t; ipc_gid_accept_filters_t ipc_gid_accept_filters; #endif #if defined ZMQ_HAVE_SO_PEERCRED typedef std::set ipc_pid_accept_filters_t; ipc_pid_accept_filters_t ipc_pid_accept_filters; #endif // Security mechanism for all connections on this socket int mechanism; // If peer is acting as server for PLAIN or CURVE mechanisms int as_server; // ZAP authentication domain std::string zap_domain; // Security credentials for PLAIN mechanism std::string plain_username; std::string plain_password; // Security credentials for CURVE mechanism uint8_t curve_public_key[CURVE_KEYSIZE]; uint8_t curve_secret_key[CURVE_KEYSIZE]; uint8_t curve_server_key[CURVE_KEYSIZE]; // Principals for GSSAPI mechanism std::string gss_principal; std::string gss_service_principal; // Name types GSSAPI principals int gss_principal_nt; int gss_service_principal_nt; // If true, gss encryption will be disabled bool gss_plaintext; // ID of the socket. int socket_id; // If true, socket conflates outgoing/incoming messages. // Applicable to dealer, push/pull, pub/sub socket types. // Cannot receive multi-part messages. // Ignores hwm bool conflate; // If connection handshake is not done after this many milliseconds, // close socket. Default is 30 secs. 0 means no handshake timeout. int handshake_ivl; bool connected; // If remote peer receives a PING message and doesn't receive another // message within the ttl value, it should close the connection // (measured in tenths of a second) uint16_t heartbeat_ttl; // Time in milliseconds between sending heartbeat PING messages. int heartbeat_interval; // Time in milliseconds to wait for a PING response before disconnecting int heartbeat_timeout; #if defined ZMQ_HAVE_VMCI uint64_t vmci_buffer_size; uint64_t vmci_buffer_min_size; uint64_t vmci_buffer_max_size; int vmci_connect_timeout; #endif // When creating a new ZMQ socket, if this option is set the value // will be used as the File Descriptor instead of allocating a new // one via the socket () system call. int use_fd; // Device to bind the underlying socket to, eg. VRF or interface std::string bound_device; // Enforce a non-empty ZAP domain requirement for PLAIN auth bool zap_enforce_domain; // Use of loopback fastpath. bool loopback_fastpath; // Use zero copy strategy for storing message content when decoding. bool zero_copy; // Application metadata std::map app_metadata; }; int do_getsockopt (void *const optval_, size_t *const optvallen_, const void *value_, const size_t value_len_); template int do_getsockopt (void *const optval_, size_t *const optvallen_, T value_) { #if __cplusplus >= 201103L && (!defined(__GNUC__) || __GNUC__ > 5) static_assert (std::is_trivially_copyable::value, "invalid use of do_getsockopt"); #endif return do_getsockopt (optval_, optvallen_, &value_, sizeof (T)); } int do_getsockopt (void *const optval_, size_t *const optvallen_, const std::string &value_); int do_setsockopt_int_as_bool_strict (const void *const optval_, const size_t optvallen_, bool *out_value_); int do_setsockopt_int_as_bool_relaxed (const void *const optval_, const size_t optvallen_, bool *out_value_); } #endif zeromq-4.2.5/src/plain_client.cpp0000664000372000037200000001553513255253220017705 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include #include "msg.hpp" #include "err.hpp" #include "plain_client.hpp" #include "session_base.hpp" zmq::plain_client_t::plain_client_t (session_base_t *const session_, const options_t &options_) : mechanism_base_t (session_, options_), state (sending_hello) { } zmq::plain_client_t::~plain_client_t () { } int zmq::plain_client_t::next_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case sending_hello: rc = produce_hello (msg_); if (rc == 0) state = waiting_for_welcome; break; case sending_initiate: rc = produce_initiate (msg_); if (rc == 0) state = waiting_for_ready; break; default: errno = EAGAIN; rc = -1; } return rc; } int zmq::plain_client_t::process_handshake_command (msg_t *msg_) { const unsigned char *cmd_data = static_cast (msg_->data ()); const size_t data_size = msg_->size (); int rc = 0; if (data_size >= 8 && !memcmp (cmd_data, "\7WELCOME", 8)) rc = process_welcome (cmd_data, data_size); else if (data_size >= 6 && !memcmp (cmd_data, "\5READY", 6)) rc = process_ready (cmd_data, data_size); else if (data_size >= 6 && !memcmp (cmd_data, "\5ERROR", 6)) rc = process_error (cmd_data, data_size); else { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; rc = -1; } if (rc == 0) { rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } return rc; } zmq::mechanism_t::status_t zmq::plain_client_t::status () const { if (state == ready) return mechanism_t::ready; else if (state == error_command_received) return mechanism_t::error; else return mechanism_t::handshaking; } int zmq::plain_client_t::produce_hello (msg_t *msg_) const { const std::string username = options.plain_username; zmq_assert (username.length () < 256); const std::string password = options.plain_password; zmq_assert (password.length () < 256); const size_t command_size = 6 + 1 + username.length () + 1 + password.length (); const int rc = msg_->init_size (command_size); errno_assert (rc == 0); unsigned char *ptr = static_cast (msg_->data ()); memcpy (ptr, "\x05HELLO", 6); ptr += 6; *ptr++ = static_cast (username.length ()); memcpy (ptr, username.c_str (), username.length ()); ptr += username.length (); *ptr++ = static_cast (password.length ()); memcpy (ptr, password.c_str (), password.length ()); return 0; } int zmq::plain_client_t::process_welcome (const unsigned char *cmd_data, size_t data_size) { LIBZMQ_UNUSED (cmd_data); if (state != waiting_for_welcome) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (data_size != 8) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME); errno = EPROTO; return -1; } state = sending_initiate; return 0; } int zmq::plain_client_t::produce_initiate (msg_t *msg_) const { make_command_with_basic_properties (msg_, "\x08INITIATE", 9); return 0; } int zmq::plain_client_t::process_ready (const unsigned char *cmd_data, size_t data_size) { if (state != waiting_for_ready) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } const int rc = parse_metadata (cmd_data + 6, data_size - 6); if (rc == 0) state = ready; else session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA); return rc; } int zmq::plain_client_t::process_error (const unsigned char *cmd_data, size_t data_size) { if (state != waiting_for_welcome && state != waiting_for_ready) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (data_size < 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const size_t error_reason_len = static_cast (cmd_data[6]); if (error_reason_len > data_size - 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const char *error_reason = reinterpret_cast (cmd_data) + 7; handle_error_reason (error_reason, error_reason_len); state = error_command_received; return 0; } zeromq-4.2.5/src/curve_client.hpp0000664000372000037200000000517613255253220017733 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CURVE_CLIENT_HPP_INCLUDED__ #define __ZMQ_CURVE_CLIENT_HPP_INCLUDED__ #ifdef ZMQ_HAVE_CURVE #include "curve_mechanism_base.hpp" #include "options.hpp" #include "curve_client_tools.hpp" namespace zmq { class msg_t; class session_base_t; class curve_client_t : public curve_mechanism_base_t { public: curve_client_t (session_base_t *session_, const options_t &options_); virtual ~curve_client_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual int encode (msg_t *msg_); virtual int decode (msg_t *msg_); virtual status_t status () const; private: enum state_t { send_hello, expect_welcome, send_initiate, expect_ready, error_received, connected }; // Current FSM state state_t state; // CURVE protocol tools curve_client_tools_t tools; int produce_hello (msg_t *msg_); int process_welcome (const uint8_t *cmd_data, size_t data_size); int produce_initiate (msg_t *msg_); int process_ready (const uint8_t *cmd_data, size_t data_size); int process_error (const uint8_t *cmd_data, size_t data_size); }; } #endif #endif zeromq-4.2.5/src/timers.hpp0000664000372000037200000000634613255253220016554 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TIMERS_HPP_INCLUDED__ #define __ZMQ_TIMERS_HPP_INCLUDED__ #include #include #include #include "clock.hpp" namespace zmq { typedef void(timers_timer_fn) (int timer_id, void *arg); class timers_t { public: timers_t (); ~timers_t (); // Add timer to the set, timer repeats forever, or until cancel is called. // Returns a timer_id that is used to cancel the timer. // Returns -1 if there was an error. int add (size_t interval, timers_timer_fn handler, void *arg); // Set the interval of the timer. // This method is slow, cancelling exsting and adding a new timer yield better performance. // Returns 0 on success and -1 on error. int set_interval (int timer_id, size_t interval); // Reset the timer. // This method is slow, cancelling exsting and adding a new timer yield better performance. // Returns 0 on success and -1 on error. int reset (int timer_id); // Cancel a timer. // Returns 0 on success and -1 on error. int cancel (int timer_id); // Returns the time in millisecond until the next timer. // Returns -1 if no timer is due. long timeout (); // Execute timers. // Return 0 if all succeed and -1 if error. int execute (); // Return false if object is not a timers class. bool check_tag (); private: // Used to check whether the object is a timers class. uint32_t tag; int next_timer_id; // Clock instance. clock_t clock; typedef struct timer_t { int timer_id; size_t interval; timers_timer_fn *handler; void *arg; } timer_t; typedef std::multimap timersmap_t; timersmap_t timers; typedef std::set cancelled_timers_t; cancelled_timers_t cancelled_timers; timers_t (const timers_t &); const timers_t &operator= (const timers_t &); struct match_by_id; }; } #endif zeromq-4.2.5/src/client.hpp0000664000372000037200000000465513255253220016530 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CLIENT_HPP_INCLUDED__ #define __ZMQ_CLIENT_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "fq.hpp" #include "lb.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class socket_base_t; class client_t : public socket_base_t { public: client_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~client_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Messages are fair-queued from inbound pipes. And load-balanced to // the outbound pipes. fq_t fq; lb_t lb; client_t (const client_t &); const client_t &operator= (const client_t &); }; } #endif zeromq-4.2.5/src/poller_base.cpp0000664000372000037200000000773313255253220017534 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "poller_base.hpp" #include "i_poll_events.hpp" #include "err.hpp" zmq::poller_base_t::poller_base_t () { } zmq::poller_base_t::~poller_base_t () { // Make sure there is no more load on the shutdown. zmq_assert (get_load () == 0); } int zmq::poller_base_t::get_load () const { return load.get (); } void zmq::poller_base_t::adjust_load (int amount_) { if (amount_ > 0) load.add (amount_); else if (amount_ < 0) load.sub (-amount_); } void zmq::poller_base_t::add_timer (int timeout_, i_poll_events *sink_, int id_) { uint64_t expiration = clock.now_ms () + timeout_; timer_info_t info = {sink_, id_}; timers.insert (timers_t::value_type (expiration, info)); } void zmq::poller_base_t::cancel_timer (i_poll_events *sink_, int id_) { // Complexity of this operation is O(n). We assume it is rarely used. for (timers_t::iterator it = timers.begin (); it != timers.end (); ++it) if (it->second.sink == sink_ && it->second.id == id_) { timers.erase (it); return; } // Timer not found. zmq_assert (false); } uint64_t zmq::poller_base_t::execute_timers () { // Fast track. if (timers.empty ()) return 0; // Get the current time. uint64_t current = clock.now_ms (); // Execute the timers that are already due. timers_t::iterator it = timers.begin (); while (it != timers.end ()) { // If we have to wait to execute the item, same will be true about // all the following items (multimap is sorted). Thus we can stop // checking the subsequent timers and return the time to wait for // the next timer (at least 1ms). if (it->first > current) return it->first - current; // Trigger the timer. it->second.sink->timer_event (it->second.id); // Remove it from the list of active timers. timers_t::iterator o = it; ++it; timers.erase (o); } // There are no more timers. return 0; } zmq::worker_poller_base_t::worker_poller_base_t (const thread_ctx_t &ctx_) : ctx (ctx_) { } void zmq::worker_poller_base_t::stop_worker () { worker.stop (); } void zmq::worker_poller_base_t::start () { zmq_assert (get_load () > 0); ctx.start_thread (worker, worker_routine, this); } void zmq::worker_poller_base_t::check_thread () { #ifdef _DEBUG zmq_assert (!worker.get_started () || worker.is_current_thread ()); #endif } void zmq::worker_poller_base_t::worker_routine (void *arg_) { ((worker_poller_base_t *) arg_)->loop (); } zeromq-4.2.5/src/yqueue.hpp0000664000372000037200000001575013255253220016565 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_YQUEUE_HPP_INCLUDED__ #define __ZMQ_YQUEUE_HPP_INCLUDED__ #include #include #include "err.hpp" #include "atomic_ptr.hpp" namespace zmq { // yqueue is an efficient queue implementation. The main goal is // to minimise number of allocations/deallocations needed. Thus yqueue // allocates/deallocates elements in batches of N. // // yqueue allows one thread to use push/back function and another one // to use pop/front functions. However, user must ensure that there's no // pop on the empty queue and that both threads don't access the same // element in unsynchronised manner. // // T is the type of the object in the queue. // N is granularity of the queue (how many pushes have to be done till // actual memory allocation is required). #ifdef HAVE_POSIX_MEMALIGN // ALIGN is the memory alignment size to use in the case where we have // posix_memalign available. Default value is 64, this alignment will // prevent two queue chunks from occupying the same CPU cache line on // architectures where cache lines are <= 64 bytes (e.g. most things // except POWER). template class yqueue_t #else template class yqueue_t #endif { public: // Create the queue. inline yqueue_t () { begin_chunk = allocate_chunk (); alloc_assert (begin_chunk); begin_pos = 0; back_chunk = NULL; back_pos = 0; end_chunk = begin_chunk; end_pos = 0; } // Destroy the queue. inline ~yqueue_t () { while (true) { if (begin_chunk == end_chunk) { free (begin_chunk); break; } chunk_t *o = begin_chunk; begin_chunk = begin_chunk->next; free (o); } chunk_t *sc = spare_chunk.xchg (NULL); free (sc); } // Returns reference to the front element of the queue. // If the queue is empty, behaviour is undefined. inline T &front () { return begin_chunk->values[begin_pos]; } // Returns reference to the back element of the queue. // If the queue is empty, behaviour is undefined. inline T &back () { return back_chunk->values[back_pos]; } // Adds an element to the back end of the queue. inline void push () { back_chunk = end_chunk; back_pos = end_pos; if (++end_pos != N) return; chunk_t *sc = spare_chunk.xchg (NULL); if (sc) { end_chunk->next = sc; sc->prev = end_chunk; } else { end_chunk->next = allocate_chunk (); alloc_assert (end_chunk->next); end_chunk->next->prev = end_chunk; } end_chunk = end_chunk->next; end_pos = 0; } // Removes element from the back end of the queue. In other words // it rollbacks last push to the queue. Take care: Caller is // responsible for destroying the object being unpushed. // The caller must also guarantee that the queue isn't empty when // unpush is called. It cannot be done automatically as the read // side of the queue can be managed by different, completely // unsynchronised thread. inline void unpush () { // First, move 'back' one position backwards. if (back_pos) --back_pos; else { back_pos = N - 1; back_chunk = back_chunk->prev; } // Now, move 'end' position backwards. Note that obsolete end chunk // is not used as a spare chunk. The analysis shows that doing so // would require free and atomic operation per chunk deallocated // instead of a simple free. if (end_pos) --end_pos; else { end_pos = N - 1; end_chunk = end_chunk->prev; free (end_chunk->next); end_chunk->next = NULL; } } // Removes an element from the front end of the queue. inline void pop () { if (++begin_pos == N) { chunk_t *o = begin_chunk; begin_chunk = begin_chunk->next; begin_chunk->prev = NULL; begin_pos = 0; // 'o' has been more recently used than spare_chunk, // so for cache reasons we'll get rid of the spare and // use 'o' as the spare. chunk_t *cs = spare_chunk.xchg (o); free (cs); } } private: // Individual memory chunk to hold N elements. struct chunk_t { T values[N]; chunk_t *prev; chunk_t *next; }; inline chunk_t *allocate_chunk () { #ifdef HAVE_POSIX_MEMALIGN void *pv; if (posix_memalign (&pv, ALIGN, sizeof (chunk_t)) == 0) return (chunk_t *) pv; return NULL; #else return (chunk_t *) malloc (sizeof (chunk_t)); #endif } // Back position may point to invalid memory if the queue is empty, // while begin & end positions are always valid. Begin position is // accessed exclusively be queue reader (front/pop), while back and // end positions are accessed exclusively by queue writer (back/push). chunk_t *begin_chunk; int begin_pos; chunk_t *back_chunk; int back_pos; chunk_t *end_chunk; int end_pos; // People are likely to produce and consume at similar rates. In // this scenario holding onto the most recently freed chunk saves // us from having to call malloc/free. atomic_ptr_t spare_chunk; // Disable copying of yqueue. yqueue_t (const yqueue_t &); const yqueue_t &operator= (const yqueue_t &); }; } #endif zeromq-4.2.5/src/array.hpp0000664000372000037200000001030013255253220016350 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ARRAY_INCLUDED__ #define __ZMQ_ARRAY_INCLUDED__ #include #include namespace zmq { // Implementation of fast arrays with O(1) access, insertion and // removal. The array stores pointers rather than objects. // O(1) is achieved by making items inheriting from // array_item_t class which internally stores the position // in the array. // The ID template argument is used to differentiate among arrays // and thus let an object be stored in different arrays. // Base class for objects stored in the array. If you want to store // same object in multiple arrays, each of those arrays has to have // different ID. The item itself has to be derived from instantiations of // array_item_t template for all relevant IDs. template class array_item_t { public: inline array_item_t () : array_index (-1) {} // The destructor doesn't have to be virtual. It is made virtual // just to keep ICC and code checking tools from complaining. inline virtual ~array_item_t () {} inline void set_array_index (int index_) { array_index = index_; } inline int get_array_index () { return array_index; } private: int array_index; array_item_t (const array_item_t &); const array_item_t &operator= (const array_item_t &); }; template class array_t { private: typedef array_item_t item_t; public: typedef typename std::vector::size_type size_type; inline array_t () {} inline ~array_t () {} inline size_type size () { return items.size (); } inline bool empty () { return items.empty (); } inline T *&operator[] (size_type index_) { return items[index_]; } inline void push_back (T *item_) { if (item_) ((item_t *) item_)->set_array_index ((int) items.size ()); items.push_back (item_); } inline void erase (T *item_) { erase (((item_t *) item_)->get_array_index ()); } inline void erase (size_type index_) { if (items.back ()) ((item_t *) items.back ())->set_array_index ((int) index_); items[index_] = items.back (); items.pop_back (); } inline void swap (size_type index1_, size_type index2_) { if (items[index1_]) ((item_t *) items[index1_])->set_array_index ((int) index2_); if (items[index2_]) ((item_t *) items[index2_])->set_array_index ((int) index1_); std::swap (items[index1_], items[index2_]); } inline void clear () { items.clear (); } inline size_type index (T *item_) { return (size_type) ((item_t *) item_)->get_array_index (); } private: typedef std::vector items_t; items_t items; array_t (const array_t &); const array_t &operator= (const array_t &); }; } #endif zeromq-4.2.5/src/pgm_receiver.cpp0000664000372000037200000002071013255253220017702 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #if defined ZMQ_HAVE_OPENPGM #include #include "pgm_receiver.hpp" #include "session_base.hpp" #include "v1_decoder.hpp" #include "stdint.hpp" #include "wire.hpp" #include "err.hpp" zmq::pgm_receiver_t::pgm_receiver_t (class io_thread_t *parent_, const options_t &options_) : io_object_t (parent_), has_rx_timer (false), pgm_socket (true, options_), options (options_), session (NULL), active_tsi (NULL), insize (0) { } zmq::pgm_receiver_t::~pgm_receiver_t () { // Destructor should not be called before unplug. zmq_assert (peers.empty ()); } int zmq::pgm_receiver_t::init (bool udp_encapsulation_, const char *network_) { return pgm_socket.init (udp_encapsulation_, network_); } void zmq::pgm_receiver_t::plug (io_thread_t *io_thread_, session_base_t *session_) { LIBZMQ_UNUSED (io_thread_); // Retrieve PGM fds and start polling. fd_t socket_fd = retired_fd; fd_t waiting_pipe_fd = retired_fd; pgm_socket.get_receiver_fds (&socket_fd, &waiting_pipe_fd); socket_handle = add_fd (socket_fd); pipe_handle = add_fd (waiting_pipe_fd); set_pollin (pipe_handle); set_pollin (socket_handle); session = session_; // If there are any subscriptions already queued in the session, drop them. drop_subscriptions (); } void zmq::pgm_receiver_t::unplug () { // Delete decoders. for (peers_t::iterator it = peers.begin (); it != peers.end (); ++it) { if (it->second.decoder != NULL) { LIBZMQ_DELETE (it->second.decoder); } } peers.clear (); active_tsi = NULL; if (has_rx_timer) { cancel_timer (rx_timer_id); has_rx_timer = false; } rm_fd (socket_handle); rm_fd (pipe_handle); session = NULL; } void zmq::pgm_receiver_t::terminate () { unplug (); delete this; } void zmq::pgm_receiver_t::restart_output () { drop_subscriptions (); } void zmq::pgm_receiver_t::restart_input () { zmq_assert (session != NULL); zmq_assert (active_tsi != NULL); const peers_t::iterator it = peers.find (*active_tsi); zmq_assert (it != peers.end ()); zmq_assert (it->second.joined); // Push the pending message into the session. int rc = session->push_msg (it->second.decoder->msg ()); errno_assert (rc == 0); if (insize > 0) { rc = process_input (it->second.decoder); if (rc == -1) { // HWM reached; we will try later. if (errno == EAGAIN) { session->flush (); return; } // Data error. Delete message decoder, mark the // peer as not joined and drop remaining data. it->second.joined = false; LIBZMQ_DELETE (it->second.decoder); insize = 0; } } // Resume polling. set_pollin (pipe_handle); set_pollin (socket_handle); active_tsi = NULL; in_event (); } const char *zmq::pgm_receiver_t::get_endpoint () const { return ""; } void zmq::pgm_receiver_t::in_event () { // Read data from the underlying pgm_socket. const pgm_tsi_t *tsi = NULL; if (has_rx_timer) { cancel_timer (rx_timer_id); has_rx_timer = false; } // TODO: This loop can effectively block other engines in the same I/O // thread in the case of high load. while (true) { // Get new batch of data. // Note the workaround made not to break strict-aliasing rules. void *tmp = NULL; ssize_t received = pgm_socket.receive (&tmp, &tsi); inpos = (unsigned char *) tmp; // No data to process. This may happen if the packet received is // neither ODATA nor ODATA. if (received == 0) { if (errno == ENOMEM || errno == EBUSY) { const long timeout = pgm_socket.get_rx_timeout (); add_timer (timeout, rx_timer_id); has_rx_timer = true; } break; } // Find the peer based on its TSI. peers_t::iterator it = peers.find (*tsi); // Data loss. Delete decoder and mark the peer as disjoint. if (received == -1) { if (it != peers.end ()) { it->second.joined = false; if (it->second.decoder != NULL) { LIBZMQ_DELETE (it->second.decoder); } } break; } // New peer. Add it to the list of know but unjoint peers. if (it == peers.end ()) { peer_info_t peer_info = {false, NULL}; it = peers.ZMQ_MAP_INSERT_OR_EMPLACE (*tsi, peer_info).first; } insize = static_cast (received); // Read the offset of the fist message in the current packet. zmq_assert (insize >= sizeof (uint16_t)); uint16_t offset = get_uint16 (inpos); inpos += sizeof (uint16_t); insize -= sizeof (uint16_t); // Join the stream if needed. if (!it->second.joined) { // There is no beginning of the message in current packet. // Ignore the data. if (offset == 0xffff) continue; zmq_assert (offset <= insize); zmq_assert (it->second.decoder == NULL); // We have to move data to the beginning of the first message. inpos += offset; insize -= offset; // Mark the stream as joined. it->second.joined = true; // Create and connect decoder for the peer. it->second.decoder = new (std::nothrow) v1_decoder_t (0, options.maxmsgsize); alloc_assert (it->second.decoder); } int rc = process_input (it->second.decoder); if (rc == -1) { if (errno == EAGAIN) { active_tsi = tsi; // Stop polling. reset_pollin (pipe_handle); reset_pollin (socket_handle); break; } it->second.joined = false; LIBZMQ_DELETE (it->second.decoder); insize = 0; } } // Flush any messages decoder may have produced. session->flush (); } int zmq::pgm_receiver_t::process_input (v1_decoder_t *decoder) { zmq_assert (session != NULL); while (insize > 0) { size_t n = 0; int rc = decoder->decode (inpos, insize, n); if (rc == -1) return -1; inpos += n; insize -= n; if (rc == 0) break; rc = session->push_msg (decoder->msg ()); if (rc == -1) { errno_assert (errno == EAGAIN); return -1; } } return 0; } void zmq::pgm_receiver_t::timer_event (int token) { zmq_assert (token == rx_timer_id); // Timer cancels on return by poller_base. has_rx_timer = false; in_event (); } void zmq::pgm_receiver_t::drop_subscriptions () { msg_t msg; msg.init (); while (session->pull_msg (&msg) == 0) msg.close (); } #endif zeromq-4.2.5/src/tcp_listener.hpp0000664000372000037200000000574013255253220017741 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TCP_LISTENER_HPP_INCLUDED__ #define __ZMQ_TCP_LISTENER_HPP_INCLUDED__ #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" #include "tcp_address.hpp" namespace zmq { class io_thread_t; class socket_base_t; class tcp_listener_t : public own_t, public io_object_t { public: tcp_listener_t (zmq::io_thread_t *io_thread_, zmq::socket_base_t *socket_, const options_t &options_); ~tcp_listener_t (); // Set address to listen on. int set_address (const char *addr_); // Get the bound address for use with wildcard int get_address (std::string &addr_); private: // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); // Close the listening socket. void close (); // Accept the new connection. Returns the file descriptor of the // newly created connection. The function may return retired_fd // if the connection was dropped while waiting in the listen backlog // or was denied because of accept filters. fd_t accept (); // Address to listen on. tcp_address_t address; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // Socket the listener belongs to. zmq::socket_base_t *socket; // String representation of endpoint to bind to std::string endpoint; tcp_listener_t (const tcp_listener_t &); const tcp_listener_t &operator= (const tcp_listener_t &); }; } #endif zeromq-4.2.5/src/pipe.cpp0000664000372000037200000003632513255253220016201 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "macros.hpp" #include "pipe.hpp" #include "err.hpp" #include "ypipe.hpp" #include "ypipe_conflate.hpp" int zmq::pipepair (class object_t *parents_[2], class pipe_t *pipes_[2], int hwms_[2], bool conflate_[2]) { // Creates two pipe objects. These objects are connected by two ypipes, // each to pass messages in one direction. typedef ypipe_t upipe_normal_t; typedef ypipe_conflate_t upipe_conflate_t; pipe_t::upipe_t *upipe1; if (conflate_[0]) upipe1 = new (std::nothrow) upipe_conflate_t (); else upipe1 = new (std::nothrow) upipe_normal_t (); alloc_assert (upipe1); pipe_t::upipe_t *upipe2; if (conflate_[1]) upipe2 = new (std::nothrow) upipe_conflate_t (); else upipe2 = new (std::nothrow) upipe_normal_t (); alloc_assert (upipe2); pipes_[0] = new (std::nothrow) pipe_t (parents_[0], upipe1, upipe2, hwms_[1], hwms_[0], conflate_[0]); alloc_assert (pipes_[0]); pipes_[1] = new (std::nothrow) pipe_t (parents_[1], upipe2, upipe1, hwms_[0], hwms_[1], conflate_[1]); alloc_assert (pipes_[1]); pipes_[0]->set_peer (pipes_[1]); pipes_[1]->set_peer (pipes_[0]); return 0; } zmq::pipe_t::pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, int inhwm_, int outhwm_, bool conflate_) : object_t (parent_), inpipe (inpipe_), outpipe (outpipe_), in_active (true), out_active (true), hwm (outhwm_), lwm (compute_lwm (inhwm_)), inhwmboost (-1), outhwmboost (-1), msgs_read (0), msgs_written (0), peers_msgs_read (0), peer (NULL), sink (NULL), state (active), delay (true), server_socket_routing_id (0), conflate (conflate_) { } zmq::pipe_t::~pipe_t () { } void zmq::pipe_t::set_peer (pipe_t *peer_) { // Peer can be set once only. zmq_assert (!peer); peer = peer_; } void zmq::pipe_t::set_event_sink (i_pipe_events *sink_) { // Sink can be set once only. zmq_assert (!sink); sink = sink_; } void zmq::pipe_t::set_server_socket_routing_id ( uint32_t server_socket_routing_id_) { server_socket_routing_id = server_socket_routing_id_; } uint32_t zmq::pipe_t::get_server_socket_routing_id () { return server_socket_routing_id; } void zmq::pipe_t::set_router_socket_routing_id ( const blob_t &router_socket_routing_id_) { router_socket_routing_id.set_deep_copy (router_socket_routing_id_); } const zmq::blob_t &zmq::pipe_t::get_routing_id () { return router_socket_routing_id; } const zmq::blob_t &zmq::pipe_t::get_credential () const { return credential; } bool zmq::pipe_t::check_read () { if (unlikely (!in_active)) return false; if (unlikely (state != active && state != waiting_for_delimiter)) return false; // Check if there's an item in the pipe. if (!inpipe->check_read ()) { in_active = false; return false; } // If the next item in the pipe is message delimiter, // initiate termination process. if (inpipe->probe (is_delimiter)) { msg_t msg; bool ok = inpipe->read (&msg); zmq_assert (ok); process_delimiter (); return false; } return true; } bool zmq::pipe_t::read (msg_t *msg_) { if (unlikely (!in_active)) return false; if (unlikely (state != active && state != waiting_for_delimiter)) return false; read_message: if (!inpipe->read (msg_)) { in_active = false; return false; } // If this is a credential, save a copy and receive next message. if (unlikely (msg_->is_credential ())) { const unsigned char *data = static_cast (msg_->data ()); credential.set (data, msg_->size ()); const int rc = msg_->close (); zmq_assert (rc == 0); goto read_message; } // If delimiter was read, start termination process of the pipe. if (msg_->is_delimiter ()) { process_delimiter (); return false; } if (!(msg_->flags () & msg_t::more) && !msg_->is_routing_id ()) msgs_read++; if (lwm > 0 && msgs_read % lwm == 0) send_activate_write (peer, msgs_read); return true; } bool zmq::pipe_t::check_write () { if (unlikely (!out_active || state != active)) return false; bool full = !check_hwm (); if (unlikely (full)) { out_active = false; return false; } return true; } bool zmq::pipe_t::write (msg_t *msg_) { if (unlikely (!check_write ())) return false; bool more = msg_->flags () & msg_t::more ? true : false; const bool is_routing_id = msg_->is_routing_id (); outpipe->write (*msg_, more); if (!more && !is_routing_id) msgs_written++; return true; } void zmq::pipe_t::rollback () { // Remove incomplete message from the outbound pipe. msg_t msg; if (outpipe) { while (outpipe->unwrite (&msg)) { zmq_assert (msg.flags () & msg_t::more); int rc = msg.close (); errno_assert (rc == 0); } } } void zmq::pipe_t::flush () { // The peer does not exist anymore at this point. if (state == term_ack_sent) return; if (outpipe && !outpipe->flush ()) send_activate_read (peer); } void zmq::pipe_t::process_activate_read () { if (!in_active && (state == active || state == waiting_for_delimiter)) { in_active = true; sink->read_activated (this); } } void zmq::pipe_t::process_activate_write (uint64_t msgs_read_) { // Remember the peer's message sequence number. peers_msgs_read = msgs_read_; if (!out_active && state == active) { out_active = true; sink->write_activated (this); } } void zmq::pipe_t::process_hiccup (void *pipe_) { // Destroy old outpipe. Note that the read end of the pipe was already // migrated to this thread. zmq_assert (outpipe); outpipe->flush (); msg_t msg; while (outpipe->read (&msg)) { if (!(msg.flags () & msg_t::more)) msgs_written--; int rc = msg.close (); errno_assert (rc == 0); } LIBZMQ_DELETE (outpipe); // Plug in the new outpipe. zmq_assert (pipe_); outpipe = (upipe_t *) pipe_; out_active = true; // If appropriate, notify the user about the hiccup. if (state == active) sink->hiccuped (this); } void zmq::pipe_t::process_pipe_term () { zmq_assert (state == active || state == delimiter_received || state == term_req_sent1); // This is the simple case of peer-induced termination. If there are no // more pending messages to read, or if the pipe was configured to drop // pending messages, we can move directly to the term_ack_sent state. // Otherwise we'll hang up in waiting_for_delimiter state till all // pending messages are read. if (state == active) { if (delay) state = waiting_for_delimiter; else { state = term_ack_sent; outpipe = NULL; send_pipe_term_ack (peer); } } // Delimiter happened to arrive before the term command. Now we have the // term command as well, so we can move straight to term_ack_sent state. else if (state == delimiter_received) { state = term_ack_sent; outpipe = NULL; send_pipe_term_ack (peer); } // This is the case where both ends of the pipe are closed in parallel. // We simply reply to the request by ack and continue waiting for our // own ack. else if (state == term_req_sent1) { state = term_req_sent2; outpipe = NULL; send_pipe_term_ack (peer); } } void zmq::pipe_t::process_pipe_term_ack () { // Notify the user that all the references to the pipe should be dropped. zmq_assert (sink); sink->pipe_terminated (this); // In term_ack_sent and term_req_sent2 states there's nothing to do. // Simply deallocate the pipe. In term_req_sent1 state we have to ack // the peer before deallocating this side of the pipe. // All the other states are invalid. if (state == term_req_sent1) { outpipe = NULL; send_pipe_term_ack (peer); } else zmq_assert (state == term_ack_sent || state == term_req_sent2); // We'll deallocate the inbound pipe, the peer will deallocate the outbound // pipe (which is an inbound pipe from its point of view). // First, delete all the unread messages in the pipe. We have to do it by // hand because msg_t doesn't have automatic destructor. Then deallocate // the ypipe itself. if (!conflate) { msg_t msg; while (inpipe->read (&msg)) { int rc = msg.close (); errno_assert (rc == 0); } } LIBZMQ_DELETE (inpipe); // Deallocate the pipe object delete this; } void zmq::pipe_t::process_pipe_hwm (int inhwm_, int outhwm_) { set_hwms (inhwm_, outhwm_); } void zmq::pipe_t::set_nodelay () { this->delay = false; } void zmq::pipe_t::terminate (bool delay_) { // Overload the value specified at pipe creation. delay = delay_; // If terminate was already called, we can ignore the duplicate invocation. if (state == term_req_sent1 || state == term_req_sent2) { return; } // If the pipe is in the final phase of async termination, it's going to // closed anyway. No need to do anything special here. else if (state == term_ack_sent) { return; } // The simple sync termination case. Ask the peer to terminate and wait // for the ack. else if (state == active) { send_pipe_term (peer); state = term_req_sent1; } // There are still pending messages available, but the user calls // 'terminate'. We can act as if all the pending messages were read. else if (state == waiting_for_delimiter && !delay) { // Drop any unfinished outbound messages. rollback (); outpipe = NULL; send_pipe_term_ack (peer); state = term_ack_sent; } // If there are pending messages still available, do nothing. else if (state == waiting_for_delimiter) { } // We've already got delimiter, but not term command yet. We can ignore // the delimiter and ack synchronously terminate as if we were in // active state. else if (state == delimiter_received) { send_pipe_term (peer); state = term_req_sent1; } // There are no other states. else { zmq_assert (false); } // Stop outbound flow of messages. out_active = false; if (outpipe) { // Drop any unfinished outbound messages. rollback (); // Write the delimiter into the pipe. Note that watermarks are not // checked; thus the delimiter can be written even when the pipe is full. msg_t msg; msg.init_delimiter (); outpipe->write (msg, false); flush (); } } bool zmq::pipe_t::is_delimiter (const msg_t &msg_) { return msg_.is_delimiter (); } int zmq::pipe_t::compute_lwm (int hwm_) { // Compute the low water mark. Following point should be taken // into consideration: // // 1. LWM has to be less than HWM. // 2. LWM cannot be set to very low value (such as zero) as after filling // the queue it would start to refill only after all the messages are // read from it and thus unnecessarily hold the progress back. // 3. LWM cannot be set to very high value (such as HWM-1) as it would // result in lock-step filling of the queue - if a single message is // read from a full queue, writer thread is resumed to write exactly one // message to the queue and go back to sleep immediately. This would // result in low performance. // // Given the 3. it would be good to keep HWM and LWM as far apart as // possible to reduce the thread switching overhead to almost zero. // Let's make LWM 1/2 of HWM. int result = (hwm_ + 1) / 2; return result; } void zmq::pipe_t::process_delimiter () { zmq_assert (state == active || state == waiting_for_delimiter); if (state == active) state = delimiter_received; else { outpipe = NULL; send_pipe_term_ack (peer); state = term_ack_sent; } } void zmq::pipe_t::hiccup () { // If termination is already under way do nothing. if (state != active) return; // We'll drop the pointer to the inpipe. From now on, the peer is // responsible for deallocating it. inpipe = NULL; // Create new inpipe. if (conflate) inpipe = new (std::nothrow) ypipe_conflate_t (); else inpipe = new (std::nothrow) ypipe_t (); alloc_assert (inpipe); in_active = true; // Notify the peer about the hiccup. send_hiccup (peer, (void *) inpipe); } void zmq::pipe_t::set_hwms (int inhwm_, int outhwm_) { int in = inhwm_ + (inhwmboost > 0 ? inhwmboost : 0); int out = outhwm_ + (outhwmboost > 0 ? outhwmboost : 0); // if either send or recv side has hwm <= 0 it means infinite so we should set hwms infinite if (inhwm_ <= 0 || inhwmboost == 0) in = 0; if (outhwm_ <= 0 || outhwmboost == 0) out = 0; lwm = compute_lwm (in); hwm = out; } void zmq::pipe_t::set_hwms_boost (int inhwmboost_, int outhwmboost_) { inhwmboost = inhwmboost_; outhwmboost = outhwmboost_; } bool zmq::pipe_t::check_hwm () const { bool full = hwm > 0 && msgs_written - peers_msgs_read >= uint64_t (hwm); return (!full); } void zmq::pipe_t::send_hwms_to_peer (int inhwm_, int outhwm_) { send_pipe_hwm (peer, inhwm_, outhwm_); } zeromq-4.2.5/src/metadata.cpp0000664000372000037200000000404713255253220017020 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "metadata.hpp" zmq::metadata_t::metadata_t (const dict_t &dict) : ref_cnt (1), dict (dict) { } const char *zmq::metadata_t::get (const std::string &property) const { dict_t::const_iterator it = dict.find (property); if (it == dict.end ()) { /** \todo remove this when support for the deprecated name "Identity" is dropped */ if (property == "Identity") return get (ZMQ_MSG_PROPERTY_ROUTING_ID); return NULL; } else return it->second.c_str (); } void zmq::metadata_t::add_ref () { ref_cnt.add (1); } bool zmq::metadata_t::drop_ref () { return !ref_cnt.sub (1); } zeromq-4.2.5/src/ctx.hpp0000664000372000037200000001754713255253220016054 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CTX_HPP_INCLUDED__ #define __ZMQ_CTX_HPP_INCLUDED__ #include #include #include #include #include "mailbox.hpp" #include "array.hpp" #include "config.hpp" #include "mutex.hpp" #include "stdint.hpp" #include "options.hpp" #include "atomic_counter.hpp" #include "thread.hpp" namespace zmq { class object_t; class io_thread_t; class socket_base_t; class reaper_t; class pipe_t; // Information associated with inproc endpoint. Note that endpoint options // are registered as well so that the peer can access them without a need // for synchronisation, handshaking or similar. struct endpoint_t { socket_base_t *socket; options_t options; }; class thread_ctx_t { public: thread_ctx_t (); // Start a new thread with proper scheduling parameters. void start_thread (thread_t &thread_, thread_fn *tfn_, void *arg_) const; int set (int option_, int optval_); protected: // Synchronisation of access to context options. mutex_t opt_sync; private: // Thread parameters. int thread_priority; int thread_sched_policy; std::set thread_affinity_cpus; std::string thread_name_prefix; }; // Context object encapsulates all the global state associated with // the library. class ctx_t : public thread_ctx_t { public: // Create the context object. ctx_t (); // Returns false if object is not a context. bool check_tag (); // This function is called when user invokes zmq_ctx_term. If there are // no more sockets open it'll cause all the infrastructure to be shut // down. If there are open sockets still, the deallocation happens // after the last one is closed. int terminate (); // This function starts the terminate process by unblocking any blocking // operations currently in progress and stopping any more socket activity // (except zmq_close). // This function is non-blocking. // terminate must still be called afterwards. // This function is optional, terminate will unblock any current // operations as well. int shutdown (); // Set and get context properties. int set (int option_, int optval_); int get (int option_); // Create and destroy a socket. zmq::socket_base_t *create_socket (int type_); void destroy_socket (zmq::socket_base_t *socket_); // Send command to the destination thread. void send_command (uint32_t tid_, const command_t &command_); // Returns the I/O thread that is the least busy at the moment. // Affinity specifies which I/O threads are eligible (0 = all). // Returns NULL if no I/O thread is available. zmq::io_thread_t *choose_io_thread (uint64_t affinity_); // Returns reaper thread object. zmq::object_t *get_reaper (); // Management of inproc endpoints. int register_endpoint (const char *addr_, const endpoint_t &endpoint_); int unregister_endpoint (const std::string &addr_, socket_base_t *socket_); void unregister_endpoints (zmq::socket_base_t *socket_); endpoint_t find_endpoint (const char *addr_); void pend_connection (const std::string &addr_, const endpoint_t &endpoint_, pipe_t **pipes_); void connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_); #ifdef ZMQ_HAVE_VMCI // Return family for the VMCI socket or -1 if it's not available. int get_vmci_socket_family (); #endif enum { term_tid = 0, reaper_tid = 1 }; ~ctx_t (); bool valid () const; private: bool start (); struct pending_connection_t { endpoint_t endpoint; pipe_t *connect_pipe; pipe_t *bind_pipe; }; // Used to check whether the object is a context. uint32_t tag; // Sockets belonging to this context. We need the list so that // we can notify the sockets when zmq_ctx_term() is called. // The sockets will return ETERM then. typedef array_t sockets_t; sockets_t sockets; // List of unused thread slots. typedef std::vector empty_slots_t; empty_slots_t empty_slots; // If true, zmq_init has been called but no socket has been created // yet. Launching of I/O threads is delayed. bool starting; // If true, zmq_ctx_term was already called. bool terminating; // Synchronisation of accesses to global slot-related data: // sockets, empty_slots, terminating. It also synchronises // access to zombie sockets as such (as opposed to slots) and provides // a memory barrier to ensure that all CPU cores see the same data. mutex_t slot_sync; // The reaper thread. zmq::reaper_t *reaper; // I/O threads. typedef std::vector io_threads_t; io_threads_t io_threads; // Array of pointers to mailboxes for both application and I/O threads. uint32_t slot_count; i_mailbox **slots; // Mailbox for zmq_ctx_term thread. mailbox_t term_mailbox; // List of inproc endpoints within this context. typedef std::map endpoints_t; endpoints_t endpoints; // List of inproc connection endpoints pending a bind typedef std::multimap pending_connections_t; pending_connections_t pending_connections; // Synchronisation of access to the list of inproc endpoints. mutex_t endpoints_sync; // Maximum socket ID. static atomic_counter_t max_socket_id; // Maximum number of sockets that can be opened at the same time. int max_sockets; // Maximum allowed message size int max_msgsz; // Number of I/O threads to launch. int io_thread_count; // Does context wait (possibly forever) on termination? bool blocky; // Is IPv6 enabled on this context? bool ipv6; // Should we use zero copy message decoding in this context? bool zero_copy; ctx_t (const ctx_t &); const ctx_t &operator= (const ctx_t &); #ifdef HAVE_FORK // the process that created this context. Used to detect forking. pid_t pid; #endif enum side { connect_side, bind_side }; void connect_inproc_sockets (zmq::socket_base_t *bind_socket_, options_t &bind_options, const pending_connection_t &pending_connection_, side side_); #ifdef ZMQ_HAVE_VMCI int vmci_fd; int vmci_family; mutex_t vmci_sync; #endif }; } #endif zeromq-4.2.5/src/proxy.hpp0000664000372000037200000000333313255253220016423 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PROXY_HPP_INCLUDED__ #define __ZMQ_PROXY_HPP_INCLUDED__ namespace zmq { int proxy (class socket_base_t *frontend_, class socket_base_t *backend_, class socket_base_t *capture_, class socket_base_t *control_ = NULL); // backward compatibility without this argument } #endif zeromq-4.2.5/src/curve_client.cpp0000664000372000037200000002170513255253220017722 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #ifdef ZMQ_HAVE_CURVE #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "curve_client.hpp" #include "wire.hpp" #include "curve_client_tools.hpp" zmq::curve_client_t::curve_client_t (session_base_t *session_, const options_t &options_) : mechanism_base_t (session_, options_), curve_mechanism_base_t ( session_, options_, "CurveZMQMESSAGEC", "CurveZMQMESSAGES"), state (send_hello), tools (options_.curve_public_key, options_.curve_secret_key, options_.curve_server_key) { } zmq::curve_client_t::~curve_client_t () { } int zmq::curve_client_t::next_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case send_hello: rc = produce_hello (msg_); if (rc == 0) state = expect_welcome; break; case send_initiate: rc = produce_initiate (msg_); if (rc == 0) state = expect_ready; break; default: errno = EAGAIN; rc = -1; } return rc; } int zmq::curve_client_t::process_handshake_command (msg_t *msg_) { const unsigned char *msg_data = static_cast (msg_->data ()); const size_t msg_size = msg_->size (); int rc = 0; if (curve_client_tools_t::is_handshake_command_welcome (msg_data, msg_size)) rc = process_welcome (msg_data, msg_size); else if (curve_client_tools_t::is_handshake_command_ready (msg_data, msg_size)) rc = process_ready (msg_data, msg_size); else if (curve_client_tools_t::is_handshake_command_error (msg_data, msg_size)) rc = process_error (msg_data, msg_size); else { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; rc = -1; } if (rc == 0) { rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } return rc; } int zmq::curve_client_t::encode (msg_t *msg_) { zmq_assert (state == connected); return curve_mechanism_base_t::encode (msg_); } int zmq::curve_client_t::decode (msg_t *msg_) { zmq_assert (state == connected); return curve_mechanism_base_t::decode (msg_); } zmq::mechanism_t::status_t zmq::curve_client_t::status () const { if (state == connected) return mechanism_t::ready; else if (state == error_received) return mechanism_t::error; else return mechanism_t::handshaking; } int zmq::curve_client_t::produce_hello (msg_t *msg_) { int rc = msg_->init_size (200); errno_assert (rc == 0); rc = tools.produce_hello (msg_->data (), cn_nonce); if (rc == -1) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); // TODO this is somewhat inconsistent: we call init_size, but we may // not close msg_; i.e. we assume that msg_ is initialized but empty // (if it were non-empty, calling init_size might cause a leak!) // msg_->close (); return -1; } cn_nonce++; return 0; } int zmq::curve_client_t::process_welcome (const uint8_t *msg_data, size_t msg_size) { int rc = tools.process_welcome (msg_data, msg_size, cn_precom); if (rc == -1) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } state = send_initiate; return 0; } int zmq::curve_client_t::produce_initiate (msg_t *msg_) { const size_t metadata_length = basic_properties_len (); unsigned char *metadata_plaintext = (unsigned char *) malloc (metadata_length); alloc_assert (metadata_plaintext); add_basic_properties (metadata_plaintext, metadata_length); size_t msg_size = 113 + 128 + crypto_box_BOXZEROBYTES + metadata_length; int rc = msg_->init_size (msg_size); errno_assert (rc == 0); rc = tools.produce_initiate (msg_->data (), msg_size, cn_nonce, metadata_plaintext, metadata_length); free (metadata_plaintext); if (-1 == rc) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); // TODO see comment in produce_hello return -1; } cn_nonce++; return 0; } int zmq::curve_client_t::process_ready (const uint8_t *msg_data, size_t msg_size) { if (msg_size < 30) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY); errno = EPROTO; return -1; } const size_t clen = (msg_size - 14) + crypto_box_BOXZEROBYTES; uint8_t ready_nonce[crypto_box_NONCEBYTES]; uint8_t *ready_plaintext = (uint8_t *) malloc (crypto_box_ZEROBYTES + clen); alloc_assert (ready_plaintext); uint8_t *ready_box = (uint8_t *) malloc (crypto_box_BOXZEROBYTES + 16 + clen); alloc_assert (ready_box); memset (ready_box, 0, crypto_box_BOXZEROBYTES); memcpy (ready_box + crypto_box_BOXZEROBYTES, msg_data + 14, clen - crypto_box_BOXZEROBYTES); memcpy (ready_nonce, "CurveZMQREADY---", 16); memcpy (ready_nonce + 16, msg_data + 6, 8); cn_peer_nonce = get_uint64 (msg_data + 6); int rc = crypto_box_open_afternm (ready_plaintext, ready_box, clen, ready_nonce, cn_precom); free (ready_box); if (rc != 0) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } rc = parse_metadata (ready_plaintext + crypto_box_ZEROBYTES, clen - crypto_box_ZEROBYTES); free (ready_plaintext); if (rc == 0) state = connected; else { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA); errno = EPROTO; } return rc; } int zmq::curve_client_t::process_error (const uint8_t *msg_data, size_t msg_size) { if (state != expect_welcome && state != expect_ready) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (msg_size < 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const size_t error_reason_len = static_cast (msg_data[6]); if (error_reason_len > msg_size - 7) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR); errno = EPROTO; return -1; } const char *error_reason = reinterpret_cast (msg_data) + 7; handle_error_reason (error_reason, error_reason_len); state = error_received; return 0; } #endif zeromq-4.2.5/src/router.cpp0000664000372000037200000004161713255253220016564 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "router.hpp" #include "pipe.hpp" #include "wire.hpp" #include "random.hpp" #include "likely.hpp" #include "err.hpp" zmq::router_t::router_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), prefetched (false), routing_id_sent (false), current_in (NULL), terminate_current_in (false), more_in (false), current_out (NULL), more_out (false), next_integral_routing_id (generate_random ()), mandatory (false), // raw_socket functionality in ROUTER is deprecated raw_socket (false), probe_router (false), handover (false) { options.type = ZMQ_ROUTER; options.recv_routing_id = true; options.raw_socket = false; prefetched_id.init (); prefetched_msg.init (); } zmq::router_t::~router_t () { zmq_assert (anonymous_pipes.empty ()); ; zmq_assert (outpipes.empty ()); prefetched_id.close (); prefetched_msg.close (); } void zmq::router_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); if (probe_router) { msg_t probe_msg_; int rc = probe_msg_.init (); errno_assert (rc == 0); rc = pipe_->write (&probe_msg_); // zmq_assert (rc) is not applicable here, since it is not a bug. pipe_->flush (); rc = probe_msg_.close (); errno_assert (rc == 0); } bool routing_id_ok = identify_peer (pipe_); if (routing_id_ok) fq.attach (pipe_); else anonymous_pipes.insert (pipe_); } int zmq::router_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { bool is_int = (optvallen_ == sizeof (int)); int value = 0; if (is_int) memcpy (&value, optval_, sizeof (int)); switch (option_) { case ZMQ_CONNECT_ROUTING_ID: // TODO why isn't it possible to set an empty connect_routing_id // (which is the default value) if (optval_ && optvallen_) { connect_routing_id.assign ((char *) optval_, optvallen_); return 0; } break; case ZMQ_ROUTER_RAW: if (is_int && value >= 0) { raw_socket = (value != 0); if (raw_socket) { options.recv_routing_id = false; options.raw_socket = true; } return 0; } break; case ZMQ_ROUTER_MANDATORY: if (is_int && value >= 0) { mandatory = (value != 0); return 0; } break; case ZMQ_PROBE_ROUTER: if (is_int && value >= 0) { probe_router = (value != 0); return 0; } break; case ZMQ_ROUTER_HANDOVER: if (is_int && value >= 0) { handover = (value != 0); return 0; } break; default: break; } errno = EINVAL; return -1; } void zmq::router_t::xpipe_terminated (pipe_t *pipe_) { std::set::iterator it = anonymous_pipes.find (pipe_); if (it != anonymous_pipes.end ()) anonymous_pipes.erase (it); else { outpipes_t::iterator iter = outpipes.find (pipe_->get_routing_id ()); zmq_assert (iter != outpipes.end ()); outpipes.erase (iter); fq.pipe_terminated (pipe_); pipe_->rollback (); if (pipe_ == current_out) current_out = NULL; } } void zmq::router_t::xread_activated (pipe_t *pipe_) { std::set::iterator it = anonymous_pipes.find (pipe_); if (it == anonymous_pipes.end ()) fq.activated (pipe_); else { bool routing_id_ok = identify_peer (pipe_); if (routing_id_ok) { anonymous_pipes.erase (it); fq.attach (pipe_); } } } void zmq::router_t::xwrite_activated (pipe_t *pipe_) { outpipes_t::iterator it; for (it = outpipes.begin (); it != outpipes.end (); ++it) if (it->second.pipe == pipe_) break; zmq_assert (it != outpipes.end ()); zmq_assert (!it->second.active); it->second.active = true; } int zmq::router_t::xsend (msg_t *msg_) { // If this is the first part of the message it's the ID of the // peer to send the message to. if (!more_out) { zmq_assert (!current_out); // If we have malformed message (prefix with no subsequent message) // then just silently ignore it. // TODO: The connections should be killed instead. if (msg_->flags () & msg_t::more) { more_out = true; // Find the pipe associated with the routing id stored in the prefix. // If there's no such pipe just silently ignore the message, unless // router_mandatory is set. blob_t routing_id ((unsigned char *) msg_->data (), msg_->size (), zmq::reference_tag_t ()); outpipes_t::iterator it = outpipes.find (routing_id); if (it != outpipes.end ()) { current_out = it->second.pipe; // Check whether pipe is closed or not if (!current_out->check_write ()) { // Check whether pipe is full or not bool pipe_full = !current_out->check_hwm (); it->second.active = false; current_out = NULL; if (mandatory) { more_out = false; if (pipe_full) errno = EAGAIN; else errno = EHOSTUNREACH; return -1; } } } else if (mandatory) { more_out = false; errno = EHOSTUNREACH; return -1; } } int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return 0; } // Ignore the MORE flag for raw-sock or assert? if (options.raw_socket) msg_->reset_flags (msg_t::more); // Check whether this is the last part of the message. more_out = msg_->flags () & msg_t::more ? true : false; // Push the message into the pipe. If there's no out pipe, just drop it. if (current_out) { // Close the remote connection if user has asked to do so // by sending zero length message. // Pending messages in the pipe will be dropped (on receiving term- ack) if (raw_socket && msg_->size () == 0) { current_out->terminate (false); int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); current_out = NULL; return 0; } bool ok = current_out->write (msg_); if (unlikely (!ok)) { // Message failed to send - we must close it ourselves. int rc = msg_->close (); errno_assert (rc == 0); // HWM was checked before, so the pipe must be gone. Roll back // messages that were piped, for example REP labels. current_out->rollback (); current_out = NULL; } else { if (!more_out) { current_out->flush (); current_out = NULL; } } } else { int rc = msg_->close (); errno_assert (rc == 0); } // Detach the message from the data buffer. int rc = msg_->init (); errno_assert (rc == 0); return 0; } int zmq::router_t::xrecv (msg_t *msg_) { if (prefetched) { if (!routing_id_sent) { int rc = msg_->move (prefetched_id); errno_assert (rc == 0); routing_id_sent = true; } else { int rc = msg_->move (prefetched_msg); errno_assert (rc == 0); prefetched = false; } more_in = msg_->flags () & msg_t::more ? true : false; if (!more_in) { if (terminate_current_in) { current_in->terminate (true); terminate_current_in = false; } current_in = NULL; } return 0; } pipe_t *pipe = NULL; int rc = fq.recvpipe (msg_, &pipe); // It's possible that we receive peer's routing id. That happens // after reconnection. The current implementation assumes that // the peer always uses the same routing id. while (rc == 0 && msg_->is_routing_id ()) rc = fq.recvpipe (msg_, &pipe); if (rc != 0) return -1; zmq_assert (pipe != NULL); // If we are in the middle of reading a message, just return the next part. if (more_in) { more_in = msg_->flags () & msg_t::more ? true : false; if (!more_in) { if (terminate_current_in) { current_in->terminate (true); terminate_current_in = false; } current_in = NULL; } } else { // We are at the beginning of a message. // Keep the message part we have in the prefetch buffer // and return the ID of the peer instead. rc = prefetched_msg.move (*msg_); errno_assert (rc == 0); prefetched = true; current_in = pipe; const blob_t &routing_id = pipe->get_routing_id (); rc = msg_->init_size (routing_id.size ()); errno_assert (rc == 0); memcpy (msg_->data (), routing_id.data (), routing_id.size ()); msg_->set_flags (msg_t::more); if (prefetched_msg.metadata ()) msg_->set_metadata (prefetched_msg.metadata ()); routing_id_sent = true; } return 0; } int zmq::router_t::rollback (void) { if (current_out) { current_out->rollback (); current_out = NULL; more_out = false; } return 0; } bool zmq::router_t::xhas_in () { // If we are in the middle of reading the messages, there are // definitely more parts available. if (more_in) return true; // We may already have a message pre-fetched. if (prefetched) return true; // Try to read the next message. // The message, if read, is kept in the pre-fetch buffer. pipe_t *pipe = NULL; int rc = fq.recvpipe (&prefetched_msg, &pipe); // It's possible that we receive peer's routing id. That happens // after reconnection. The current implementation assumes that // the peer always uses the same routing id. // TODO: handle the situation when the peer changes its routing id. while (rc == 0 && prefetched_msg.is_routing_id ()) rc = fq.recvpipe (&prefetched_msg, &pipe); if (rc != 0) return false; zmq_assert (pipe != NULL); const blob_t &routing_id = pipe->get_routing_id (); rc = prefetched_id.init_size (routing_id.size ()); errno_assert (rc == 0); memcpy (prefetched_id.data (), routing_id.data (), routing_id.size ()); prefetched_id.set_flags (msg_t::more); prefetched = true; routing_id_sent = false; current_in = pipe; return true; } bool zmq::router_t::xhas_out () { // In theory, ROUTER socket is always ready for writing (except when // MANDATORY is set). Whether actual attempt to write succeeds depends // on whitch pipe the message is going to be routed to. if (!mandatory) return true; bool has_out = false; outpipes_t::iterator it; for (it = outpipes.begin (); it != outpipes.end (); ++it) has_out |= it->second.pipe->check_hwm (); return has_out; } const zmq::blob_t &zmq::router_t::get_credential () const { return fq.get_credential (); } int zmq::router_t::get_peer_state (const void *routing_id_, size_t routing_id_size_) const { int res = 0; blob_t routing_id_blob ((unsigned char *) routing_id_, routing_id_size_); outpipes_t::const_iterator it = outpipes.find (routing_id_blob); if (it == outpipes.end ()) { errno = EHOSTUNREACH; return -1; } const outpipe_t &outpipe = it->second; if (outpipe.pipe->check_hwm ()) res |= ZMQ_POLLOUT; /** \todo does it make any sense to check the inpipe as well? */ return res; } bool zmq::router_t::identify_peer (pipe_t *pipe_) { msg_t msg; bool ok; blob_t routing_id; if (connect_routing_id.length ()) { routing_id.set ((unsigned char *) connect_routing_id.c_str (), connect_routing_id.length ()); connect_routing_id.clear (); outpipes_t::iterator it = outpipes.find (routing_id); if (it != outpipes.end ()) zmq_assert (false); // Not allowed to duplicate an existing rid } else if ( options .raw_socket) { // Always assign an integral routing id for raw-socket unsigned char buf[5]; buf[0] = 0; put_uint32 (buf + 1, next_integral_routing_id++); routing_id.set (buf, sizeof buf); } else if (!options.raw_socket) { // Pick up handshake cases and also case where next integral routing id is set msg.init (); ok = pipe_->read (&msg); if (!ok) return false; if (msg.size () == 0) { // Fall back on the auto-generation unsigned char buf[5]; buf[0] = 0; put_uint32 (buf + 1, next_integral_routing_id++); routing_id.set (buf, sizeof buf); msg.close (); } else { routing_id.set ((unsigned char *) msg.data (), msg.size ()); outpipes_t::iterator it = outpipes.find (routing_id); msg.close (); if (it != outpipes.end ()) { if (!handover) // Ignore peers with duplicate ID return false; else { // We will allow the new connection to take over this // routing id. Temporarily assign a new routing id to the // existing pipe so we can terminate it asynchronously. unsigned char buf[5]; buf[0] = 0; put_uint32 (buf + 1, next_integral_routing_id++); blob_t new_routing_id (buf, sizeof buf); it->second.pipe->set_router_socket_routing_id ( new_routing_id); outpipe_t existing_outpipe = {it->second.pipe, it->second.active}; ok = outpipes .ZMQ_MAP_INSERT_OR_EMPLACE ( ZMQ_MOVE (new_routing_id), existing_outpipe) .second; zmq_assert (ok); // Remove the existing routing id entry to allow the new // connection to take the routing id. outpipes.erase (it); if (existing_outpipe.pipe == current_in) terminate_current_in = true; else existing_outpipe.pipe->terminate (true); } } } } pipe_->set_router_socket_routing_id (routing_id); // Add the record into output pipes lookup table outpipe_t outpipe = {pipe_, true}; ok = outpipes.ZMQ_MAP_INSERT_OR_EMPLACE (ZMQ_MOVE (routing_id), outpipe) .second; zmq_assert (ok); return true; } zeromq-4.2.5/src/clock.cpp0000664000372000037200000001736513255253220016342 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "clock.hpp" #include "likely.hpp" #include "config.hpp" #include "err.hpp" #include "mutex.hpp" #include #if defined _MSC_VER #if defined _WIN32_WCE #include #else #include #endif #endif #if !defined ZMQ_HAVE_WINDOWS #include #endif #if defined HAVE_CLOCK_GETTIME || defined HAVE_GETHRTIME #include #endif #if defined ZMQ_HAVE_VXWORKS #include "timers.h" #endif #if defined ZMQ_HAVE_OSX #include #include #include #include int alt_clock_gettime (int clock_id, timespec *ts) { clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service (mach_host_self (), clock_id, &cclock); clock_get_time (cclock, &mts); mach_port_deallocate (mach_task_self (), cclock); ts->tv_sec = mts.tv_sec; ts->tv_nsec = mts.tv_nsec; return 0; } #endif #ifdef ZMQ_HAVE_WINDOWS typedef ULONGLONG (*f_compatible_get_tick_count64) (); static zmq::mutex_t compatible_get_tick_count64_mutex; ULONGLONG compatible_get_tick_count64 () { #ifdef ZMQ_HAVE_WINDOWS_UWP const ULONGLONG result = ::GetTickCount64 (); return result; #else zmq::scoped_lock_t locker (compatible_get_tick_count64_mutex); static DWORD s_wrap = 0; static DWORD s_last_tick = 0; const DWORD current_tick = ::GetTickCount (); if (current_tick < s_last_tick) ++s_wrap; s_last_tick = current_tick; const ULONGLONG result = (static_cast (s_wrap) << 32) + static_cast (current_tick); return result; #endif } f_compatible_get_tick_count64 init_compatible_get_tick_count64 () { f_compatible_get_tick_count64 func = NULL; #if !defined ZMQ_HAVE_WINDOWS_UWP HMODULE module = ::LoadLibraryA ("Kernel32.dll"); if (module != NULL) func = reinterpret_cast ( ::GetProcAddress (module, "GetTickCount64")); #endif if (func == NULL) func = compatible_get_tick_count64; #if !defined ZMQ_HAVE_WINDOWS_UWP ::FreeLibrary (module); #endif return func; } static f_compatible_get_tick_count64 my_get_tick_count64 = init_compatible_get_tick_count64 (); #endif zmq::clock_t::clock_t () : last_tsc (rdtsc ()), #ifdef ZMQ_HAVE_WINDOWS last_time (static_cast ((*my_get_tick_count64) ())) #else last_time (now_us () / 1000) #endif { } zmq::clock_t::~clock_t () { } uint64_t zmq::clock_t::now_us () { #if defined ZMQ_HAVE_WINDOWS // Get the high resolution counter's accuracy. LARGE_INTEGER ticksPerSecond; QueryPerformanceFrequency (&ticksPerSecond); // What time is it? LARGE_INTEGER tick; QueryPerformanceCounter (&tick); // Convert the tick number into the number of seconds // since the system was started. double ticks_div = ticksPerSecond.QuadPart / 1000000.0; return (uint64_t) (tick.QuadPart / ticks_div); #elif defined HAVE_CLOCK_GETTIME \ && (defined CLOCK_MONOTONIC || defined ZMQ_HAVE_VXWORKS) // Use POSIX clock_gettime function to get precise monotonic time. struct timespec tv; #if defined ZMQ_HAVE_OSX \ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12 int rc = alt_clock_gettime (SYSTEM_CLOCK, &tv); #else int rc = clock_gettime (CLOCK_MONOTONIC, &tv); #endif // Fix case where system has clock_gettime but CLOCK_MONOTONIC is not supported. // This should be a configuration check, but I looked into it and writing an // AC_FUNC_CLOCK_MONOTONIC seems beyond my powers. if (rc != 0) { #ifndef ZMQ_HAVE_VXWORKS // Use POSIX gettimeofday function to get precise time. struct timeval tv; int rc = gettimeofday (&tv, NULL); errno_assert (rc == 0); return (tv.tv_sec * (uint64_t) 1000000 + tv.tv_usec); #endif } return (tv.tv_sec * (uint64_t) 1000000 + tv.tv_nsec / 1000); #elif defined HAVE_GETHRTIME return (gethrtime () / 1000); #else // Use POSIX gettimeofday function to get precise time. struct timeval tv; int rc = gettimeofday (&tv, NULL); errno_assert (rc == 0); return (tv.tv_sec * (uint64_t) 1000000 + tv.tv_usec); #endif } uint64_t zmq::clock_t::now_ms () { uint64_t tsc = rdtsc (); // If TSC is not supported, get precise time and chop off the microseconds. if (!tsc) { #ifdef ZMQ_HAVE_WINDOWS // Under Windows, now_us is not so reliable since QueryPerformanceCounter // does not guarantee that it will use a hardware that offers a monotonic timer. // So, lets use GetTickCount when GetTickCount64 is not available with an workaround // to its 32 bit limitation. return static_cast ((*my_get_tick_count64) ()); #else return now_us () / 1000; #endif } // If TSC haven't jumped back (in case of migration to a different // CPU core) and if not too much time elapsed since last measurement, // we can return cached time value. if (likely (tsc - last_tsc <= (clock_precision / 2) && tsc >= last_tsc)) return last_time; last_tsc = tsc; #ifdef ZMQ_HAVE_WINDOWS last_time = static_cast ((*my_get_tick_count64) ()); #else last_time = now_us () / 1000; #endif return last_time; } uint64_t zmq::clock_t::rdtsc () { #if (defined _MSC_VER && (defined _M_IX86 || defined _M_X64)) return __rdtsc (); #elif (defined __GNUC__ && (defined __i386__ || defined __x86_64__)) uint32_t low, high; __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); return (uint64_t) high << 32 | low; #elif (defined __SUNPRO_CC && (__SUNPRO_CC >= 0x5100) \ && (defined __i386 || defined __amd64 || defined __x86_64)) union { uint64_t u64val; uint32_t u32val[2]; } tsc; asm("rdtsc" : "=a"(tsc.u32val[0]), "=d"(tsc.u32val[1])); return tsc.u64val; #elif defined(__s390__) uint64_t tsc; asm("\tstck\t%0\n" : "=Q"(tsc) : : "cc"); return (tsc); #else struct timespec ts; #if defined ZMQ_HAVE_OSX \ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 // less than macOS 10.12 alt_clock_gettime (SYSTEM_CLOCK, &ts); #else clock_gettime (CLOCK_MONOTONIC, &ts); #endif return (uint64_t) (ts.tv_sec) * 1000000000 + ts.tv_nsec; #endif } zeromq-4.2.5/src/gssapi_mechanism_base.cpp0000664000372000037200000002720313255253220021543 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #ifdef HAVE_LIBGSSAPI_KRB5 #include #include #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "gssapi_mechanism_base.hpp" #include "wire.hpp" zmq::gssapi_mechanism_base_t::gssapi_mechanism_base_t ( session_base_t *session_, const options_t &options_) : mechanism_base_t (session_, options_), send_tok (), recv_tok (), /// FIXME remove? in_buf (), target_name (GSS_C_NO_NAME), principal_name (NULL), maj_stat (GSS_S_COMPLETE), min_stat (0), init_sec_min_stat (0), ret_flags (0), gss_flags (GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG), cred (GSS_C_NO_CREDENTIAL), context (GSS_C_NO_CONTEXT), do_encryption (!options_.gss_plaintext) { } zmq::gssapi_mechanism_base_t::~gssapi_mechanism_base_t () { if (target_name) gss_release_name (&min_stat, &target_name); if (context) gss_delete_sec_context (&min_stat, &context, GSS_C_NO_BUFFER); } int zmq::gssapi_mechanism_base_t::encode_message (msg_t *msg_) { // Wrap the token value int state; gss_buffer_desc plaintext; gss_buffer_desc wrapped; uint8_t flags = 0; if (msg_->flags () & msg_t::more) flags |= 0x01; if (msg_->flags () & msg_t::command) flags |= 0x02; uint8_t *plaintext_buffer = static_cast (malloc (msg_->size () + 1)); alloc_assert (plaintext_buffer); plaintext_buffer[0] = flags; memcpy (plaintext_buffer + 1, msg_->data (), msg_->size ()); plaintext.value = plaintext_buffer; plaintext.length = msg_->size () + 1; maj_stat = gss_wrap (&min_stat, context, 1, GSS_C_QOP_DEFAULT, &plaintext, &state, &wrapped); zmq_assert (maj_stat == GSS_S_COMPLETE); zmq_assert (state); // Re-initialize msg_ for wrapped text int rc = msg_->close (); zmq_assert (rc == 0); rc = msg_->init_size (8 + 4 + wrapped.length); zmq_assert (rc == 0); uint8_t *ptr = static_cast (msg_->data ()); // Add command string memcpy (ptr, "\x07MESSAGE", 8); ptr += 8; // Add token length put_uint32 (ptr, static_cast (wrapped.length)); ptr += 4; // Add wrapped token value memcpy (ptr, wrapped.value, wrapped.length); ptr += wrapped.length; gss_release_buffer (&min_stat, &wrapped); return 0; } int zmq::gssapi_mechanism_base_t::decode_message (msg_t *msg_) { const uint8_t *ptr = static_cast (msg_->data ()); size_t bytes_left = msg_->size (); int rc = check_basic_command_structure (msg_); if (rc == -1) return rc; // Get command string if (bytes_left < 8 || memcmp (ptr, "\x07MESSAGE", 8)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } ptr += 8; bytes_left -= 8; // Get token length if (bytes_left < 4) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE); errno = EPROTO; return -1; } gss_buffer_desc wrapped; wrapped.length = get_uint32 (ptr); ptr += 4; bytes_left -= 4; // Get token value if (bytes_left < wrapped.length) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE); errno = EPROTO; return -1; } // TODO: instead of malloc/memcpy, can we just do: wrapped.value = ptr; const size_t alloc_length = wrapped.length ? wrapped.length : 1; wrapped.value = static_cast (malloc (alloc_length)); alloc_assert (wrapped.value); if (wrapped.length) { memcpy (wrapped.value, ptr, wrapped.length); ptr += wrapped.length; bytes_left -= wrapped.length; } // Unwrap the token value int state; gss_buffer_desc plaintext; maj_stat = gss_unwrap (&min_stat, context, &wrapped, &plaintext, &state, (gss_qop_t *) NULL); if (maj_stat != GSS_S_COMPLETE) { gss_release_buffer (&min_stat, &plaintext); free (wrapped.value); session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } zmq_assert (state); // Re-initialize msg_ for plaintext rc = msg_->close (); zmq_assert (rc == 0); rc = msg_->init_size (plaintext.length - 1); zmq_assert (rc == 0); const uint8_t flags = static_cast (plaintext.value)[0]; if (flags & 0x01) msg_->set_flags (msg_t::more); if (flags & 0x02) msg_->set_flags (msg_t::command); memcpy (msg_->data (), static_cast (plaintext.value) + 1, plaintext.length - 1); gss_release_buffer (&min_stat, &plaintext); free (wrapped.value); if (bytes_left > 0) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE); errno = EPROTO; return -1; } return 0; } int zmq::gssapi_mechanism_base_t::produce_initiate (msg_t *msg_, void *token_value_, size_t token_length_) { zmq_assert (token_value_); zmq_assert (token_length_ <= 0xFFFFFFFFUL); const size_t command_size = 9 + 4 + token_length_; const int rc = msg_->init_size (command_size); errno_assert (rc == 0); uint8_t *ptr = static_cast (msg_->data ()); // Add command string memcpy (ptr, "\x08INITIATE", 9); ptr += 9; // Add token length put_uint32 (ptr, static_cast (token_length_)); ptr += 4; // Add token value memcpy (ptr, token_value_, token_length_); ptr += token_length_; return 0; } int zmq::gssapi_mechanism_base_t::process_initiate (msg_t *msg_, void **token_value_, size_t &token_length_) { zmq_assert (token_value_); const uint8_t *ptr = static_cast (msg_->data ()); size_t bytes_left = msg_->size (); int rc = check_basic_command_structure (msg_); if (rc == -1) return rc; // Get command string if (bytes_left < 9 || memcmp (ptr, "\x08INITIATE", 9)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } ptr += 9; bytes_left -= 9; // Get token length if (bytes_left < 4) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE); errno = EPROTO; return -1; } token_length_ = get_uint32 (ptr); ptr += 4; bytes_left -= 4; // Get token value if (bytes_left < token_length_) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE); errno = EPROTO; return -1; } *token_value_ = static_cast (malloc (token_length_ ? token_length_ : 1)); alloc_assert (*token_value_); if (token_length_) { memcpy (*token_value_, ptr, token_length_); ptr += token_length_; bytes_left -= token_length_; } if (bytes_left > 0) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE); errno = EPROTO; return -1; } return 0; } int zmq::gssapi_mechanism_base_t::produce_ready (msg_t *msg_) { make_command_with_basic_properties (msg_, "\5READY", 6); if (do_encryption) return encode_message (msg_); return 0; } int zmq::gssapi_mechanism_base_t::process_ready (msg_t *msg_) { if (do_encryption) { const int rc = decode_message (msg_); if (rc != 0) return rc; } const unsigned char *ptr = static_cast (msg_->data ()); size_t bytes_left = msg_->size (); int rc = check_basic_command_structure (msg_); if (rc == -1) return rc; if (bytes_left < 6 || memcmp (ptr, "\x05READY", 6)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } ptr += 6; bytes_left -= 6; rc = parse_metadata (ptr, bytes_left); if (rc == -1) session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA); return rc; } const gss_OID zmq::gssapi_mechanism_base_t::convert_nametype (int zmq_nametype) { switch (zmq_nametype) { case ZMQ_GSSAPI_NT_HOSTBASED: return GSS_C_NT_HOSTBASED_SERVICE; case ZMQ_GSSAPI_NT_USER_NAME: return GSS_C_NT_USER_NAME; case ZMQ_GSSAPI_NT_KRB5_PRINCIPAL: #ifdef GSS_KRB5_NT_PRINCIPAL_NAME return (gss_OID) GSS_KRB5_NT_PRINCIPAL_NAME; #else return GSS_C_NT_USER_NAME; #endif } return NULL; } int zmq::gssapi_mechanism_base_t::acquire_credentials (char *service_name_, gss_cred_id_t *cred_, gss_OID name_type_) { OM_uint32 maj_stat; OM_uint32 min_stat; gss_name_t server_name; gss_buffer_desc name_buf; name_buf.value = service_name_; name_buf.length = strlen ((char *) name_buf.value) + 1; maj_stat = gss_import_name (&min_stat, &name_buf, name_type_, &server_name); if (maj_stat != GSS_S_COMPLETE) return -1; maj_stat = gss_acquire_cred (&min_stat, server_name, 0, GSS_C_NO_OID_SET, GSS_C_BOTH, cred_, NULL, NULL); if (maj_stat != GSS_S_COMPLETE) return -1; gss_release_name (&min_stat, &server_name); return 0; } #endif zeromq-4.2.5/src/socks.hpp0000664000372000037200000000652313255253220016370 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SOCKS_HPP_INCLUDED__ #define __ZMQ_SOCKS_HPP_INCLUDED__ #include #include "fd.hpp" #include "stdint.hpp" namespace zmq { struct socks_greeting_t { socks_greeting_t (uint8_t method); socks_greeting_t (uint8_t *methods_, uint8_t num_methods_); uint8_t methods[UINT8_MAX]; const size_t num_methods; }; class socks_greeting_encoder_t { public: socks_greeting_encoder_t (); void encode (const socks_greeting_t &greeting_); int output (fd_t fd_); bool has_pending_data () const; void reset (); private: size_t bytes_encoded; size_t bytes_written; uint8_t buf[2 + UINT8_MAX]; }; struct socks_choice_t { socks_choice_t (uint8_t method_); uint8_t method; }; class socks_choice_decoder_t { public: socks_choice_decoder_t (); int input (fd_t fd_); bool message_ready () const; socks_choice_t decode (); void reset (); private: unsigned char buf[2]; size_t bytes_read; }; struct socks_request_t { socks_request_t (uint8_t command_, std::string hostname_, uint16_t port_); const uint8_t command; const std::string hostname; const uint16_t port; }; class socks_request_encoder_t { public: socks_request_encoder_t (); void encode (const socks_request_t &req); int output (fd_t fd_); bool has_pending_data () const; void reset (); private: size_t bytes_encoded; size_t bytes_written; uint8_t buf[4 + UINT8_MAX + 1 + 2]; }; struct socks_response_t { socks_response_t (uint8_t response_code_, std::string address_, uint16_t port_); uint8_t response_code; std::string address; uint16_t port; }; class socks_response_decoder_t { public: socks_response_decoder_t (); int input (fd_t fd_); bool message_ready () const; socks_response_t decode (); void reset (); private: int8_t buf[4 + UINT8_MAX + 1 + 2]; size_t bytes_read; }; } #endif zeromq-4.2.5/src/pgm_receiver.hpp0000664000372000037200000001017313255253220017711 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PGM_RECEIVER_HPP_INCLUDED__ #define __ZMQ_PGM_RECEIVER_HPP_INCLUDED__ #if defined ZMQ_HAVE_OPENPGM #include #include #include "io_object.hpp" #include "i_engine.hpp" #include "options.hpp" #include "v1_decoder.hpp" #include "pgm_socket.hpp" namespace zmq { class io_thread_t; class session_base_t; class pgm_receiver_t : public io_object_t, public i_engine { public: pgm_receiver_t (zmq::io_thread_t *parent_, const options_t &options_); ~pgm_receiver_t (); int init (bool udp_encapsulation_, const char *network_); // i_engine interface implementation. void plug (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_); void terminate (); void restart_input (); void restart_output (); void zap_msg_available () {} const char *get_endpoint () const; // i_poll_events interface implementation. void in_event (); void timer_event (int token); private: // Unplug the engine from the session. void unplug (); // Decode received data (inpos, insize) and forward decoded // messages to the session. int process_input (v1_decoder_t *decoder); // PGM is not able to move subscriptions upstream. Thus, drop all // the pending subscriptions. void drop_subscriptions (); // RX timeout timer ID. enum { rx_timer_id = 0xa1 }; // RX timer is running. bool has_rx_timer; // If joined is true we are already getting messages from the peer. // It it's false, we are getting data but still we haven't seen // beginning of a message. struct peer_info_t { bool joined; v1_decoder_t *decoder; }; struct tsi_comp { bool operator() (const pgm_tsi_t <si, const pgm_tsi_t &rtsi) const { uint32_t ll[2], rl[2]; memcpy (ll, <si, sizeof (ll)); memcpy (rl, &rtsi, sizeof (rl)); return (ll[0] < rl[0]) || (ll[0] == rl[0] && ll[1] < rl[1]); } }; typedef std::map peers_t; peers_t peers; // PGM socket. pgm_socket_t pgm_socket; // Socket options. options_t options; // Associated session. zmq::session_base_t *session; const pgm_tsi_t *active_tsi; // Number of bytes not consumed by the decoder due to pipe overflow. size_t insize; // Pointer to data still waiting to be processed by the decoder. const unsigned char *inpos; // Poll handle associated with PGM socket. handle_t socket_handle; // Poll handle associated with engine PGM waiting pipe. handle_t pipe_handle; pgm_receiver_t (const pgm_receiver_t &); const pgm_receiver_t &operator= (const pgm_receiver_t &); }; } #endif #endif zeromq-4.2.5/src/io_object.hpp0000664000372000037200000000541513255253220017202 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_IO_OBJECT_HPP_INCLUDED__ #define __ZMQ_IO_OBJECT_HPP_INCLUDED__ #include #include "stdint.hpp" #include "poller.hpp" #include "i_poll_events.hpp" namespace zmq { class io_thread_t; // Simple base class for objects that live in I/O threads. // It makes communication with the poller object easier and // makes defining unneeded event handlers unnecessary. class io_object_t : public i_poll_events { public: io_object_t (zmq::io_thread_t *io_thread_ = NULL); ~io_object_t (); // When migrating an object from one I/O thread to another, first // unplug it, then migrate it, then plug it to the new thread. void plug (zmq::io_thread_t *io_thread_); void unplug (); protected: typedef poller_t::handle_t handle_t; // Methods to access underlying poller object. handle_t add_fd (fd_t fd_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void add_timer (int timout_, int id_); void cancel_timer (int id_); // i_poll_events interface implementation. void in_event (); void out_event (); void timer_event (int id_); private: poller_t *poller; io_object_t (const io_object_t &); const io_object_t &operator= (const io_object_t &); }; } #endif zeromq-4.2.5/src/blob.hpp0000664000372000037200000001252513255253220016163 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_BLOB_HPP_INCLUDED__ #define __ZMQ_BLOB_HPP_INCLUDED__ #include #include #include #if __cplusplus >= 201103L || defined(_MSC_VER) && _MSC_VER > 1700 #define ZMQ_HAS_MOVE_SEMANTICS #define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) emplace (k, v) #define ZMQ_PUSH_OR_EMPLACE_BACK emplace_back #define ZMQ_MOVE(x) std::move (x) #else #define ZMQ_MAP_INSERT_OR_EMPLACE(k, v) insert (std::make_pair (k, v)) #define ZMQ_PUSH_OR_EMPLACE_BACK push_back #define ZMQ_MOVE(x) (x) #endif namespace zmq { struct reference_tag_t { }; // Object to hold dynamically allocated opaque binary data. // On modern compilers, it will be movable but not copyable. Copies // must be explicitly created by set_deep_copy. // On older compilers, it is copyable for syntactical reasons. struct blob_t { // Creates an empty blob_t. blob_t () : data_ (0), size_ (0), owned_ (true) {} // Creates a blob_t of a given size, with uninitialized content. blob_t (const size_t size) : data_ ((unsigned char *) malloc (size)), size_ (size), owned_ (true) { } // Creates a blob_t of a given size, an initializes content by copying // from another buffer. blob_t (const unsigned char *const data, const size_t size) : data_ ((unsigned char *) malloc (size)), size_ (size), owned_ (true) { memcpy (data_, data, size_); } // Creates a blob_t for temporary use that only references a // pre-allocated block of data. // Use with caution and ensure that the blob_t will not outlive // the referenced data. blob_t (unsigned char *const data, const size_t size, reference_tag_t) : data_ (data), size_ (size), owned_ (false) { } // Returns the size of the blob_t. size_t size () const { return size_; } // Returns a pointer to the data of the blob_t. const unsigned char *data () const { return data_; } // Returns a pointer to the data of the blob_t. unsigned char *data () { return data_; } // Defines an order relationship on blob_t. bool operator< (blob_t const &other) const { int cmpres = memcmp (data_, other.data_, std::min (size_, other.size_)); return cmpres < 0 || (cmpres == 0 && size_ < other.size_); } // Sets a blob_t to a deep copy of another blob_t. void set_deep_copy (blob_t const &other) { clear (); data_ = (unsigned char *) malloc (other.size_); size_ = other.size_; owned_ = true; memcpy (data_, other.data_, size_); } // Sets a blob_t to a copy of a given buffer. void set (const unsigned char *const data, const size_t size) { clear (); data_ = (unsigned char *) malloc (size); size_ = size; owned_ = true; memcpy (data_, data, size_); } // Empties a blob_t. void clear () { if (owned_) { free (data_); } data_ = 0; size_ = 0; } ~blob_t () { if (owned_) { free (data_); } } #ifdef ZMQ_HAS_MOVE_SEMANTICS blob_t (const blob_t &) = delete; blob_t &operator= (const blob_t &) = delete; blob_t (blob_t &&other) : data_ (other.data_), size_ (other.size_), owned_ (other.owned_) { other.owned_ = false; } blob_t &operator= (blob_t &&other) { if (this != &other) { clear (); data_ = other.data_; size_ = other.size_; owned_ = other.owned_; other.owned_ = false; } return *this; } #else blob_t (const blob_t &other) : owned_ (false) { set_deep_copy (other); } blob_t &operator= (const blob_t &other) { if (this != &other) { clear (); set_deep_copy (other); } return *this; } #endif private: unsigned char *data_; size_t size_; bool owned_; }; } #endif zeromq-4.2.5/src/curve_client_tools.hpp0000664000372000037200000002635613255253220021156 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CURVE_CLIENT_TOOLS_HPP_INCLUDED__ #define __ZMQ_CURVE_CLIENT_TOOLS_HPP_INCLUDED__ #ifdef ZMQ_HAVE_CURVE #if defined(ZMQ_USE_TWEETNACL) #include "tweetnacl.h" #elif defined(ZMQ_USE_LIBSODIUM) #include "sodium.h" #endif #if crypto_box_NONCEBYTES != 24 || crypto_box_PUBLICKEYBYTES != 32 \ || crypto_box_SECRETKEYBYTES != 32 || crypto_box_ZEROBYTES != 32 \ || crypto_box_BOXZEROBYTES != 16 #error "CURVE library not built properly" #endif #include "wire.hpp" #include "err.hpp" namespace zmq { struct curve_client_tools_t { static int produce_hello (void *data, const uint8_t *server_key, const uint64_t cn_nonce, const uint8_t *cn_public, const uint8_t *cn_secret) { uint8_t hello_nonce[crypto_box_NONCEBYTES]; uint8_t hello_plaintext[crypto_box_ZEROBYTES + 64]; uint8_t hello_box[crypto_box_BOXZEROBYTES + 80]; // Prepare the full nonce memcpy (hello_nonce, "CurveZMQHELLO---", 16); put_uint64 (hello_nonce + 16, cn_nonce); // Create Box [64 * %x0](C'->S) memset (hello_plaintext, 0, sizeof hello_plaintext); int rc = crypto_box (hello_box, hello_plaintext, sizeof hello_plaintext, hello_nonce, server_key, cn_secret); if (rc == -1) return -1; uint8_t *hello = static_cast (data); memcpy (hello, "\x05HELLO", 6); // CurveZMQ major and minor version numbers memcpy (hello + 6, "\1\0", 2); // Anti-amplification padding memset (hello + 8, 0, 72); // Client public connection key memcpy (hello + 80, cn_public, crypto_box_PUBLICKEYBYTES); // Short nonce, prefixed by "CurveZMQHELLO---" memcpy (hello + 112, hello_nonce + 16, 8); // Signature, Box [64 * %x0](C'->S) memcpy (hello + 120, hello_box + crypto_box_BOXZEROBYTES, 80); return 0; } static int process_welcome (const uint8_t *msg_data, size_t msg_size, const uint8_t *server_key, const uint8_t *cn_secret, uint8_t *cn_server, uint8_t *cn_cookie, uint8_t *cn_precom) { if (msg_size != 168) { errno = EPROTO; return -1; } uint8_t welcome_nonce[crypto_box_NONCEBYTES]; uint8_t welcome_plaintext[crypto_box_ZEROBYTES + 128]; uint8_t welcome_box[crypto_box_BOXZEROBYTES + 144]; // Open Box [S' + cookie](C'->S) memset (welcome_box, 0, crypto_box_BOXZEROBYTES); memcpy (welcome_box + crypto_box_BOXZEROBYTES, msg_data + 24, 144); memcpy (welcome_nonce, "WELCOME-", 8); memcpy (welcome_nonce + 8, msg_data + 8, 16); int rc = crypto_box_open (welcome_plaintext, welcome_box, sizeof welcome_box, welcome_nonce, server_key, cn_secret); if (rc != 0) { errno = EPROTO; return -1; } memcpy (cn_server, welcome_plaintext + crypto_box_ZEROBYTES, 32); memcpy (cn_cookie, welcome_plaintext + crypto_box_ZEROBYTES + 32, 16 + 80); // Message independent precomputation rc = crypto_box_beforenm (cn_precom, cn_server, cn_secret); zmq_assert (rc == 0); return 0; } static int produce_initiate (void *data, size_t size, const uint64_t cn_nonce, const uint8_t *server_key, const uint8_t *public_key, const uint8_t *secret_key, const uint8_t *cn_public, const uint8_t *cn_secret, const uint8_t *cn_server, const uint8_t *cn_cookie, const uint8_t *metadata_plaintext, const size_t metadata_length) { uint8_t vouch_nonce[crypto_box_NONCEBYTES]; uint8_t vouch_plaintext[crypto_box_ZEROBYTES + 64]; uint8_t vouch_box[crypto_box_BOXZEROBYTES + 80]; // Create vouch = Box [C',S](C->S') memset (vouch_plaintext, 0, crypto_box_ZEROBYTES); memcpy (vouch_plaintext + crypto_box_ZEROBYTES, cn_public, 32); memcpy (vouch_plaintext + crypto_box_ZEROBYTES + 32, server_key, 32); memcpy (vouch_nonce, "VOUCH---", 8); randombytes (vouch_nonce + 8, 16); int rc = crypto_box (vouch_box, vouch_plaintext, sizeof vouch_plaintext, vouch_nonce, cn_server, secret_key); if (rc == -1) return -1; uint8_t initiate_nonce[crypto_box_NONCEBYTES]; uint8_t *initiate_box = (uint8_t *) malloc (crypto_box_BOXZEROBYTES + 144 + metadata_length); alloc_assert (initiate_box); uint8_t *initiate_plaintext = (uint8_t *) malloc (crypto_box_ZEROBYTES + 128 + metadata_length); alloc_assert (initiate_plaintext); // Create Box [C + vouch + metadata](C'->S') memset (initiate_plaintext, 0, crypto_box_ZEROBYTES); memcpy (initiate_plaintext + crypto_box_ZEROBYTES, public_key, 32); memcpy (initiate_plaintext + crypto_box_ZEROBYTES + 32, vouch_nonce + 8, 16); memcpy (initiate_plaintext + crypto_box_ZEROBYTES + 48, vouch_box + crypto_box_BOXZEROBYTES, 80); memcpy (initiate_plaintext + crypto_box_ZEROBYTES + 48 + 80, metadata_plaintext, metadata_length); memcpy (initiate_nonce, "CurveZMQINITIATE", 16); put_uint64 (initiate_nonce + 16, cn_nonce); rc = crypto_box (initiate_box, initiate_plaintext, crypto_box_ZEROBYTES + 128 + metadata_length, initiate_nonce, cn_server, cn_secret); free (initiate_plaintext); if (rc == -1) return -1; uint8_t *initiate = static_cast (data); zmq_assert (size == 113 + 128 + crypto_box_BOXZEROBYTES + metadata_length); memcpy (initiate, "\x08INITIATE", 9); // Cookie provided by the server in the WELCOME command memcpy (initiate + 9, cn_cookie, 96); // Short nonce, prefixed by "CurveZMQINITIATE" memcpy (initiate + 105, initiate_nonce + 16, 8); // Box [C + vouch + metadata](C'->S') memcpy (initiate + 113, initiate_box + crypto_box_BOXZEROBYTES, 128 + metadata_length + crypto_box_BOXZEROBYTES); free (initiate_box); return 0; } static bool is_handshake_command_welcome (const uint8_t *msg_data, const size_t msg_size) { return is_handshake_command (msg_data, msg_size, "\7WELCOME"); } static bool is_handshake_command_ready (const uint8_t *msg_data, const size_t msg_size) { return is_handshake_command (msg_data, msg_size, "\5READY"); } static bool is_handshake_command_error (const uint8_t *msg_data, const size_t msg_size) { return is_handshake_command (msg_data, msg_size, "\5ERROR"); } // non-static functions curve_client_tools_t ( const uint8_t (&curve_public_key)[crypto_box_PUBLICKEYBYTES], const uint8_t (&curve_secret_key)[crypto_box_SECRETKEYBYTES], const uint8_t (&curve_server_key)[crypto_box_PUBLICKEYBYTES]) { int rc; memcpy (public_key, curve_public_key, crypto_box_PUBLICKEYBYTES); memcpy (secret_key, curve_secret_key, crypto_box_SECRETKEYBYTES); memcpy (server_key, curve_server_key, crypto_box_PUBLICKEYBYTES); // Generate short-term key pair rc = crypto_box_keypair (cn_public, cn_secret); zmq_assert (rc == 0); } int produce_hello (void *data, const uint64_t cn_nonce) const { return produce_hello (data, server_key, cn_nonce, cn_public, cn_secret); } int process_welcome (const uint8_t *msg_data, size_t msg_size, uint8_t *cn_precom) { return process_welcome (msg_data, msg_size, server_key, cn_secret, cn_server, cn_cookie, cn_precom); } int produce_initiate (void *data, size_t size, const uint64_t cn_nonce, const uint8_t *metadata_plaintext, const size_t metadata_length) { return produce_initiate ( data, size, cn_nonce, server_key, public_key, secret_key, cn_public, cn_secret, cn_server, cn_cookie, metadata_plaintext, metadata_length); } // Our public key (C) uint8_t public_key[crypto_box_PUBLICKEYBYTES]; // Our secret key (c) uint8_t secret_key[crypto_box_SECRETKEYBYTES]; // Our short-term public key (C') uint8_t cn_public[crypto_box_PUBLICKEYBYTES]; // Our short-term secret key (c') uint8_t cn_secret[crypto_box_SECRETKEYBYTES]; // Server's public key (S) uint8_t server_key[crypto_box_PUBLICKEYBYTES]; // Server's short-term public key (S') uint8_t cn_server[crypto_box_PUBLICKEYBYTES]; // Cookie received from server uint8_t cn_cookie[16 + 80]; private: template static bool is_handshake_command (const uint8_t *msg_data, const size_t msg_size, const char (&prefix)[N]) { return msg_size >= (N - 1) && !memcmp (msg_data, prefix, N - 1); } }; } #endif #endif zeromq-4.2.5/src/gssapi_client.hpp0000664000372000037200000000542013255253220020065 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GSSAPI_CLIENT_HPP_INCLUDED__ #define __ZMQ_GSSAPI_CLIENT_HPP_INCLUDED__ #ifdef HAVE_LIBGSSAPI_KRB5 #include "gssapi_mechanism_base.hpp" namespace zmq { class msg_t; class session_base_t; class gssapi_client_t : public gssapi_mechanism_base_t { public: gssapi_client_t (session_base_t *session_, const options_t &options_); virtual ~gssapi_client_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual int encode (msg_t *msg_); virtual int decode (msg_t *msg_); virtual status_t status () const; private: enum state_t { call_next_init, send_next_token, recv_next_token, send_ready, recv_ready, connected }; // Human-readable principal name of the service we are connecting to char *service_name; gss_OID service_name_type; // Current FSM state state_t state; // Points to either send_tok or recv_tok // during context initialization gss_buffer_desc *token_ptr; // The desired underlying mechanism gss_OID_set_desc mechs; // True iff client considers the server authenticated bool security_context_established; int initialize_context (); int produce_next_token (msg_t *msg_); int process_next_token (msg_t *msg_); }; } #endif #endif zeromq-4.2.5/src/tweetnacl.c0000664000372000037200000005127513255253220016673 0ustar00travistravis00000000000000/* Copyright (c) 2016-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ /* The precompiled header is not used for c files so this is required here. */ #include "platform.hpp" #if defined(ZMQ_USE_TWEETNACL) /* Disable warnings for this source only, rather than for the whole codebase when building with C99 (gcc >= 4.2) or with Microsoft's compiler */ #if defined __GNUC__ \ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) \ && __STDC_VERSION__ < 201112L #pragma GCC diagnostic ignored "-Wsign-compare" #elif defined _MSC_VER #pragma warning(disable : 4018 4244 4146) #endif // clang-format off #include "tweetnacl.h" #define FOR(i,n) for (i = 0;i < n;++i) #define sv static void static const u8 _0[16], _9[32] = {9}; static const gf gf0, gf1 = {1}, _121665 = {0xDB41,1}, D = {0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203}, D2 = {0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406}, X = {0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169}, Y = {0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666}, I = {0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83}; static u32 L32(u32 x,int c) { return (x << c) | ((x&0xffffffff) >> (32 - c)); } static u32 ld32(const u8 *x) { u32 u = x[3]; u = (u<<8)|x[2]; u = (u<<8)|x[1]; return (u<<8)|x[0]; } static u64 dl64(const u8 *x) { u64 i,u=0; FOR(i,8) u=(u<<8)|x[i]; return u; } sv st32(u8 *x,u32 u) { int i; FOR(i,4) { x[i] = u; u >>= 8; } } sv ts64(u8 *x,u64 u) { int i; for (i = 7;i >= 0;--i) { x[i] = u; u >>= 8; } } static int vn(const u8 *x,const u8 *y,int n) { u32 i,d = 0; FOR(i,n) d |= x[i]^y[i]; return (1 & ((d - 1) >> 8)) - 1; } int crypto_verify_16(const u8 *x,const u8 *y) { return vn(x,y,16); } int crypto_verify_32(const u8 *x,const u8 *y) { return vn(x,y,32); } sv core(u8 *out,const u8 *in,const u8 *k,const u8 *c,int h) { u32 w[16],x[16],y[16],t[4]; int i,j,m; FOR(i,4) { x[5*i] = ld32(c+4*i); x[1+i] = ld32(k+4*i); x[6+i] = ld32(in+4*i); x[11+i] = ld32(k+16+4*i); } FOR(i,16) y[i] = x[i]; FOR(i,20) { FOR(j,4) { FOR(m,4) t[m] = x[(5*j+4*m)%16]; t[1] ^= L32(t[0]+t[3], 7); t[2] ^= L32(t[1]+t[0], 9); t[3] ^= L32(t[2]+t[1],13); t[0] ^= L32(t[3]+t[2],18); FOR(m,4) w[4*j+(j+m)%4] = t[m]; } FOR(m,16) x[m] = w[m]; } if (h) { FOR(i,16) x[i] += y[i]; FOR(i,4) { x[5*i] -= ld32(c+4*i); x[6+i] -= ld32(in+4*i); } FOR(i,4) { st32(out+4*i,x[5*i]); st32(out+16+4*i,x[6+i]); } } else FOR(i,16) st32(out + 4 * i,x[i] + y[i]); } int crypto_core_salsa20(u8 *out,const u8 *in,const u8 *k,const u8 *c) { core(out,in,k,c,0); return 0; } int crypto_core_hsalsa20(u8 *out,const u8 *in,const u8 *k,const u8 *c) { core(out,in,k,c,1); return 0; } static const u8 sigma[16] = "expand 32-byte k"; int crypto_stream_salsa20_xor(u8 *c,const u8 *m,u64 b,const u8 *n,const u8 *k) { u8 z[16],x[64]; u32 u,i; if (!b) return 0; FOR(i,16) z[i] = 0; FOR(i,8) z[i] = n[i]; while (b >= 64) { crypto_core_salsa20(x,z,k,sigma); FOR(i,64) c[i] = (m?m[i]:0) ^ x[i]; u = 1; for (i = 8;i < 16;++i) { u += (u32) z[i]; z[i] = u; u >>= 8; } b -= 64; c += 64; if (m) m += 64; } if (b) { crypto_core_salsa20(x,z,k,sigma); FOR(i,b) c[i] = (m?m[i]:0) ^ x[i]; } return 0; } int crypto_stream_salsa20(u8 *c,u64 d,const u8 *n,const u8 *k) { return crypto_stream_salsa20_xor(c,0,d,n,k); } int crypto_stream(u8 *c,u64 d,const u8 *n,const u8 *k) { u8 s[32]; crypto_core_hsalsa20(s,n,k,sigma); return crypto_stream_salsa20(c,d,n+16,s); } int crypto_stream_xor(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) { u8 s[32]; crypto_core_hsalsa20(s,n,k,sigma); return crypto_stream_salsa20_xor(c,m,d,n+16,s); } sv add1305(u32 *h,const u32 *c) { u32 j,u = 0; FOR(j,17) { u += h[j] + c[j]; h[j] = u & 255; u >>= 8; } } static const u32 minusp[17] = { 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 } ; int crypto_onetimeauth(u8 *out,const u8 *m,u64 n,const u8 *k) { u32 s,i,j,u,x[17],r[17],h[17],c[17],g[17]; FOR(j,17) r[j]=h[j]=0; FOR(j,16) r[j]=k[j]; r[3]&=15; r[4]&=252; r[7]&=15; r[8]&=252; r[11]&=15; r[12]&=252; r[15]&=15; while (n > 0) { FOR(j,17) c[j] = 0; for (j = 0;(j < 16) && (j < n);++j) c[j] = m[j]; c[j] = 1; m += j; n -= j; add1305(h,c); FOR(i,17) { x[i] = 0; FOR(j,17) x[i] += h[j] * ((j <= i) ? r[i - j] : 320 * r[i + 17 - j]); } FOR(i,17) h[i] = x[i]; u = 0; FOR(j,16) { u += h[j]; h[j] = u & 255; u >>= 8; } u += h[16]; h[16] = u & 3; u = 5 * (u >> 2); FOR(j,16) { u += h[j]; h[j] = u & 255; u >>= 8; } u += h[16]; h[16] = u; } FOR(j,17) g[j] = h[j]; add1305(h,minusp); s = -(h[16] >> 7); FOR(j,17) h[j] ^= s & (g[j] ^ h[j]); FOR(j,16) c[j] = k[j + 16]; c[16] = 0; add1305(h,c); FOR(j,16) out[j] = h[j]; return 0; } int crypto_onetimeauth_verify(const u8 *h,const u8 *m,u64 n,const u8 *k) { u8 x[16]; crypto_onetimeauth(x,m,n,k); return crypto_verify_16(h,x); } int crypto_secretbox(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) { int i; if (d < 32) return -1; crypto_stream_xor(c,m,d,n,k); crypto_onetimeauth(c + 16,c + 32,d - 32,c); FOR(i,16) c[i] = 0; return 0; } int crypto_secretbox_open(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *k) { int i; u8 x[32]; if (d < 32) return -1; crypto_stream(x,32,n,k); if (crypto_onetimeauth_verify(c + 16,c + 32,d - 32,x) != 0) return -1; crypto_stream_xor(m,c,d,n,k); FOR(i,32) m[i] = 0; return 0; } sv set25519(gf r, const gf a) { int i; FOR(i,16) r[i]=a[i]; } sv car25519(gf o) { int i; i64 c; FOR(i,16) { o[i]+=(1LL<<16); c=o[i]>>16; o[(i+1)*(i<15)]+=c-1+37*(c-1)*(i==15); o[i]-=c<<16; } } sv sel25519(gf p,gf q,int b) { i64 t,i,c=~(b-1); FOR(i,16) { t= c&(p[i]^q[i]); p[i]^=t; q[i]^=t; } } sv pack25519(u8 *o,const gf n) { int i,j,b; gf m,t; FOR(i,16) t[i]=n[i]; car25519(t); car25519(t); car25519(t); FOR(j,2) { m[0]=t[0]-0xffed; for(i=1;i<15;i++) { m[i]=t[i]-0xffff-((m[i-1]>>16)&1); m[i-1]&=0xffff; } m[15]=t[15]-0x7fff-((m[14]>>16)&1); b=(m[15]>>16)&1; m[14]&=0xffff; sel25519(t,m,1-b); } FOR(i,16) { o[2*i]=t[i]&0xff; o[2*i+1]=t[i]>>8; } } static int neq25519(const gf a, const gf b) { u8 c[32],d[32]; pack25519(c,a); pack25519(d,b); return crypto_verify_32(c,d); } static u8 par25519(const gf a) { u8 d[32]; pack25519(d,a); return d[0]&1; } sv unpack25519(gf o, const u8 *n) { int i; FOR(i,16) o[i]=n[2*i]+((i64)n[2*i+1]<<8); o[15]&=0x7fff; } sv A(gf o,const gf a,const gf b) { int i; FOR(i,16) o[i]=a[i]+b[i]; } sv Z(gf o,const gf a,const gf b) { int i; FOR(i,16) o[i]=a[i]-b[i]; } sv M(gf o,const gf a,const gf b) { i64 i,j,t[31]; FOR(i,31) t[i]=0; FOR(i,16) FOR(j,16) t[i+j]+=a[i]*b[j]; FOR(i,15) t[i]+=38*t[i+16]; FOR(i,16) o[i]=t[i]; car25519(o); car25519(o); } sv S(gf o,const gf a) { M(o,a,a); } sv inv25519(gf o,const gf i) { gf c; int a; FOR(a,16) c[a]=i[a]; for(a=253;a>=0;a--) { S(c,c); if(a!=2&&a!=4) M(c,c,i); } FOR(a,16) o[a]=c[a]; } sv pow2523(gf o,const gf i) { gf c; int a; FOR(a,16) c[a]=i[a]; for(a=250;a>=0;a--) { S(c,c); if(a!=1) M(c,c,i); } FOR(a,16) o[a]=c[a]; } int crypto_scalarmult(u8 *q,const u8 *n,const u8 *p) { u8 z[32]; i64 x[80],r,i; gf a,b,c,d,e,f; FOR(i,31) z[i]=n[i]; z[31]=(n[31]&127)|64; z[0]&=248; unpack25519(x,p); FOR(i,16) { b[i]=x[i]; d[i]=a[i]=c[i]=0; } a[0]=d[0]=1; for(i=254;i>=0;--i) { r=(z[i>>3]>>(i&7))&1; sel25519(a,b,r); sel25519(c,d,r); A(e,a,c); Z(a,a,c); A(c,b,d); Z(b,b,d); S(d,e); S(f,a); M(a,c,a); M(c,b,e); A(e,a,c); Z(a,a,c); S(b,a); Z(c,d,f); M(a,c,_121665); A(a,a,d); M(c,c,a); M(a,d,f); M(d,b,x); S(b,e); sel25519(a,b,r); sel25519(c,d,r); } FOR(i,16) { x[i+16]=a[i]; x[i+32]=c[i]; x[i+48]=b[i]; x[i+64]=d[i]; } inv25519(x+32,x+32); M(x+16,x+16,x+32); pack25519(q,x+16); return 0; } int crypto_scalarmult_base(u8 *q,const u8 *n) { return crypto_scalarmult(q,n,_9); } int crypto_box_keypair(u8 *y,u8 *x) { randombytes(x,32); return crypto_scalarmult_base(y,x); } int crypto_box_beforenm(u8 *k,const u8 *y,const u8 *x) { u8 s[32]; crypto_scalarmult(s,x,y); return crypto_core_hsalsa20(k,_0,s,sigma); } int crypto_box_afternm(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *k) { return crypto_secretbox(c,m,d,n,k); } int crypto_box_open_afternm(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *k) { return crypto_secretbox_open(m,c,d,n,k); } int crypto_box(u8 *c,const u8 *m,u64 d,const u8 *n,const u8 *y,const u8 *x) { u8 k[32]; crypto_box_beforenm(k,y,x); return crypto_box_afternm(c,m,d,n,k); } int crypto_box_open(u8 *m,const u8 *c,u64 d,const u8 *n,const u8 *y,const u8 *x) { u8 k[32]; crypto_box_beforenm(k,y,x); return crypto_box_open_afternm(m,c,d,n,k); } static u64 R(u64 x,int c) { return (x >> c) | (x << (64 - c)); } static u64 Ch(u64 x,u64 y,u64 z) { return (x & y) ^ (~x & z); } static u64 Maj(u64 x,u64 y,u64 z) { return (x & y) ^ (x & z) ^ (y & z); } static u64 Sigma0(u64 x) { return R(x,28) ^ R(x,34) ^ R(x,39); } static u64 Sigma1(u64 x) { return R(x,14) ^ R(x,18) ^ R(x,41); } static u64 sigma0(u64 x) { return R(x, 1) ^ R(x, 8) ^ (x >> 7); } static u64 sigma1(u64 x) { return R(x,19) ^ R(x,61) ^ (x >> 6); } static const u64 K[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; int crypto_hashblocks(u8 *x,const u8 *m,u64 n) { u64 z[8],b[8],a[8],w[16],t; int i,j; FOR(i,8) z[i] = a[i] = dl64(x + 8 * i); while (n >= 128) { FOR(i,16) w[i] = dl64(m + 8 * i); FOR(i,80) { FOR(j,8) b[j] = a[j]; t = a[7] + Sigma1(a[4]) + Ch(a[4],a[5],a[6]) + K[i] + w[i%16]; b[7] = t + Sigma0(a[0]) + Maj(a[0],a[1],a[2]); b[3] += t; FOR(j,8) a[(j+1)%8] = b[j]; if (i%16 == 15) FOR(j,16) w[j] += w[(j+9)%16] + sigma0(w[(j+1)%16]) + sigma1(w[(j+14)%16]); } FOR(i,8) { a[i] += z[i]; z[i] = a[i]; } m += 128; n -= 128; } FOR(i,8) ts64(x+8*i,z[i]); return n; } static const u8 iv[64] = { 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 } ; int crypto_hash(u8 *out,const u8 *m,u64 n) { u8 h[64],x[256]; u64 i,b = n; FOR(i,64) h[i] = iv[i]; crypto_hashblocks(h,m,n); m += n; n &= 127; m -= n; FOR(i,256) x[i] = 0; FOR(i,n) x[i] = m[i]; x[n] = 128; n = 256-128*(n<112); x[n-9] = b >> 61; ts64(x+n-8,b<<3); crypto_hashblocks(h,x,n); FOR(i,64) out[i] = h[i]; return 0; } sv add(gf p[4],gf q[4]) { gf a,b,c,d,t,e,f,g,h; Z(a, p[1], p[0]); Z(t, q[1], q[0]); M(a, a, t); A(b, p[0], p[1]); A(t, q[0], q[1]); M(b, b, t); M(c, p[3], q[3]); M(c, c, D2); M(d, p[2], q[2]); A(d, d, d); Z(e, b, a); Z(f, d, c); A(g, d, c); A(h, b, a); M(p[0], e, f); M(p[1], h, g); M(p[2], g, f); M(p[3], e, h); } sv cswap(gf p[4],gf q[4],u8 b) { int i; FOR(i,4) sel25519(p[i],q[i],b); } sv pack(u8 *r,gf p[4]) { gf tx, ty, zi; inv25519(zi, p[2]); M(tx, p[0], zi); M(ty, p[1], zi); pack25519(r, ty); r[31] ^= par25519(tx) << 7; } sv scalarmult(gf p[4],gf q[4],const u8 *s) { int i; set25519(p[0],gf0); set25519(p[1],gf1); set25519(p[2],gf1); set25519(p[3],gf0); for (i = 255;i >= 0;--i) { u8 b = (s[i/8]>>(i&7))&1; cswap(p,q,b); add(q,p); add(p,p); cswap(p,q,b); } } sv scalarbase(gf p[4],const u8 *s) { gf q[4]; set25519(q[0],X); set25519(q[1],Y); set25519(q[2],gf1); M(q[3],X,Y); scalarmult(p,q,s); } int crypto_sign_keypair(u8 *pk, u8 *sk) { u8 d[64]; gf p[4]; int i; randombytes(sk, 32); crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; scalarbase(p,d); pack(pk,p); FOR(i,32) sk[32 + i] = pk[i]; return 0; } static const u64 L[32] = {0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10}; sv modL(u8 *r,i64 x[64]) { i64 carry,i,j; for (i = 63;i >= 32;--i) { carry = 0; for (j = i - 32;j < i - 12;++j) { x[j] += carry - 16 * x[i] * L[j - (i - 32)]; carry = (x[j] + 128) >> 8; x[j] -= carry << 8; } x[j] += carry; x[i] = 0; } carry = 0; FOR(j,32) { x[j] += carry - (x[31] >> 4) * L[j]; carry = x[j] >> 8; x[j] &= 255; } FOR(j,32) x[j] -= carry * L[j]; FOR(i,32) { x[i+1] += x[i] >> 8; r[i] = x[i] & 255; } } sv reduce(u8 *r) { i64 x[64],i; FOR(i,64) x[i] = (u64) r[i]; FOR(i,64) r[i] = 0; modL(r,x); } int crypto_sign(u8 *sm,u64 *smlen,const u8 *m,u64 n,const u8 *sk) { u8 d[64],h[64],r[64]; i64 i,j,x[64]; gf p[4]; crypto_hash(d, sk, 32); d[0] &= 248; d[31] &= 127; d[31] |= 64; *smlen = n+64; FOR(i,n) sm[64 + i] = m[i]; FOR(i,32) sm[32 + i] = d[32 + i]; crypto_hash(r, sm+32, n+32); reduce(r); scalarbase(p,r); pack(sm,p); FOR(i,32) sm[i+32] = sk[i+32]; crypto_hash(h,sm,n + 64); reduce(h); FOR(i,64) x[i] = 0; FOR(i,32) x[i] = (u64) r[i]; FOR(i,32) FOR(j,32) x[i+j] += h[i] * (u64) d[j]; modL(sm + 32,x); return 0; } static int unpackneg(gf r[4],const u8 p[32]) { gf t, chk, num, den, den2, den4, den6; set25519(r[2],gf1); unpack25519(r[1],p); S(num,r[1]); M(den,num,D); Z(num,num,r[2]); A(den,r[2],den); S(den2,den); S(den4,den2); M(den6,den4,den2); M(t,den6,num); M(t,t,den); pow2523(t,t); M(t,t,num); M(t,t,den); M(t,t,den); M(r[0],t,den); S(chk,r[0]); M(chk,chk,den); if (neq25519(chk, num)) M(r[0],r[0],I); S(chk,r[0]); M(chk,chk,den); if (neq25519(chk, num)) return -1; if (par25519(r[0]) == (p[31]>>7)) Z(r[0],gf0,r[0]); M(r[3],r[0],r[1]); return 0; } int crypto_sign_open(u8 *m,u64 *mlen,const u8 *sm,u64 n,const u8 *pk) { int i; u8 t[32],h[64]; gf p[4],q[4]; *mlen = -1; if (n < 64) return -1; if (unpackneg(q,pk)) return -1; FOR(i,n) m[i] = sm[i]; FOR(i,32) m[i+32] = pk[i]; crypto_hash(h,m,n); reduce(h); scalarmult(p,q,h); scalarbase(q,sm + 32); add(p,q); pack(t,p); n -= 64; if (crypto_verify_32(sm, t)) { FOR(i,n) m[i] = 0; return -1; } FOR(i,n) m[i] = sm[i + 64]; *mlen = n; return 0; } #ifdef ZMQ_HAVE_WINDOWS #include #include #define NCP ((HCRYPTPROV) 0) HCRYPTPROV hProvider = NCP; void randombytes(unsigned char *x,unsigned long long xlen) { unsigned i; BOOL ret; if (hProvider == NCP) { for (;;) { ret = CryptAcquireContext(&hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT); if (ret != FALSE) break; Sleep (1); } } while (xlen > 0) { if (xlen < 1048576) i = (unsigned) xlen; else i = 1048576; ret = CryptGenRandom(hProvider, i, x); if (ret == FALSE) { Sleep(1); continue; } x += i; xlen -= i; } } int randombytes_close(void) { int rc = -1; if ((hProvider != NCP) && (CryptReleaseContext(hProvider, 0) != FALSE)) { hProvider = NCP; rc = 0; } return rc; } int sodium_init (void) { return 0; } #else #include #include #ifdef ZMQ_HAVE_GETRANDOM #include #else #include #include #include static int fd = -1; #endif void randombytes (unsigned char *x,unsigned long long xlen) { int i; #ifndef ZMQ_HAVE_GETRANDOM // Require that random_open has already been called, to avoid // race conditions. assert (fd != -1); #endif while (xlen > 0) { if (xlen < 1048576) i = xlen; else i = 1048576; #ifdef ZMQ_HAVE_GETRANDOM i = getrandom (x, i, 0); #else i = read(fd,x,i); #endif if (i < 1) { sleep (1); continue; } x += i; xlen -= i; } } // Do not call manually! Use random_close from random.hpp int randombytes_close (void) { int rc = -1; #ifndef ZMQ_HAVE_GETRANDOM if (fd != -1 && close(fd) == 0) { fd = -1; rc = 0; } #endif // ZMQ_HAVE_GETRANDOM return rc; } // Do not call manually! Use random_open from random.hpp int sodium_init (void) { #ifndef ZMQ_HAVE_GETRANDOM if (fd == -1) { for (;;) { int flags = O_RDONLY; #ifdef ZMQ_HAVE_O_CLOEXEC flags |= O_CLOEXEC; #endif fd = open ("/dev/urandom", flags); if (fd != -1) break; sleep (1); } #if !defined ZMQ_HAVE_O_CLOEXEC && defined FD_CLOEXEC int rc = fcntl (fd, F_SETFD, FD_CLOEXEC); assert (rc != -1); #endif } #endif // ZMQ_HAVE_GETRANDOM return 0; } #endif #endif // clang-format on zeromq-4.2.5/src/i_decoder.hpp0000664000372000037200000000412413255253220017156 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_I_DECODER_HPP_INCLUDED__ #define __ZMQ_I_DECODER_HPP_INCLUDED__ #include "stdint.hpp" namespace zmq { class msg_t; // Interface to be implemented by message decoder. class i_decoder { public: virtual ~i_decoder () {} virtual void get_buffer (unsigned char **data_, size_t *size_) = 0; virtual void resize_buffer (size_t) = 0; // Decodes data pointed to by data_. // When a message is decoded, 1 is returned. // When the decoder needs more data, 0 is returned. // On error, -1 is returned and errno is set accordingly. virtual int decode (const unsigned char *data_, size_t size_, size_t &processed) = 0; virtual msg_t *msg () = 0; }; } #endif zeromq-4.2.5/src/pull.hpp0000664000372000037200000000431213255253220016214 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PULL_HPP_INCLUDED__ #define __ZMQ_PULL_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "fq.hpp" namespace zmq { class ctx_t; class pipe_t; class msg_t; class io_thread_t; class pull_t : public socket_base_t { public: pull_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~pull_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Fair queueing object for inbound pipes. fq_t fq; pull_t (const pull_t &); const pull_t &operator= (const pull_t &); }; } #endif zeromq-4.2.5/src/socks.cpp0000664000372000037200000001726413255253220016367 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "err.hpp" #include "socks.hpp" #include "tcp.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #include #include #endif zmq::socks_greeting_t::socks_greeting_t (uint8_t method_) : num_methods (1) { methods[0] = method_; } zmq::socks_greeting_t::socks_greeting_t (uint8_t *methods_, uint8_t num_methods_) : num_methods (num_methods_) { for (uint8_t i = 0; i < num_methods_; i++) methods[i] = methods_[i]; } zmq::socks_greeting_encoder_t::socks_greeting_encoder_t () : bytes_encoded (0), bytes_written (0) { } void zmq::socks_greeting_encoder_t::encode (const socks_greeting_t &greeting_) { uint8_t *ptr = buf; *ptr++ = 0x05; *ptr++ = (uint8_t) greeting_.num_methods; for (uint8_t i = 0; i < greeting_.num_methods; i++) *ptr++ = greeting_.methods[i]; bytes_encoded = 2 + greeting_.num_methods; bytes_written = 0; } int zmq::socks_greeting_encoder_t::output (fd_t fd_) { const int rc = tcp_write (fd_, buf + bytes_written, bytes_encoded - bytes_written); if (rc > 0) bytes_written += static_cast (rc); return rc; } bool zmq::socks_greeting_encoder_t::has_pending_data () const { return bytes_written < bytes_encoded; } void zmq::socks_greeting_encoder_t::reset () { bytes_encoded = bytes_written = 0; } zmq::socks_choice_t::socks_choice_t (unsigned char method_) : method (method_) { } zmq::socks_choice_decoder_t::socks_choice_decoder_t () : bytes_read (0) { } int zmq::socks_choice_decoder_t::input (fd_t fd_) { zmq_assert (bytes_read < 2); const int rc = tcp_read (fd_, buf + bytes_read, 2 - bytes_read); if (rc > 0) { bytes_read += static_cast (rc); if (buf[0] != 0x05) return -1; } return rc; } bool zmq::socks_choice_decoder_t::message_ready () const { return bytes_read == 2; } zmq::socks_choice_t zmq::socks_choice_decoder_t::decode () { zmq_assert (message_ready ()); return socks_choice_t (buf[1]); } void zmq::socks_choice_decoder_t::reset () { bytes_read = 0; } zmq::socks_request_t::socks_request_t (uint8_t command_, std::string hostname_, uint16_t port_) : command (command_), hostname (hostname_), port (port_) { zmq_assert (hostname_.size () <= UINT8_MAX); } zmq::socks_request_encoder_t::socks_request_encoder_t () : bytes_encoded (0), bytes_written (0) { } void zmq::socks_request_encoder_t::encode (const socks_request_t &req) { zmq_assert (req.hostname.size () <= UINT8_MAX); unsigned char *ptr = buf; *ptr++ = 0x05; *ptr++ = req.command; *ptr++ = 0x00; #if defined ZMQ_HAVE_OPENVMS && defined __ia64 && __INITIAL_POINTER_SIZE == 64 __addrinfo64 hints, *res = NULL; #else addrinfo hints, *res = NULL; #endif memset (&hints, 0, sizeof hints); // Suppress potential DNS lookups. hints.ai_flags = AI_NUMERICHOST; const int rc = getaddrinfo (req.hostname.c_str (), NULL, &hints, &res); if (rc == 0 && res->ai_family == AF_INET) { struct sockaddr_in *sockaddr_in = reinterpret_cast (res->ai_addr); *ptr++ = 0x01; memcpy (ptr, &sockaddr_in->sin_addr, 4); ptr += 4; } else if (rc == 0 && res->ai_family == AF_INET6) { struct sockaddr_in6 *sockaddr_in6 = reinterpret_cast (res->ai_addr); *ptr++ = 0x04; memcpy (ptr, &sockaddr_in6->sin6_addr, 16); ptr += 16; } else { *ptr++ = 0x03; *ptr++ = (unsigned char) req.hostname.size (); memcpy (ptr, req.hostname.c_str (), req.hostname.size ()); ptr += req.hostname.size (); } if (rc == 0) freeaddrinfo (res); *ptr++ = req.port / 256; *ptr++ = req.port % 256; bytes_encoded = ptr - buf; bytes_written = 0; } int zmq::socks_request_encoder_t::output (fd_t fd_) { const int rc = tcp_write (fd_, buf + bytes_written, bytes_encoded - bytes_written); if (rc > 0) bytes_written += static_cast (rc); return rc; } bool zmq::socks_request_encoder_t::has_pending_data () const { return bytes_written < bytes_encoded; } void zmq::socks_request_encoder_t::reset () { bytes_encoded = bytes_written = 0; } zmq::socks_response_t::socks_response_t (uint8_t response_code_, std::string address_, uint16_t port_) : response_code (response_code_), address (address_), port (port_) { } zmq::socks_response_decoder_t::socks_response_decoder_t () : bytes_read (0) { } int zmq::socks_response_decoder_t::input (fd_t fd_) { size_t n = 0; if (bytes_read < 5) n = 5 - bytes_read; else { const uint8_t atyp = buf[3]; zmq_assert (atyp == 0x01 || atyp == 0x03 || atyp == 0x04); if (atyp == 0x01) n = 3 + 2; else if (atyp == 0x03) n = buf[4] + 2; else if (atyp == 0x04) n = 15 + 2; } const int rc = tcp_read (fd_, buf + bytes_read, n); if (rc > 0) { bytes_read += static_cast (rc); if (buf[0] != 0x05) return -1; if (bytes_read >= 2) if (buf[1] > 0x08) return -1; if (bytes_read >= 3) if (buf[2] != 0x00) return -1; if (bytes_read >= 4) { const uint8_t atyp = buf[3]; if (atyp != 0x01 && atyp != 0x03 && atyp != 0x04) return -1; } } return rc; } bool zmq::socks_response_decoder_t::message_ready () const { if (bytes_read < 4) return false; else { const uint8_t atyp = buf[3]; zmq_assert (atyp == 0x01 || atyp == 0x03 || atyp == 0x04); if (atyp == 0x01) return bytes_read == 10; else if (atyp == 0x03) return bytes_read > 4 && bytes_read == 4 + 1 + buf[4] + 2u; else return bytes_read == 22; } } zmq::socks_response_t zmq::socks_response_decoder_t::decode () { zmq_assert (message_ready ()); return socks_response_t (buf[1], "", 0); } void zmq::socks_response_decoder_t::reset () { bytes_read = 0; } zeromq-4.2.5/src/socks_connecter.hpp0000664000372000037200000001212113255253220020417 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __SOCKS_CONNECTER_HPP_INCLUDED__ #define __SOCKS_CONNECTER_HPP_INCLUDED__ #include "fd.hpp" #include "io_object.hpp" #include "own.hpp" #include "stdint.hpp" #include "socks.hpp" namespace zmq { class io_thread_t; class session_base_t; struct address_t; class socks_connecter_t : public own_t, public io_object_t { public: // If 'delayed_start' is true connecter first waits for a while, // then starts connection process. socks_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, address_t *addr_, address_t *proxy_addr_, bool delayed_start_); ~socks_connecter_t (); private: enum { unplugged, waiting_for_reconnect_time, waiting_for_proxy_connection, sending_greeting, waiting_for_choice, sending_request, waiting_for_response }; // ID of the timer used to delay the reconnection. enum { reconnect_timer_id = 1 }; // Method ID enum { socks_no_auth_required = 0 }; // Handlers for incoming commands. virtual void process_plug (); virtual void process_term (int linger_); // Handlers for I/O events. virtual void in_event (); virtual void out_event (); virtual void timer_event (int id_); // Internal function to start the actual connection establishment. void initiate_connect (); int process_server_response (const socks_choice_t &response); int process_server_response (const socks_response_t &response); int parse_address (const std::string &address_, std::string &hostname_, uint16_t &port_); int connect_to_proxy (); void error (); // Internal function to start reconnect timer void start_timer (); // Internal function to return a reconnect backoff delay. // Will modify the current_reconnect_ivl used for next call // Returns the currently used interval int get_new_reconnect_ivl (); // Open TCP connecting socket. Returns -1 in case of error, // 0 if connect was successful immediately. Returns -1 with // EAGAIN errno if async connect was launched. int open (); // Close the connecting socket. void close (); // Get the file descriptor of newly created connection. Returns // retired_fd if the connection was unsuccessful. zmq::fd_t check_proxy_connection (); socks_greeting_encoder_t greeting_encoder; socks_choice_decoder_t choice_decoder; socks_request_encoder_t request_encoder; socks_response_decoder_t response_decoder; // Address to connect to. Owned by session_base_t. address_t *addr; // SOCKS address; owned by this connecter. address_t *proxy_addr; int status; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // If true file descriptor is registered with the poller and 'handle' // contains valid value. bool handle_valid; // If true, connecter is waiting a while before trying to connect. const bool delayed_start; // True iff a timer has been started. bool timer_started; // Reference to the session we belong to. zmq::session_base_t *session; // Current reconnect ivl, updated for backoff strategy int current_reconnect_ivl; // String representation of endpoint to connect to std::string endpoint; // Socket zmq::socket_base_t *socket; socks_connecter_t (const socks_connecter_t &); const socks_connecter_t &operator= (const socks_connecter_t &); }; } #endif zeromq-4.2.5/src/address.cpp0000664000372000037200000000760713255253220016672 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "address.hpp" #include "ctx.hpp" #include "err.hpp" #include "tcp_address.hpp" #include "udp_address.hpp" #include "ipc_address.hpp" #include "tipc_address.hpp" #if defined ZMQ_HAVE_VMCI #include "vmci_address.hpp" #endif #include #include zmq::address_t::address_t (const std::string &protocol_, const std::string &address_, ctx_t *parent_) : protocol (protocol_), address (address_), parent (parent_) { memset (&resolved, 0, sizeof resolved); } zmq::address_t::~address_t () { if (protocol == "tcp") { if (resolved.tcp_addr) { LIBZMQ_DELETE (resolved.tcp_addr); } } if (protocol == "udp") { if (resolved.udp_addr) { LIBZMQ_DELETE (resolved.udp_addr); } } #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS else if (protocol == "ipc") { if (resolved.ipc_addr) { LIBZMQ_DELETE (resolved.ipc_addr); } } #endif #if defined ZMQ_HAVE_TIPC else if (protocol == "tipc") { if (resolved.tipc_addr) { LIBZMQ_DELETE (resolved.tipc_addr); } } #endif #if defined ZMQ_HAVE_VMCI else if (protocol == "vmci") { if (resolved.vmci_addr) { LIBZMQ_DELETE (resolved.vmci_addr); } } #endif } int zmq::address_t::to_string (std::string &addr_) const { if (protocol == "tcp") { if (resolved.tcp_addr) return resolved.tcp_addr->to_string (addr_); } if (protocol == "udp") { if (resolved.udp_addr) return resolved.udp_addr->to_string (addr_); } #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS else if (protocol == "ipc") { if (resolved.ipc_addr) return resolved.ipc_addr->to_string (addr_); } #endif #if defined ZMQ_HAVE_TIPC else if (protocol == "tipc") { if (resolved.tipc_addr) return resolved.tipc_addr->to_string (addr_); } #endif #if defined ZMQ_HAVE_VMCI else if (protocol == "vmci") { if (resolved.vmci_addr) return resolved.vmci_addr->to_string (addr_); } #endif if (!protocol.empty () && !address.empty ()) { std::stringstream s; s << protocol << "://" << address; addr_ = s.str (); return 0; } addr_.clear (); return -1; } zeromq-4.2.5/src/v2_encoder.hpp0000664000372000037200000000364513255253220017276 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_V2_ENCODER_HPP_INCLUDED__ #define __ZMQ_V2_ENCODER_HPP_INCLUDED__ #include "encoder.hpp" namespace zmq { // Encoder for 0MQ framing protocol. Converts messages into data stream. class v2_encoder_t : public encoder_base_t { public: v2_encoder_t (size_t bufsize_); virtual ~v2_encoder_t (); private: void size_ready (); void message_ready (); unsigned char tmpbuf[9]; v2_encoder_t (const v2_encoder_t &); const v2_encoder_t &operator= (const v2_encoder_t &); }; } #endif zeromq-4.2.5/src/decoder.hpp0000664000372000037200000001552513255253220016655 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DECODER_HPP_INCLUDED__ #define __ZMQ_DECODER_HPP_INCLUDED__ #include #include #include #include "decoder_allocators.hpp" #include "err.hpp" #include "i_decoder.hpp" #include "msg.hpp" #include "stdint.hpp" namespace zmq { // Helper base class for decoders that know the amount of data to read // in advance at any moment. Knowing the amount in advance is a property // of the protocol used. 0MQ framing protocol is based size-prefixed // paradigm, which qualifies it to be parsed by this class. // On the other hand, XML-based transports (like XMPP or SOAP) don't allow // for knowing the size of data to read in advance and should use different // decoding algorithms. // // This class implements the state machine that parses the incoming buffer. // Derived class should implement individual state machine actions. // // Buffer management is done by an allocator policy. template class decoder_base_t : public i_decoder { public: explicit decoder_base_t (A *allocator_) : next (NULL), read_pos (NULL), to_read (0), allocator (allocator_) { buf = allocator->allocate (); } // The destructor doesn't have to be virtual. It is made virtual // just to keep ICC and code checking tools from complaining. virtual ~decoder_base_t () { allocator->deallocate (); } // Returns a buffer to be filled with binary data. void get_buffer (unsigned char **data_, std::size_t *size_) { buf = allocator->allocate (); // If we are expected to read large message, we'll opt for zero- // copy, i.e. we'll ask caller to fill the data directly to the // message. Note that subsequent read(s) are non-blocking, thus // each single read reads at most SO_RCVBUF bytes at once not // depending on how large is the chunk returned from here. // As a consequence, large messages being received won't block // other engines running in the same I/O thread for excessive // amounts of time. if (to_read >= allocator->size ()) { *data_ = read_pos; *size_ = to_read; return; } *data_ = buf; *size_ = allocator->size (); } // Processes the data in the buffer previously allocated using // get_buffer function. size_ argument specifies number of bytes // actually filled into the buffer. Function returns 1 when the // whole message was decoded or 0 when more data is required. // On error, -1 is returned and errno set accordingly. // Number of bytes processed is returned in bytes_used_. int decode (const unsigned char *data_, std::size_t size_, std::size_t &bytes_used_) { bytes_used_ = 0; // In case of zero-copy simply adjust the pointers, no copying // is required. Also, run the state machine in case all the data // were processed. if (data_ == read_pos) { zmq_assert (size_ <= to_read); read_pos += size_; to_read -= size_; bytes_used_ = size_; while (!to_read) { const int rc = (static_cast (this)->*next) (data_ + bytes_used_); if (rc != 0) return rc; } return 0; } while (bytes_used_ < size_) { // Copy the data from buffer to the message. const size_t to_copy = std::min (to_read, size_ - bytes_used_); // Only copy when destination address is different from the // current address in the buffer. if (read_pos != data_ + bytes_used_) { memcpy (read_pos, data_ + bytes_used_, to_copy); } read_pos += to_copy; to_read -= to_copy; bytes_used_ += to_copy; // Try to get more space in the message to fill in. // If none is available, return. while (to_read == 0) { // pass current address in the buffer const int rc = (static_cast (this)->*next) (data_ + bytes_used_); if (rc != 0) return rc; } } return 0; } virtual void resize_buffer (std::size_t new_size) { allocator->resize (new_size); } protected: // Prototype of state machine action. Action should return false if // it is unable to push the data to the system. typedef int (T::*step_t) (unsigned char const *); // This function should be called from derived class to read data // from the buffer and schedule next state machine action. void next_step (void *read_pos_, std::size_t to_read_, step_t next_) { read_pos = static_cast (read_pos_); to_read = to_read_; next = next_; } private: // Next step. If set to NULL, it means that associated data stream // is dead. Note that there can be still data in the process in such // case. step_t next; // Where to store the read data. unsigned char *read_pos; // How much data to read before taking next step. std::size_t to_read; // The duffer for data to decode. A *allocator; unsigned char *buf; decoder_base_t (const decoder_base_t &); const decoder_base_t &operator= (const decoder_base_t &); }; } #endif zeromq-4.2.5/src/msg.cpp0000664000372000037200000003444213255253220016030 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "msg.hpp" #include #include #include #include "stdint.hpp" #include "likely.hpp" #include "metadata.hpp" #include "err.hpp" // Check whether the sizes of public representation of the message (zmq_msg_t) // and private representation of the message (zmq::msg_t) match. typedef char zmq_msg_size_check[2 * ((sizeof (zmq::msg_t) == sizeof (zmq_msg_t)) != 0) - 1]; bool zmq::msg_t::check () const { return u.base.type >= type_min && u.base.type <= type_max; } int zmq::msg_t::init ( void *data_, size_t size_, msg_free_fn *ffn_, void *hint, content_t *content_) { if (size_ < max_vsm_size) { int const rc = init_size (size_); if (rc != -1) { memcpy (data (), data_, size_); return 0; } else { return -1; } } else if (content_) { return init_external_storage (content_, data_, size_, ffn_, hint); } else { return init_data (data_, size_, ffn_, hint); } } int zmq::msg_t::init () { u.vsm.metadata = NULL; u.vsm.type = type_vsm; u.vsm.flags = 0; u.vsm.size = 0; u.vsm.group[0] = '\0'; u.vsm.routing_id = 0; return 0; } int zmq::msg_t::init_size (size_t size_) { if (size_ <= max_vsm_size) { u.vsm.metadata = NULL; u.vsm.type = type_vsm; u.vsm.flags = 0; u.vsm.size = (unsigned char) size_; u.vsm.group[0] = '\0'; u.vsm.routing_id = 0; } else { u.lmsg.metadata = NULL; u.lmsg.type = type_lmsg; u.lmsg.flags = 0; u.lmsg.group[0] = '\0'; u.lmsg.routing_id = 0; u.lmsg.content = NULL; if (sizeof (content_t) + size_ > size_) u.lmsg.content = (content_t *) malloc (sizeof (content_t) + size_); if (unlikely (!u.lmsg.content)) { errno = ENOMEM; return -1; } u.lmsg.content->data = u.lmsg.content + 1; u.lmsg.content->size = size_; u.lmsg.content->ffn = NULL; u.lmsg.content->hint = NULL; new (&u.lmsg.content->refcnt) zmq::atomic_counter_t (); } return 0; } int zmq::msg_t::init_external_storage (content_t *content_, void *data_, size_t size_, msg_free_fn *ffn_, void *hint_) { zmq_assert (NULL != data_); zmq_assert (NULL != content_); u.zclmsg.metadata = NULL; u.zclmsg.type = type_zclmsg; u.zclmsg.flags = 0; u.zclmsg.group[0] = '\0'; u.zclmsg.routing_id = 0; u.zclmsg.content = content_; u.zclmsg.content->data = data_; u.zclmsg.content->size = size_; u.zclmsg.content->ffn = ffn_; u.zclmsg.content->hint = hint_; new (&u.zclmsg.content->refcnt) zmq::atomic_counter_t (); return 0; } int zmq::msg_t::init_data (void *data_, size_t size_, msg_free_fn *ffn_, void *hint_) { // If data is NULL and size is not 0, a segfault // would occur once the data is accessed zmq_assert (data_ != NULL || size_ == 0); // Initialize constant message if there's no need to deallocate if (ffn_ == NULL) { u.cmsg.metadata = NULL; u.cmsg.type = type_cmsg; u.cmsg.flags = 0; u.cmsg.data = data_; u.cmsg.size = size_; u.cmsg.group[0] = '\0'; u.cmsg.routing_id = 0; } else { u.lmsg.metadata = NULL; u.lmsg.type = type_lmsg; u.lmsg.flags = 0; u.lmsg.group[0] = '\0'; u.lmsg.routing_id = 0; u.lmsg.content = (content_t *) malloc (sizeof (content_t)); if (!u.lmsg.content) { errno = ENOMEM; return -1; } u.lmsg.content->data = data_; u.lmsg.content->size = size_; u.lmsg.content->ffn = ffn_; u.lmsg.content->hint = hint_; new (&u.lmsg.content->refcnt) zmq::atomic_counter_t (); } return 0; } int zmq::msg_t::init_delimiter () { u.delimiter.metadata = NULL; u.delimiter.type = type_delimiter; u.delimiter.flags = 0; u.delimiter.group[0] = '\0'; u.delimiter.routing_id = 0; return 0; } int zmq::msg_t::init_join () { u.base.metadata = NULL; u.base.type = type_join; u.base.flags = 0; u.base.group[0] = '\0'; u.base.routing_id = 0; return 0; } int zmq::msg_t::init_leave () { u.base.metadata = NULL; u.base.type = type_leave; u.base.flags = 0; u.base.group[0] = '\0'; u.base.routing_id = 0; return 0; } int zmq::msg_t::close () { // Check the validity of the message. if (unlikely (!check ())) { errno = EFAULT; return -1; } if (u.base.type == type_lmsg) { // If the content is not shared, or if it is shared and the reference // count has dropped to zero, deallocate it. if (!(u.lmsg.flags & msg_t::shared) || !u.lmsg.content->refcnt.sub (1)) { // We used "placement new" operator to initialize the reference // counter so we call the destructor explicitly now. u.lmsg.content->refcnt.~atomic_counter_t (); if (u.lmsg.content->ffn) u.lmsg.content->ffn (u.lmsg.content->data, u.lmsg.content->hint); free (u.lmsg.content); } } if (is_zcmsg ()) { zmq_assert (u.zclmsg.content->ffn); // If the content is not shared, or if it is shared and the reference // count has dropped to zero, deallocate it. if (!(u.zclmsg.flags & msg_t::shared) || !u.zclmsg.content->refcnt.sub (1)) { // We used "placement new" operator to initialize the reference // counter so we call the destructor explicitly now. u.zclmsg.content->refcnt.~atomic_counter_t (); u.zclmsg.content->ffn (u.zclmsg.content->data, u.zclmsg.content->hint); } } if (u.base.metadata != NULL) { if (u.base.metadata->drop_ref ()) { LIBZMQ_DELETE (u.base.metadata); } u.base.metadata = NULL; } // Make the message invalid. u.base.type = 0; return 0; } int zmq::msg_t::move (msg_t &src_) { // Check the validity of the source. if (unlikely (!src_.check ())) { errno = EFAULT; return -1; } int rc = close (); if (unlikely (rc < 0)) return rc; *this = src_; rc = src_.init (); if (unlikely (rc < 0)) return rc; return 0; } int zmq::msg_t::copy (msg_t &src_) { // Check the validity of the source. if (unlikely (!src_.check ())) { errno = EFAULT; return -1; } int rc = close (); if (unlikely (rc < 0)) return rc; if (src_.u.base.type == type_lmsg) { // One reference is added to shared messages. Non-shared messages // are turned into shared messages and reference count is set to 2. if (src_.u.lmsg.flags & msg_t::shared) src_.u.lmsg.content->refcnt.add (1); else { src_.u.lmsg.flags |= msg_t::shared; src_.u.lmsg.content->refcnt.set (2); } } if (src_.is_zcmsg ()) { // One reference is added to shared messages. Non-shared messages // are turned into shared messages and reference count is set to 2. if (src_.u.zclmsg.flags & msg_t::shared) src_.refcnt ()->add (1); else { src_.u.zclmsg.flags |= msg_t::shared; src_.refcnt ()->set (2); } } if (src_.u.base.metadata != NULL) src_.u.base.metadata->add_ref (); *this = src_; return 0; } void *zmq::msg_t::data () { // Check the validity of the message. zmq_assert (check ()); switch (u.base.type) { case type_vsm: return u.vsm.data; case type_lmsg: return u.lmsg.content->data; case type_cmsg: return u.cmsg.data; case type_zclmsg: return u.zclmsg.content->data; default: zmq_assert (false); return NULL; } } size_t zmq::msg_t::size () const { // Check the validity of the message. zmq_assert (check ()); switch (u.base.type) { case type_vsm: return u.vsm.size; case type_lmsg: return u.lmsg.content->size; case type_zclmsg: return u.zclmsg.content->size; case type_cmsg: return u.cmsg.size; default: zmq_assert (false); return 0; } } unsigned char zmq::msg_t::flags () const { return u.base.flags; } void zmq::msg_t::set_flags (unsigned char flags_) { u.base.flags |= flags_; } void zmq::msg_t::reset_flags (unsigned char flags_) { u.base.flags &= ~flags_; } zmq::metadata_t *zmq::msg_t::metadata () const { return u.base.metadata; } void zmq::msg_t::set_metadata (zmq::metadata_t *metadata_) { assert (metadata_ != NULL); assert (u.base.metadata == NULL); metadata_->add_ref (); u.base.metadata = metadata_; } void zmq::msg_t::reset_metadata () { if (u.base.metadata) { if (u.base.metadata->drop_ref ()) { LIBZMQ_DELETE (u.base.metadata); } u.base.metadata = NULL; } } bool zmq::msg_t::is_routing_id () const { return (u.base.flags & routing_id) == routing_id; } bool zmq::msg_t::is_credential () const { return (u.base.flags & credential) == credential; } bool zmq::msg_t::is_delimiter () const { return u.base.type == type_delimiter; } bool zmq::msg_t::is_vsm () const { return u.base.type == type_vsm; } bool zmq::msg_t::is_cmsg () const { return u.base.type == type_cmsg; } bool zmq::msg_t::is_zcmsg () const { return u.base.type == type_zclmsg; } bool zmq::msg_t::is_join () const { return u.base.type == type_join; } bool zmq::msg_t::is_leave () const { return u.base.type == type_leave; } void zmq::msg_t::add_refs (int refs_) { zmq_assert (refs_ >= 0); // Operation not supported for messages with metadata. zmq_assert (u.base.metadata == NULL); // No copies required. if (!refs_) return; // VSMs, CMSGS and delimiters can be copied straight away. The only // message type that needs special care are long messages. if (u.base.type == type_lmsg || is_zcmsg ()) { if (u.base.flags & msg_t::shared) refcnt ()->add (refs_); else { refcnt ()->set (refs_ + 1); u.base.flags |= msg_t::shared; } } } bool zmq::msg_t::rm_refs (int refs_) { zmq_assert (refs_ >= 0); // Operation not supported for messages with metadata. zmq_assert (u.base.metadata == NULL); // No copies required. if (!refs_) return true; // If there's only one reference close the message. if ((u.base.type != type_zclmsg && u.base.type != type_lmsg) || !(u.base.flags & msg_t::shared)) { close (); return false; } // The only message type that needs special care are long and zcopy messages. if (u.base.type == type_lmsg && !u.lmsg.content->refcnt.sub (refs_)) { // We used "placement new" operator to initialize the reference // counter so we call the destructor explicitly now. u.lmsg.content->refcnt.~atomic_counter_t (); if (u.lmsg.content->ffn) u.lmsg.content->ffn (u.lmsg.content->data, u.lmsg.content->hint); free (u.lmsg.content); return false; } if (is_zcmsg () && !u.zclmsg.content->refcnt.sub (refs_)) { // storage for rfcnt is provided externally if (u.zclmsg.content->ffn) { u.zclmsg.content->ffn (u.zclmsg.content->data, u.zclmsg.content->hint); } return false; } return true; } uint32_t zmq::msg_t::get_routing_id () { return u.base.routing_id; } int zmq::msg_t::set_routing_id (uint32_t routing_id_) { if (routing_id_) { u.base.routing_id = routing_id_; return 0; } errno = EINVAL; return -1; } int zmq::msg_t::reset_routing_id () { u.base.routing_id = 0; return 0; } const char *zmq::msg_t::group () { return u.base.group; } int zmq::msg_t::set_group (const char *group_) { return set_group (group_, ZMQ_GROUP_MAX_LENGTH); } int zmq::msg_t::set_group (const char *group_, size_t length_) { if (length_ > ZMQ_GROUP_MAX_LENGTH) { errno = EINVAL; return -1; } strncpy (u.base.group, group_, length_); u.base.group[length_] = '\0'; return 0; } zmq::atomic_counter_t *zmq::msg_t::refcnt () { switch (u.base.type) { case type_lmsg: return &u.lmsg.content->refcnt; case type_zclmsg: return &u.zclmsg.content->refcnt; default: zmq_assert (false); return NULL; } } zeromq-4.2.5/src/curve_mechanism_base.hpp0000664000372000037200000000535213255253220021407 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CURVE_MECHANISM_BASE_HPP_INCLUDED__ #define __ZMQ_CURVE_MECHANISM_BASE_HPP_INCLUDED__ #ifdef ZMQ_HAVE_CURVE #if defined(ZMQ_USE_TWEETNACL) #include "tweetnacl.h" #elif defined(ZMQ_USE_LIBSODIUM) #include "sodium.h" #endif #if crypto_box_NONCEBYTES != 24 || crypto_box_PUBLICKEYBYTES != 32 \ || crypto_box_SECRETKEYBYTES != 32 || crypto_box_ZEROBYTES != 32 \ || crypto_box_BOXZEROBYTES != 16 || crypto_secretbox_NONCEBYTES != 24 \ || crypto_secretbox_ZEROBYTES != 32 || crypto_secretbox_BOXZEROBYTES != 16 #error "CURVE library not built properly" #endif #include "mechanism_base.hpp" #include "options.hpp" namespace zmq { class curve_mechanism_base_t : public virtual mechanism_base_t { public: curve_mechanism_base_t (session_base_t *session_, const options_t &options_, const char *encode_nonce_prefix_, const char *decode_nonce_prefix_); // mechanism implementation virtual int encode (msg_t *msg_); virtual int decode (msg_t *msg_); protected: const char *encode_nonce_prefix; const char *decode_nonce_prefix; uint64_t cn_nonce; uint64_t cn_peer_nonce; // Intermediary buffer used to speed up boxing and unboxing. uint8_t cn_precom[crypto_box_BEFORENMBYTES]; }; } #endif #endif zeromq-4.2.5/src/epoll.cpp0000664000372000037200000001360213255253220016350 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "epoll.hpp" #if defined ZMQ_USE_EPOLL #include #include #include #include #include #include #include #include "macros.hpp" #include "epoll.hpp" #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" zmq::epoll_t::epoll_t (const zmq::thread_ctx_t &ctx_) : worker_poller_base_t (ctx_) { #ifdef ZMQ_USE_EPOLL_CLOEXEC // Setting this option result in sane behaviour when exec() functions // are used. Old sockets are closed and don't block TCP ports, avoid // leaks, etc. epoll_fd = epoll_create1 (EPOLL_CLOEXEC); #else epoll_fd = epoll_create (1); #endif errno_assert (epoll_fd != -1); } zmq::epoll_t::~epoll_t () { // Wait till the worker thread exits. stop_worker (); close (epoll_fd); for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it) { LIBZMQ_DELETE (*it); } } zmq::epoll_t::handle_t zmq::epoll_t::add_fd (fd_t fd_, i_poll_events *events_) { check_thread (); poll_entry_t *pe = new (std::nothrow) poll_entry_t; alloc_assert (pe); // The memset is not actually needed. It's here to prevent debugging // tools to complain about using uninitialised memory. memset (pe, 0, sizeof (poll_entry_t)); pe->fd = fd_; pe->ev.events = 0; pe->ev.data.ptr = pe; pe->events = events_; int rc = epoll_ctl (epoll_fd, EPOLL_CTL_ADD, fd_, &pe->ev); errno_assert (rc != -1); // Increase the load metric of the thread. adjust_load (1); return pe; } void zmq::epoll_t::rm_fd (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; int rc = epoll_ctl (epoll_fd, EPOLL_CTL_DEL, pe->fd, &pe->ev); errno_assert (rc != -1); pe->fd = retired_fd; retired_sync.lock (); retired.push_back (pe); retired_sync.unlock (); // Decrease the load metric of the thread. adjust_load (-1); } void zmq::epoll_t::set_pollin (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; pe->ev.events |= EPOLLIN; int rc = epoll_ctl (epoll_fd, EPOLL_CTL_MOD, pe->fd, &pe->ev); errno_assert (rc != -1); } void zmq::epoll_t::reset_pollin (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; pe->ev.events &= ~((short) EPOLLIN); int rc = epoll_ctl (epoll_fd, EPOLL_CTL_MOD, pe->fd, &pe->ev); errno_assert (rc != -1); } void zmq::epoll_t::set_pollout (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; pe->ev.events |= EPOLLOUT; int rc = epoll_ctl (epoll_fd, EPOLL_CTL_MOD, pe->fd, &pe->ev); errno_assert (rc != -1); } void zmq::epoll_t::reset_pollout (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; pe->ev.events &= ~((short) EPOLLOUT); int rc = epoll_ctl (epoll_fd, EPOLL_CTL_MOD, pe->fd, &pe->ev); errno_assert (rc != -1); } void zmq::epoll_t::stop () { check_thread (); } int zmq::epoll_t::max_fds () { return -1; } void zmq::epoll_t::loop () { epoll_event ev_buf[max_io_events]; while (true) { // Execute any due timers. int timeout = (int) execute_timers (); if (get_load () == 0) { if (timeout == 0) break; // TODO sleep for timeout continue; } // Wait for events. int n = epoll_wait (epoll_fd, &ev_buf[0], max_io_events, timeout ? timeout : -1); if (n == -1) { errno_assert (errno == EINTR); continue; } for (int i = 0; i < n; i++) { poll_entry_t *pe = ((poll_entry_t *) ev_buf[i].data.ptr); if (pe->fd == retired_fd) continue; if (ev_buf[i].events & (EPOLLERR | EPOLLHUP)) pe->events->in_event (); if (pe->fd == retired_fd) continue; if (ev_buf[i].events & EPOLLOUT) pe->events->out_event (); if (pe->fd == retired_fd) continue; if (ev_buf[i].events & EPOLLIN) pe->events->in_event (); } // Destroy retired event sources. retired_sync.lock (); for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it) { LIBZMQ_DELETE (*it); } retired.clear (); retired_sync.unlock (); } } #endif zeromq-4.2.5/src/mailbox_safe.cpp0000664000372000037200000000674613255253220017701 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "mailbox_safe.hpp" #include "clock.hpp" #include "err.hpp" zmq::mailbox_safe_t::mailbox_safe_t (mutex_t *sync_) : sync (sync_) { // Get the pipe into passive state. That way, if the users starts by // polling on the associated file descriptor it will get woken up when // new command is posted. const bool ok = cpipe.read (NULL); zmq_assert (!ok); } zmq::mailbox_safe_t::~mailbox_safe_t () { // TODO: Retrieve and deallocate commands inside the cpipe. // Work around problem that other threads might still be in our // send() method, by waiting on the mutex before disappearing. sync->lock (); sync->unlock (); } void zmq::mailbox_safe_t::add_signaler (signaler_t *signaler) { signalers.push_back (signaler); } void zmq::mailbox_safe_t::remove_signaler (signaler_t *signaler) { std::vector::iterator it = signalers.begin (); // TODO: make a copy of array and signal outside the lock for (; it != signalers.end (); ++it) { if (*it == signaler) break; } if (it != signalers.end ()) signalers.erase (it); } void zmq::mailbox_safe_t::clear_signalers () { signalers.clear (); } void zmq::mailbox_safe_t::send (const command_t &cmd_) { sync->lock (); cpipe.write (cmd_, false); const bool ok = cpipe.flush (); if (!ok) { cond_var.broadcast (); for (std::vector::iterator it = signalers.begin (); it != signalers.end (); ++it) { (*it)->send (); } } sync->unlock (); } int zmq::mailbox_safe_t::recv (command_t *cmd_, int timeout_) { // Try to get the command straight away. if (cpipe.read (cmd_)) return 0; // Wait for signal from the command sender. int rc = cond_var.wait (sync, timeout_); if (rc == -1) { errno_assert (errno == EAGAIN || errno == EINTR); return -1; } // Another thread may already fetch the command const bool ok = cpipe.read (cmd_); if (!ok) { errno = EAGAIN; return -1; } return 0; } zeromq-4.2.5/src/tcp_connecter.cpp0000664000372000037200000003170313255253220020065 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "macros.hpp" #include "tcp_connecter.hpp" #include "stream_engine.hpp" #include "io_thread.hpp" #include "random.hpp" #include "err.hpp" #include "ip.hpp" #include "tcp.hpp" #include "address.hpp" #include "tcp_address.hpp" #include "session_base.hpp" #if !defined ZMQ_HAVE_WINDOWS #include #include #include #include #include #include #include #include #ifdef ZMQ_HAVE_VXWORKS #include #endif #ifdef ZMQ_HAVE_OPENVMS #include #endif #endif zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_, class session_base_t *session_, const options_t &options_, address_t *addr_, bool delayed_start_) : own_t (io_thread_, options_), io_object_t (io_thread_), addr (addr_), s (retired_fd), handle ((handle_t) NULL), delayed_start (delayed_start_), connect_timer_started (false), reconnect_timer_started (false), session (session_), current_reconnect_ivl (options.reconnect_ivl), socket (session->get_socket ()) { zmq_assert (addr); zmq_assert (addr->protocol == "tcp"); addr->to_string (endpoint); // TODO the return value is unused! what if it fails? if this is impossible // or does not matter, change such that endpoint in initialized using an // initializer, and make endpoint const } zmq::tcp_connecter_t::~tcp_connecter_t () { zmq_assert (!connect_timer_started); zmq_assert (!reconnect_timer_started); zmq_assert (!handle); zmq_assert (s == retired_fd); } void zmq::tcp_connecter_t::process_plug () { if (delayed_start) add_reconnect_timer (); else start_connecting (); } void zmq::tcp_connecter_t::process_term (int linger_) { if (connect_timer_started) { cancel_timer (connect_timer_id); connect_timer_started = false; } if (reconnect_timer_started) { cancel_timer (reconnect_timer_id); reconnect_timer_started = false; } if (handle) { rm_handle (); } if (s != retired_fd) close (); own_t::process_term (linger_); } void zmq::tcp_connecter_t::in_event () { // We are not polling for incoming data, so we are actually called // because of error here. However, we can get error on out event as well // on some platforms, so we'll simply handle both events in the same way. out_event (); } void zmq::tcp_connecter_t::out_event () { if (connect_timer_started) { cancel_timer (connect_timer_id); connect_timer_started = false; } rm_handle (); const fd_t fd = connect (); // Handle the error condition by attempt to reconnect. if (fd == retired_fd || !tune_socket (fd)) { close (); add_reconnect_timer (); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Attach the engine to the corresponding session object. send_attach (session, engine); // Shut the connecter down. terminate (); socket->event_connected (endpoint, fd); } void zmq::tcp_connecter_t::rm_handle () { rm_fd (handle); handle = (handle_t) NULL; } void zmq::tcp_connecter_t::timer_event (int id_) { zmq_assert (id_ == reconnect_timer_id || id_ == connect_timer_id); if (id_ == connect_timer_id) { connect_timer_started = false; rm_handle (); close (); add_reconnect_timer (); } else if (id_ == reconnect_timer_id) { reconnect_timer_started = false; start_connecting (); } } void zmq::tcp_connecter_t::start_connecting () { // Open the connecting socket. const int rc = open (); // Connect may succeed in synchronous manner. if (rc == 0) { handle = add_fd (s); out_event (); } // Connection establishment may be delayed. Poll for its completion. else if (rc == -1 && errno == EINPROGRESS) { handle = add_fd (s); set_pollout (handle); socket->event_connect_delayed (endpoint, zmq_errno ()); // add userspace connect timeout add_connect_timer (); } // Handle any other error condition by eventual reconnect. else { if (s != retired_fd) close (); add_reconnect_timer (); } } void zmq::tcp_connecter_t::add_connect_timer () { if (options.connect_timeout > 0) { add_timer (options.connect_timeout, connect_timer_id); connect_timer_started = true; } } void zmq::tcp_connecter_t::add_reconnect_timer () { const int interval = get_new_reconnect_ivl (); add_timer (interval, reconnect_timer_id); socket->event_connect_retried (endpoint, interval); reconnect_timer_started = true; } int zmq::tcp_connecter_t::get_new_reconnect_ivl () { // The new interval is the current interval + random value. const int interval = current_reconnect_ivl + generate_random () % options.reconnect_ivl; // Only change the current reconnect interval if the maximum reconnect // interval was set and if it's larger than the reconnect interval. if (options.reconnect_ivl_max > 0 && options.reconnect_ivl_max > options.reconnect_ivl) // Calculate the next interval current_reconnect_ivl = std::min (current_reconnect_ivl * 2, options.reconnect_ivl_max); return interval; } int zmq::tcp_connecter_t::open () { zmq_assert (s == retired_fd); // Resolve the address if (addr->resolved.tcp_addr != NULL) { LIBZMQ_DELETE (addr->resolved.tcp_addr); } addr->resolved.tcp_addr = new (std::nothrow) tcp_address_t (); alloc_assert (addr->resolved.tcp_addr); int rc = addr->resolved.tcp_addr->resolve (addr->address.c_str (), false, options.ipv6); if (rc != 0) { LIBZMQ_DELETE (addr->resolved.tcp_addr); return -1; } zmq_assert (addr->resolved.tcp_addr != NULL); tcp_address_t *const tcp_addr = addr->resolved.tcp_addr; // Create the socket. s = open_socket (tcp_addr->family (), SOCK_STREAM, IPPROTO_TCP); // IPv6 address family not supported, try automatic downgrade to IPv4. if (s == zmq::retired_fd && tcp_addr->family () == AF_INET6 && errno == EAFNOSUPPORT && options.ipv6) { rc = addr->resolved.tcp_addr->resolve (addr->address.c_str (), false, false); if (rc != 0) { LIBZMQ_DELETE (addr->resolved.tcp_addr); return -1; } s = open_socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); } #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) { errno = wsa_error_to_errno (WSAGetLastError ()); return -1; } #else if (s == -1) return -1; #endif // On some systems, IPv4 mapping in IPv6 sockets is disabled by default. // Switch it on in such cases. if (tcp_addr->family () == AF_INET6) enable_ipv4_mapping (s); // Set the IP Type-Of-Service priority for this socket if (options.tos != 0) set_ip_type_of_service (s, options.tos); // Bind the socket to a device if applicable if (!options.bound_device.empty ()) bind_to_device (s, options.bound_device); // Set the socket to non-blocking mode so that we get async connect(). unblock_socket (s); // Set the socket to loopback fastpath if configured. if (options.loopback_fastpath) tcp_tune_loopback_fast_path (s); // Set the socket buffer limits for the underlying socket. if (options.sndbuf >= 0) set_tcp_send_buffer (s, options.sndbuf); if (options.rcvbuf >= 0) set_tcp_receive_buffer (s, options.rcvbuf); // Set the IP Type-Of-Service for the underlying socket if (options.tos != 0) set_ip_type_of_service (s, options.tos); // Set a source address for conversations if (tcp_addr->has_src_addr ()) { // Allow reusing of the address, to connect to different servers // using the same source port on the client. int flag = 1; #ifdef ZMQ_HAVE_WINDOWS rc = setsockopt (s, SOL_SOCKET, SO_REUSEADDR, (const char *) &flag, sizeof (int)); wsa_assert (rc != SOCKET_ERROR); #elif defined ZMQ_HAVE_VXWORKS rc = setsockopt (s, SOL_SOCKET, SO_REUSEADDR, (char *) &flag, sizeof (int)); errno_assert (rc == 0); #else rc = setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &flag, sizeof (int)); errno_assert (rc == 0); #endif #if defined ZMQ_HAVE_VXWORKS rc = ::bind (s, (sockaddr *) tcp_addr->src_addr (), tcp_addr->src_addrlen ()); #else rc = ::bind (s, tcp_addr->src_addr (), tcp_addr->src_addrlen ()); #endif if (rc == -1) return -1; } // Connect to the remote peer. #if defined ZMQ_HAVE_VXWORKS rc = ::connect (s, (sockaddr *) tcp_addr->addr (), tcp_addr->addrlen ()); #else rc = ::connect (s, tcp_addr->addr (), tcp_addr->addrlen ()); #endif // Connect was successful immediately. if (rc == 0) { return 0; } // Translate error codes indicating asynchronous connect has been // launched to a uniform EINPROGRESS. #ifdef ZMQ_HAVE_WINDOWS const int last_error = WSAGetLastError (); if (last_error == WSAEINPROGRESS || last_error == WSAEWOULDBLOCK) errno = EINPROGRESS; else errno = wsa_error_to_errno (last_error); #else if (errno == EINTR) errno = EINPROGRESS; #endif return -1; } zmq::fd_t zmq::tcp_connecter_t::connect () { // Async connect has finished. Check whether an error occurred int err = 0; #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_VXWORKS int len = sizeof err; #else socklen_t len = sizeof err; #endif const int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &err, &len); // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. #ifdef ZMQ_HAVE_WINDOWS zmq_assert (rc == 0); if (err != 0) { if (err == WSAEBADF || err == WSAENOPROTOOPT || err == WSAENOTSOCK || err == WSAENOBUFS) { wsa_assert_no (err); } return retired_fd; } #else // Following code should handle both Berkeley-derived socket // implementations and Solaris. if (rc == -1) err = errno; if (err != 0) { errno = err; errno_assert (errno != EBADF && errno != ENOPROTOOPT && errno != ENOTSOCK && errno != ENOBUFS); return retired_fd; } #endif // Return the newly connected socket. const fd_t result = s; s = retired_fd; return result; } bool zmq::tcp_connecter_t::tune_socket (const fd_t fd) { const int rc = tune_tcp_socket (fd) | tune_tcp_keepalives ( fd, options.tcp_keepalive, options.tcp_keepalive_cnt, options.tcp_keepalive_idle, options.tcp_keepalive_intvl) | tune_tcp_maxrt (fd, options.tcp_maxrt); return rc == 0; } void zmq::tcp_connecter_t::close () { zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_WINDOWS const int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else const int rc = ::close (s); errno_assert (rc == 0); #endif socket->event_closed (endpoint, s); s = retired_fd; } zeromq-4.2.5/src/timers.cpp0000664000372000037200000001247413255253220016546 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "timers.hpp" #include "err.hpp" #include zmq::timers_t::timers_t () : tag (0xCAFEDADA), next_timer_id (0) { } zmq::timers_t::~timers_t () { // Mark the timers as dead tag = 0xdeadbeef; } bool zmq::timers_t::check_tag () { return tag == 0xCAFEDADA; } int zmq::timers_t::add (size_t interval_, timers_timer_fn handler_, void *arg_) { if (handler_ == NULL) { errno = EFAULT; return -1; } uint64_t when = clock.now_ms () + interval_; timer_t timer = {++next_timer_id, interval_, handler_, arg_}; timers.insert (timersmap_t::value_type (when, timer)); return timer.timer_id; } struct zmq::timers_t::match_by_id { match_by_id (int timer_id_) : timer_id (timer_id_) {} bool operator() (timersmap_t::value_type const &entry) const { return entry.second.timer_id == timer_id; } private: int timer_id; }; int zmq::timers_t::cancel (int timer_id_) { // check first if timer exists at all if (timers.end () == std::find_if (timers.begin (), timers.end (), match_by_id (timer_id_))) { errno = EINVAL; return -1; } // check if timer was already canceled if (cancelled_timers.count (timer_id_)) { errno = EINVAL; return -1; } cancelled_timers.insert (timer_id_); return 0; } int zmq::timers_t::set_interval (int timer_id_, size_t interval_) { const timersmap_t::iterator end = timers.end (); const timersmap_t::iterator it = std::find_if (timers.begin (), end, match_by_id (timer_id_)); if (it != end) { timer_t timer = it->second; timer.interval = interval_; uint64_t when = clock.now_ms () + interval_; timers.erase (it); timers.insert (timersmap_t::value_type (when, timer)); return 0; } errno = EINVAL; return -1; } int zmq::timers_t::reset (int timer_id_) { const timersmap_t::iterator end = timers.end (); const timersmap_t::iterator it = std::find_if (timers.begin (), end, match_by_id (timer_id_)); if (it != end) { timer_t timer = it->second; uint64_t when = clock.now_ms () + timer.interval; timers.erase (it); timers.insert (timersmap_t::value_type (when, timer)); return 0; } errno = EINVAL; return -1; } long zmq::timers_t::timeout () { timersmap_t::iterator it = timers.begin (); uint64_t now = clock.now_ms (); while (it != timers.end ()) { cancelled_timers_t::iterator cancelled_it = cancelled_timers.find (it->second.timer_id); // Live timer, lets return the timeout if (cancelled_it == cancelled_timers.end ()) { if (it->first > now) return (long) (it->first - now); else return 0; } // Let's remove it from the beginning of the list timersmap_t::iterator old = it; ++it; timers.erase (old); cancelled_timers.erase (cancelled_it); } // Wait forever as no timers are alive return -1; } int zmq::timers_t::execute () { timersmap_t::iterator it = timers.begin (); uint64_t now = clock.now_ms (); while (it != timers.end ()) { cancelled_timers_t::iterator cancelled_it = cancelled_timers.find (it->second.timer_id); // Dead timer, lets remove it and continue if (cancelled_it != cancelled_timers.end ()) { timersmap_t::iterator old = it; ++it; timers.erase (old); cancelled_timers.erase (cancelled_it); continue; } // Map is ordered, if we have to wait for current timer we can stop. if (it->first > now) break; timer_t timer = it->second; timer.handler (timer.timer_id, timer.arg); timersmap_t::iterator old = it; ++it; timers.erase (old); timers.insert (timersmap_t::value_type (now + timer.interval, timer)); } return 0; } zeromq-4.2.5/src/poller_base.hpp0000664000372000037200000001572513255253220017541 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_POLLER_BASE_HPP_INCLUDED__ #define __ZMQ_POLLER_BASE_HPP_INCLUDED__ #include #include "clock.hpp" #include "atomic_counter.hpp" #include "ctx.hpp" namespace zmq { struct i_poll_events; // A build of libzmq must provide an implementation of the poller_t concept. By // convention, this is done via a typedef. // // At the time of writing, the following implementations of the poller_t // concept exist: zmq::devpoll_t, zmq::epoll_t, zmq::kqueue_t, zmq::poll_t, // zmq::pollset_t, zmq::select_t // // An implementation of the poller_t concept must provide the following public // methods: // Returns load of the poller. // int get_load() const; // // Add a timeout to expire in timeout_ milliseconds. After the // expiration, timer_event on sink_ object will be called with // argument set to id_. // void add_timer(int timeout_, zmq::i_poll_events *sink_, int id_); // // Cancel the timer created by sink_ object with ID equal to id_. // void cancel_timer(zmq::i_poll_events *sink_, int id_); // // Adds a fd to the poller. Initially, no events are activated. These must // be activated by the set_* methods using the returned handle_. // handle_t add_fd(fd_t fd_, zmq::i_poll_events *events_); // // Deactivates any events that may be active for the given handle_, and // removes the fd associated with the given handle_. // void rm_fd(handle_t handle_); // // The set_* and reset_* methods activate resp. deactivate polling for // input/output readiness on the respective handle_, such that the // in_event/out_event methods on the associated zmq::i_poll_events object // will be called. // Note: while handle_t and fd_t may be the same type, and may even have the // same values for some implementation, this may not be assumed in general. // The methods may only be called with the handle returned by add_fd. // void set_pollin(handle_t handle_); // void reset_pollin(handle_t handle_); // void set_pollout(handle_t handle_);// // void reset_pollout(handle_t handle_); // // Starts operation of the poller. See below for details. // void start(); // // Request termination of the poller. // TODO: might be removed in the future, as it has no effect. // void stop(); // // Returns the maximum number of fds that can be added to an instance of the // poller at the same time, or -1 if there is no such fixed limit. // static int max_fds(); // // Most of the methods may only be called from a zmq::i_poll_events callback // function when invoked by the poller (and, therefore, typically from the // poller's worker thread), with the following exceptions: // - get_load may be called from outside // - add_fd and add_timer may be called from outside before start // - start may be called from outside once // // After a poller is started, it waits for the registered events (input/output // readiness, timeout) to happen, and calls the respective functions on the // zmq::i_poll_events object. It terminates when no further registrations (fds // or timers) exist. // // Before start, add_fd must have been called at least once. Behavior may be // undefined otherwise. // // If the poller is implemented by a single worker thread (the // worker_poller_base_t base class may be used to implement such a poller), // no synchronization is required for the data structures modified by // add_fd, rm_fd, add_timer, cancel_timer, (re)set_poll(in|out). However, // reentrancy must be considered, e.g. when one of the functions modifies // a container that is being iterated by the poller. // A class that can be used as a base class for implementations of the poller // concept. // // For documentation of the public methods, see the description of the poller_t // concept. class poller_base_t { public: poller_base_t (); virtual ~poller_base_t (); // Methods from the poller concept. int get_load () const; void add_timer (int timeout_, zmq::i_poll_events *sink_, int id_); void cancel_timer (zmq::i_poll_events *sink_, int id_); protected: // Called by individual poller implementations to manage the load. void adjust_load (int amount_); // Executes any timers that are due. Returns number of milliseconds // to wait to match the next timer or 0 meaning "no timers". uint64_t execute_timers (); private: // Clock instance private to this I/O thread. clock_t clock; // List of active timers. struct timer_info_t { zmq::i_poll_events *sink; int id; }; typedef std::multimap timers_t; timers_t timers; // Load of the poller. Currently the number of file descriptors // registered. atomic_counter_t load; poller_base_t (const poller_base_t &); const poller_base_t &operator= (const poller_base_t &); }; // Base class for a poller with a single worker thread. class worker_poller_base_t : public poller_base_t { public: worker_poller_base_t (const thread_ctx_t &ctx_); // Methods from the poller concept. void start (); protected: // Checks whether the currently executing thread is the worker thread // via an assertion. // Should be called by the add_fd, removed_fd, set_*, reset_* functions // to ensure correct usage. void check_thread (); // Stops the worker thread. Should be called from the destructor of the // leaf class. void stop_worker (); private: // Main worker thread routine. static void worker_routine (void *arg_); virtual void loop () = 0; // Reference to ZMQ context. const thread_ctx_t &ctx; // Handle of the physical thread doing the I/O work. thread_t worker; }; } #endif zeromq-4.2.5/src/zmq_draft.h0000664000372000037200000002051113255253220016666 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DRAFT_H_INCLUDED__ #define __ZMQ_DRAFT_H_INCLUDED__ /******************************************************************************/ /* These functions are DRAFT and disabled in stable releases, and subject to */ /* change at ANY time until declared stable. */ /******************************************************************************/ #ifndef ZMQ_BUILD_DRAFT_API /* Returns the number of microseconds elapsed since the stopwatch was */ /* started, but does not stop or deallocate the stopwatch. */ unsigned long zmq_stopwatch_intermediate (void *watch_); /* DRAFT Socket types. */ #define ZMQ_SERVER 12 #define ZMQ_CLIENT 13 #define ZMQ_RADIO 14 #define ZMQ_DISH 15 #define ZMQ_GATHER 16 #define ZMQ_SCATTER 17 #define ZMQ_DGRAM 18 /* DRAFT Socket options. */ #define ZMQ_GSSAPI_PRINCIPAL_NAMETYPE 90 #define ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE 91 #define ZMQ_BINDTODEVICE 92 #define ZMQ_ZAP_ENFORCE_DOMAIN 93 #define ZMQ_LOOPBACK_FASTPATH 94 #define ZMQ_METADATA 95 /* DRAFT 0MQ socket events and monitoring */ /* Unspecified system errors during handshake. Event value is an errno. */ #define ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL 0x0800 /* Handshake complete successfully with successful authentication (if * * enabled). Event value is unused. */ #define ZMQ_EVENT_HANDSHAKE_SUCCEEDED 0x1000 /* Protocol errors between ZMTP peers or between server and ZAP handler. * * Event value is one of ZMQ_PROTOCOL_ERROR_* */ #define ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL 0x2000 /* Failed authentication requests. Event value is the numeric ZAP status * * code, i.e. 300, 400 or 500. */ #define ZMQ_EVENT_HANDSHAKE_FAILED_AUTH 0x4000 #define ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED 0x10000000 #define ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND 0x10000001 #define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE 0x10000002 #define ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE 0x10000003 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED 0x10000011 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE 0x10000012 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO 0x10000013 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE 0x10000014 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR 0x10000015 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY 0x10000016 #define ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME 0x10000017 #define ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA 0x10000018 // the following two may be due to erroneous configuration of a peer #define ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC 0x11000001 #define ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH 0x11000002 #define ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED 0x20000000 #define ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY 0x20000001 #define ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID 0x20000002 #define ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION 0x20000003 #define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE 0x20000004 #define ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA 0x20000005 /* DRAFT Context options */ #define ZMQ_MSG_T_SIZE 6 #define ZMQ_THREAD_AFFINITY_CPU_ADD 7 #define ZMQ_THREAD_AFFINITY_CPU_REMOVE 8 #define ZMQ_THREAD_NAME_PREFIX 9 #define ZMQ_ZERO_COPY_RECV 10 /* DRAFT Socket methods. */ int zmq_join (void *s, const char *group); int zmq_leave (void *s, const char *group); /* DRAFT Msg methods. */ int zmq_msg_set_routing_id (zmq_msg_t *msg, uint32_t routing_id); uint32_t zmq_msg_routing_id (zmq_msg_t *msg); int zmq_msg_set_group (zmq_msg_t *msg, const char *group); const char *zmq_msg_group (zmq_msg_t *msg); /* DRAFT Msg property names. */ #define ZMQ_MSG_PROPERTY_ROUTING_ID "Routing-Id" #define ZMQ_MSG_PROPERTY_SOCKET_TYPE "Socket-Type" #define ZMQ_MSG_PROPERTY_USER_ID "User-Id" #define ZMQ_MSG_PROPERTY_PEER_ADDRESS "Peer-Address" /******************************************************************************/ /* Poller polling on sockets,fd and thread-safe sockets */ /******************************************************************************/ typedef struct zmq_poller_event_t { void *socket; #if defined _WIN32 SOCKET fd; #else int fd; #endif void *user_data; short events; } zmq_poller_event_t; void *zmq_poller_new (void); int zmq_poller_destroy (void **poller_p); int zmq_poller_add (void *poller, void *socket, void *user_data, short events); int zmq_poller_modify (void *poller, void *socket, short events); int zmq_poller_remove (void *poller, void *socket); int zmq_poller_wait (void *poller, zmq_poller_event_t *event, long timeout); int zmq_poller_wait_all (void *poller, zmq_poller_event_t *events, int n_events, long timeout); #if defined _WIN32 int zmq_poller_add_fd (void *poller, SOCKET fd, void *user_data, short events); int zmq_poller_modify_fd (void *poller, SOCKET fd, short events); int zmq_poller_remove_fd (void *poller, SOCKET fd); #else int zmq_poller_add_fd (void *poller, int fd, void *user_data, short events); int zmq_poller_modify_fd (void *poller, int fd, short events); int zmq_poller_remove_fd (void *poller, int fd); #endif int zmq_socket_get_peer_state (void *socket, const void *routing_id, size_t routing_id_size); /******************************************************************************/ /* Scheduling timers */ /******************************************************************************/ typedef void(zmq_timer_fn) (int timer_id, void *arg); void *zmq_timers_new (void); int zmq_timers_destroy (void **timers_p); int zmq_timers_add (void *timers, size_t interval, zmq_timer_fn handler, void *arg); int zmq_timers_cancel (void *timers, int timer_id); int zmq_timers_set_interval (void *timers, int timer_id, size_t interval); int zmq_timers_reset (void *timers, int timer_id); long zmq_timers_timeout (void *timers); int zmq_timers_execute (void *timers); /******************************************************************************/ /* GSSAPI definitions */ /******************************************************************************/ /* GSSAPI principal name types */ #define ZMQ_GSSAPI_NT_HOSTBASED 0 #define ZMQ_GSSAPI_NT_USER_NAME 1 #define ZMQ_GSSAPI_NT_KRB5_PRINCIPAL 2 #endif // ZMQ_BUILD_DRAFT_API #endif //ifndef __ZMQ_DRAFT_H_INCLUDED__ zeromq-4.2.5/src/fd.hpp0000664000372000037200000000344713255253220015641 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_FD_HPP_INCLUDED__ #define __ZMQ_FD_HPP_INCLUDED__ #if defined _WIN32 #include "windows.hpp" #endif namespace zmq { #ifdef ZMQ_HAVE_WINDOWS #if defined _MSC_VER && _MSC_VER <= 1400 typedef UINT_PTR fd_t; enum { retired_fd = (fd_t) (~0) }; #else typedef SOCKET fd_t; enum { retired_fd = (fd_t) INVALID_SOCKET }; #endif #else typedef int fd_t; enum { retired_fd = -1 }; #endif } #endif zeromq-4.2.5/src/curve_server.cpp0000664000372000037200000004224513255253220017754 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #ifdef ZMQ_HAVE_CURVE #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "curve_server.hpp" #include "wire.hpp" zmq::curve_server_t::curve_server_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_) : mechanism_base_t (session_, options_), zap_client_common_handshake_t ( session_, peer_address_, options_, sending_ready), curve_mechanism_base_t ( session_, options_, "CurveZMQMESSAGES", "CurveZMQMESSAGEC") { int rc; // Fetch our secret key from socket options memcpy (secret_key, options_.curve_secret_key, crypto_box_SECRETKEYBYTES); // Generate short-term key pair rc = crypto_box_keypair (cn_public, cn_secret); zmq_assert (rc == 0); } zmq::curve_server_t::~curve_server_t () { } int zmq::curve_server_t::next_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case sending_welcome: rc = produce_welcome (msg_); if (rc == 0) state = waiting_for_initiate; break; case sending_ready: rc = produce_ready (msg_); if (rc == 0) state = ready; break; case sending_error: rc = produce_error (msg_); if (rc == 0) state = error_sent; break; default: errno = EAGAIN; rc = -1; break; } return rc; } int zmq::curve_server_t::process_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case waiting_for_hello: rc = process_hello (msg_); break; case waiting_for_initiate: rc = process_initiate (msg_); break; default: // TODO I think this is not a case reachable with a misbehaving // client. It is not an "invalid handshake command", but would be // trying to process a handshake command in an invalid state, // which is purely under control of this peer. // Therefore, it should be changed to zmq_assert (false); // CURVE I: invalid handshake command session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED); errno = EPROTO; rc = -1; break; } if (rc == 0) { rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } return rc; } int zmq::curve_server_t::encode (msg_t *msg_) { zmq_assert (state == ready); return curve_mechanism_base_t::encode (msg_); } int zmq::curve_server_t::decode (msg_t *msg_) { zmq_assert (state == ready); return curve_mechanism_base_t::decode (msg_); } int zmq::curve_server_t::process_hello (msg_t *msg_) { int rc = check_basic_command_structure (msg_); if (rc == -1) return -1; const size_t size = msg_->size (); const uint8_t *const hello = static_cast (msg_->data ()); if (size < 6 || memcmp (hello, "\x05HELLO", 6)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (size != 200) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } const uint8_t major = hello[6]; const uint8_t minor = hello[7]; if (major != 1 || minor != 0) { // CURVE I: client HELLO has unknown version number session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } // Save client's short-term public key (C') memcpy (cn_client, hello + 80, 32); uint8_t hello_nonce[crypto_box_NONCEBYTES]; uint8_t hello_plaintext[crypto_box_ZEROBYTES + 64]; uint8_t hello_box[crypto_box_BOXZEROBYTES + 80]; memcpy (hello_nonce, "CurveZMQHELLO---", 16); memcpy (hello_nonce + 16, hello + 112, 8); cn_peer_nonce = get_uint64 (hello + 112); memset (hello_box, 0, crypto_box_BOXZEROBYTES); memcpy (hello_box + crypto_box_BOXZEROBYTES, hello + 120, 80); // Open Box [64 * %x0](C'->S) rc = crypto_box_open (hello_plaintext, hello_box, sizeof hello_box, hello_nonce, cn_client, secret_key); if (rc != 0) { // CURVE I: cannot open client HELLO -- wrong server key? session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } state = sending_welcome; return rc; } int zmq::curve_server_t::produce_welcome (msg_t *msg_) { uint8_t cookie_nonce[crypto_secretbox_NONCEBYTES]; uint8_t cookie_plaintext[crypto_secretbox_ZEROBYTES + 64]; uint8_t cookie_ciphertext[crypto_secretbox_BOXZEROBYTES + 80]; // Create full nonce for encryption // 8-byte prefix plus 16-byte random nonce memcpy (cookie_nonce, "COOKIE--", 8); randombytes (cookie_nonce + 8, 16); // Generate cookie = Box [C' + s'](t) memset (cookie_plaintext, 0, crypto_secretbox_ZEROBYTES); memcpy (cookie_plaintext + crypto_secretbox_ZEROBYTES, cn_client, 32); memcpy (cookie_plaintext + crypto_secretbox_ZEROBYTES + 32, cn_secret, 32); // Generate fresh cookie key randombytes (cookie_key, crypto_secretbox_KEYBYTES); // Encrypt using symmetric cookie key int rc = crypto_secretbox (cookie_ciphertext, cookie_plaintext, sizeof cookie_plaintext, cookie_nonce, cookie_key); zmq_assert (rc == 0); uint8_t welcome_nonce[crypto_box_NONCEBYTES]; uint8_t welcome_plaintext[crypto_box_ZEROBYTES + 128]; uint8_t welcome_ciphertext[crypto_box_BOXZEROBYTES + 144]; // Create full nonce for encryption // 8-byte prefix plus 16-byte random nonce memcpy (welcome_nonce, "WELCOME-", 8); randombytes (welcome_nonce + 8, crypto_box_NONCEBYTES - 8); // Create 144-byte Box [S' + cookie](S->C') memset (welcome_plaintext, 0, crypto_box_ZEROBYTES); memcpy (welcome_plaintext + crypto_box_ZEROBYTES, cn_public, 32); memcpy (welcome_plaintext + crypto_box_ZEROBYTES + 32, cookie_nonce + 8, 16); memcpy (welcome_plaintext + crypto_box_ZEROBYTES + 48, cookie_ciphertext + crypto_secretbox_BOXZEROBYTES, 80); rc = crypto_box (welcome_ciphertext, welcome_plaintext, sizeof welcome_plaintext, welcome_nonce, cn_client, secret_key); // TODO I think we should change this back to zmq_assert (rc == 0); // as it was before https://github.com/zeromq/libzmq/pull/1832 // The reason given there was that secret_key might be 0ed. // But if it were, we would never get this far, since we could // not have opened the client's hello box with a 0ed key. if (rc == -1) return -1; rc = msg_->init_size (168); errno_assert (rc == 0); uint8_t *const welcome = static_cast (msg_->data ()); memcpy (welcome, "\x07WELCOME", 8); memcpy (welcome + 8, welcome_nonce + 8, 16); memcpy (welcome + 24, welcome_ciphertext + crypto_box_BOXZEROBYTES, 144); return 0; } int zmq::curve_server_t::process_initiate (msg_t *msg_) { int rc = check_basic_command_structure (msg_); if (rc == -1) return -1; const size_t size = msg_->size (); const uint8_t *initiate = static_cast (msg_->data ()); if (size < 9 || memcmp (initiate, "\x08INITIATE", 9)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (size < 257) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE); errno = EPROTO; return -1; } uint8_t cookie_nonce[crypto_secretbox_NONCEBYTES]; uint8_t cookie_plaintext[crypto_secretbox_ZEROBYTES + 64]; uint8_t cookie_box[crypto_secretbox_BOXZEROBYTES + 80]; // Open Box [C' + s'](t) memset (cookie_box, 0, crypto_secretbox_BOXZEROBYTES); memcpy (cookie_box + crypto_secretbox_BOXZEROBYTES, initiate + 25, 80); memcpy (cookie_nonce, "COOKIE--", 8); memcpy (cookie_nonce + 8, initiate + 9, 16); rc = crypto_secretbox_open (cookie_plaintext, cookie_box, sizeof cookie_box, cookie_nonce, cookie_key); if (rc != 0) { // CURVE I: cannot open client INITIATE cookie session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } // Check cookie plain text is as expected [C' + s'] if (memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES, cn_client, 32) || memcmp (cookie_plaintext + crypto_secretbox_ZEROBYTES + 32, cn_secret, 32)) { // TODO this case is very hard to test, as it would require a modified // client that knows the server's secret temporary cookie key // CURVE I: client INITIATE cookie is not valid session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } const size_t clen = (size - 113) + crypto_box_BOXZEROBYTES; uint8_t initiate_nonce[crypto_box_NONCEBYTES]; uint8_t initiate_plaintext[crypto_box_ZEROBYTES + 128 + 256]; uint8_t initiate_box[crypto_box_BOXZEROBYTES + 144 + 256]; // Open Box [C + vouch + metadata](C'->S') memset (initiate_box, 0, crypto_box_BOXZEROBYTES); memcpy (initiate_box + crypto_box_BOXZEROBYTES, initiate + 113, clen - crypto_box_BOXZEROBYTES); memcpy (initiate_nonce, "CurveZMQINITIATE", 16); memcpy (initiate_nonce + 16, initiate + 105, 8); cn_peer_nonce = get_uint64 (initiate + 105); rc = crypto_box_open (initiate_plaintext, initiate_box, clen, initiate_nonce, cn_client, cn_secret); if (rc != 0) { // CURVE I: cannot open client INITIATE session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } const uint8_t *client_key = initiate_plaintext + crypto_box_ZEROBYTES; uint8_t vouch_nonce[crypto_box_NONCEBYTES]; uint8_t vouch_plaintext[crypto_box_ZEROBYTES + 64]; uint8_t vouch_box[crypto_box_BOXZEROBYTES + 80]; // Open Box Box [C',S](C->S') and check contents memset (vouch_box, 0, crypto_box_BOXZEROBYTES); memcpy (vouch_box + crypto_box_BOXZEROBYTES, initiate_plaintext + crypto_box_ZEROBYTES + 48, 80); memcpy (vouch_nonce, "VOUCH---", 8); memcpy (vouch_nonce + 8, initiate_plaintext + crypto_box_ZEROBYTES + 32, 16); rc = crypto_box_open (vouch_plaintext, vouch_box, sizeof vouch_box, vouch_nonce, client_key, cn_secret); if (rc != 0) { // CURVE I: cannot open client INITIATE vouch session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; return -1; } // What we decrypted must be the client's short-term public key if (memcmp (vouch_plaintext + crypto_box_ZEROBYTES, cn_client, 32)) { // TODO this case is very hard to test, as it would require a modified // client that knows the server's secret short-term key // CURVE I: invalid handshake from client (public key) session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE); errno = EPROTO; return -1; } // Precompute connection secret from client key rc = crypto_box_beforenm (cn_precom, cn_client, cn_secret); zmq_assert (rc == 0); // Given this is a backward-incompatible change, it's behind a socket // option disabled by default. if (zap_required () || !options.zap_enforce_domain) { // Use ZAP protocol (RFC 27) to authenticate the user. rc = session->zap_connect (); if (rc == 0) { send_zap_request (client_key); state = waiting_for_zap_reply; // TODO actually, it is quite unlikely that we can read the ZAP // reply already, but removing this has some strange side-effect // (probably because the pipe's in_active flag is true until a read // is attempted) rc = receive_and_process_zap_reply (); if (rc == -1) return -1; } else if (!options.zap_enforce_domain) { // This supports the Stonehouse pattern (encryption without // authentication) in legacy mode (domain set but no handler). state = sending_ready; } else { session->get_socket ()->event_handshake_failed_no_detail ( session->get_endpoint (), EFAULT); return -1; } } else { // This supports the Stonehouse pattern (encryption without authentication). state = sending_ready; } return parse_metadata (initiate_plaintext + crypto_box_ZEROBYTES + 128, clen - crypto_box_ZEROBYTES - 128); } int zmq::curve_server_t::produce_ready (msg_t *msg_) { const size_t metadata_length = basic_properties_len (); uint8_t ready_nonce[crypto_box_NONCEBYTES]; uint8_t *ready_plaintext = (uint8_t *) malloc (crypto_box_ZEROBYTES + metadata_length); alloc_assert (ready_plaintext); // Create Box [metadata](S'->C') memset (ready_plaintext, 0, crypto_box_ZEROBYTES); uint8_t *ptr = ready_plaintext + crypto_box_ZEROBYTES; ptr += add_basic_properties (ptr, metadata_length); const size_t mlen = ptr - ready_plaintext; memcpy (ready_nonce, "CurveZMQREADY---", 16); put_uint64 (ready_nonce + 16, cn_nonce); uint8_t *ready_box = (uint8_t *) malloc (crypto_box_BOXZEROBYTES + 16 + metadata_length); alloc_assert (ready_box); int rc = crypto_box_afternm (ready_box, ready_plaintext, mlen, ready_nonce, cn_precom); zmq_assert (rc == 0); free (ready_plaintext); rc = msg_->init_size (14 + mlen - crypto_box_BOXZEROBYTES); errno_assert (rc == 0); uint8_t *ready = static_cast (msg_->data ()); memcpy (ready, "\x05READY", 6); // Short nonce, prefixed by "CurveZMQREADY---" memcpy (ready + 6, ready_nonce + 16, 8); // Box [metadata](S'->C') memcpy (ready + 14, ready_box + crypto_box_BOXZEROBYTES, mlen - crypto_box_BOXZEROBYTES); free (ready_box); cn_nonce++; return 0; } int zmq::curve_server_t::produce_error (msg_t *msg_) const { const size_t expected_status_code_length = 3; zmq_assert (status_code.length () == 3); const int rc = msg_->init_size (6 + 1 + expected_status_code_length); zmq_assert (rc == 0); char *msg_data = static_cast (msg_->data ()); memcpy (msg_data, "\5ERROR", 6); msg_data[6] = expected_status_code_length; memcpy (msg_data + 7, status_code.c_str (), expected_status_code_length); return 0; } void zmq::curve_server_t::send_zap_request (const uint8_t *key) { zap_client_t::send_zap_request ("CURVE", 5, key, crypto_box_PUBLICKEYBYTES); } #endif zeromq-4.2.5/src/gssapi_client.cpp0000664000372000037200000001535113255253220020064 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #ifdef HAVE_LIBGSSAPI_KRB5 #include #include #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "gssapi_client.hpp" #include "wire.hpp" zmq::gssapi_client_t::gssapi_client_t (session_base_t *session_, const options_t &options_) : mechanism_base_t (session_, options_), gssapi_mechanism_base_t (session_, options_), state (call_next_init), token_ptr (GSS_C_NO_BUFFER), mechs (), security_context_established (false) { const std::string::size_type service_size = options_.gss_service_principal.size (); service_name = static_cast (malloc (service_size + 1)); assert (service_name); memcpy (service_name, options_.gss_service_principal.c_str (), service_size + 1); service_name_type = convert_nametype (options_.gss_service_principal_nt); maj_stat = GSS_S_COMPLETE; if (!options_.gss_principal.empty ()) { const std::string::size_type principal_size = options_.gss_principal.size (); principal_name = static_cast (malloc (principal_size + 1)); assert (principal_name); memcpy (principal_name, options_.gss_principal.c_str (), principal_size + 1); gss_OID name_type = convert_nametype (options_.gss_principal_nt); if (acquire_credentials (principal_name, &cred, name_type) != 0) maj_stat = GSS_S_FAILURE; } mechs.elements = NULL; mechs.count = 0; } zmq::gssapi_client_t::~gssapi_client_t () { if (service_name) free (service_name); if (cred) gss_release_cred (&min_stat, &cred); } int zmq::gssapi_client_t::next_handshake_command (msg_t *msg_) { if (state == send_ready) { int rc = produce_ready (msg_); if (rc == 0) state = connected; return rc; } if (state != call_next_init) { errno = EAGAIN; return -1; } if (initialize_context () < 0) return -1; if (produce_next_token (msg_) < 0) return -1; if (maj_stat != GSS_S_CONTINUE_NEEDED && maj_stat != GSS_S_COMPLETE) return -1; if (maj_stat == GSS_S_COMPLETE) { security_context_established = true; state = recv_ready; } else state = recv_next_token; return 0; } int zmq::gssapi_client_t::process_handshake_command (msg_t *msg_) { if (state == recv_ready) { int rc = process_ready (msg_); if (rc == 0) state = send_ready; return rc; } if (state != recv_next_token) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (process_next_token (msg_) < 0) return -1; if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) return -1; state = call_next_init; errno_assert (msg_->close () == 0); errno_assert (msg_->init () == 0); return 0; } int zmq::gssapi_client_t::encode (msg_t *msg_) { zmq_assert (state == connected); if (do_encryption) return encode_message (msg_); return 0; } int zmq::gssapi_client_t::decode (msg_t *msg_) { zmq_assert (state == connected); if (do_encryption) return decode_message (msg_); return 0; } zmq::mechanism_t::status_t zmq::gssapi_client_t::status () const { return state == connected ? mechanism_t::ready : mechanism_t::handshaking; } int zmq::gssapi_client_t::initialize_context () { // principal was specified but credentials could not be acquired if (principal_name != NULL && cred == NULL) return -1; // First time through, import service_name into target_name if (target_name == GSS_C_NO_NAME) { send_tok.value = service_name; send_tok.length = strlen (service_name) + 1; OM_uint32 maj = gss_import_name (&min_stat, &send_tok, service_name_type, &target_name); if (maj != GSS_S_COMPLETE) return -1; } maj_stat = gss_init_sec_context ( &init_sec_min_stat, cred, &context, target_name, mechs.elements, gss_flags, 0, NULL, token_ptr, NULL, &send_tok, &ret_flags, NULL); if (token_ptr != GSS_C_NO_BUFFER) free (recv_tok.value); return 0; } int zmq::gssapi_client_t::produce_next_token (msg_t *msg_) { if (send_tok.length != 0) { // Server expects another token if (produce_initiate (msg_, send_tok.value, send_tok.length) < 0) { gss_release_buffer (&min_stat, &send_tok); gss_release_name (&min_stat, &target_name); return -1; } } gss_release_buffer (&min_stat, &send_tok); if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) { gss_release_name (&min_stat, &target_name); if (context != GSS_C_NO_CONTEXT) gss_delete_sec_context (&min_stat, &context, GSS_C_NO_BUFFER); return -1; } return 0; } int zmq::gssapi_client_t::process_next_token (msg_t *msg_) { if (maj_stat == GSS_S_CONTINUE_NEEDED) { if (process_initiate (msg_, &recv_tok.value, recv_tok.length) < 0) { gss_release_name (&min_stat, &target_name); return -1; } token_ptr = &recv_tok; } return 0; } #endif zeromq-4.2.5/src/io_thread.hpp0000664000372000037200000000571313255253220017204 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_IO_THREAD_HPP_INCLUDED__ #define __ZMQ_IO_THREAD_HPP_INCLUDED__ #include #include "stdint.hpp" #include "object.hpp" #include "poller.hpp" #include "i_poll_events.hpp" #include "mailbox.hpp" namespace zmq { class ctx_t; // Generic part of the I/O thread. Polling-mechanism-specific features // are implemented in separate "polling objects". class io_thread_t : public object_t, public i_poll_events { public: io_thread_t (zmq::ctx_t *ctx_, uint32_t tid_); // Clean-up. If the thread was started, it's necessary to call 'stop' // before invoking destructor. Otherwise the destructor would hang up. ~io_thread_t (); // Launch the physical thread. void start (); // Ask underlying thread to stop. void stop (); // Returns mailbox associated with this I/O thread. mailbox_t *get_mailbox (); // i_poll_events implementation. void in_event (); void out_event (); void timer_event (int id_); // Used by io_objects to retrieve the associated poller object. poller_t *get_poller (); // Command handlers. void process_stop (); // Returns load experienced by the I/O thread. int get_load (); private: // I/O thread accesses incoming commands via this mailbox. mailbox_t mailbox; // Handle associated with mailbox' file descriptor. poller_t::handle_t mailbox_handle; // I/O multiplexing is performed using a poller object. poller_t *poller; io_thread_t (const io_thread_t &); const io_thread_t &operator= (const io_thread_t &); }; } #endif zeromq-4.2.5/src/windows.hpp0000664000372000037200000000600013255253220016726 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_WINDOWS_HPP_INCLUDED__ #define __ZMQ_WINDOWS_HPP_INCLUDED__ #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #ifndef NOMINMAX #define NOMINMAX // Macros min(a,b) and max(a,b) #endif // Set target version to Windows Server 2008, Windows Vista or higher. // Windows XP (0x0501) is supported but without client & server socket types. #if !defined _WIN32_WINNT && !defined ZMQ_HAVE_WINDOWS_UWP #define _WIN32_WINNT 0x0600 #endif #if defined ZMQ_HAVE_WINDOWS_UWP #define _WIN32_WINNT _WIN32_WINNT_WIN10 #endif #ifdef __MINGW32__ // Require Windows XP or higher with MinGW for getaddrinfo(). #if (_WIN32_WINNT >= 0x0501) #else #error You need at least Windows XP target #endif #endif #include #include #include #include #if !defined __MINGW32__ #include #endif // Workaround missing mstcpip.h in mingw32 (MinGW64 provides this) // __MINGW64_VERSION_MAJOR is only defined when using in mingw-w64 #if defined __MINGW32__ && !defined SIO_KEEPALIVE_VALS \ && !defined __MINGW64_VERSION_MAJOR struct tcp_keepalive { u_long onoff; u_long keepalivetime; u_long keepaliveinterval; }; #define SIO_KEEPALIVE_VALS _WSAIOW (IOC_VENDOR, 4) #endif #include #include #if !defined _WIN32_WCE #include #endif #if defined ZMQ_USE_POLL static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout) { return WSAPoll (pfd, nfds, timeout); } #endif // In MinGW environment AI_NUMERICSERV is not defined. #ifndef AI_NUMERICSERV #define AI_NUMERICSERV 0x0400 #endif #endif zeromq-4.2.5/src/address.hpp0000664000372000037200000000502313255253220016665 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ADDRESS_HPP_INCLUDED__ #define __ZMQ_ADDRESS_HPP_INCLUDED__ #include namespace zmq { class ctx_t; class tcp_address_t; class udp_address_t; #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS class ipc_address_t; #endif #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_VXWORKS class tipc_address_t; #endif #if defined ZMQ_HAVE_VMCI class vmci_address_t; #endif struct address_t { address_t (const std::string &protocol_, const std::string &address_, ctx_t *parent_); ~address_t (); const std::string protocol; const std::string address; ctx_t *const parent; // Protocol specific resolved address union { tcp_address_t *tcp_addr; udp_address_t *udp_addr; #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS ipc_address_t *ipc_addr; #endif #if defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_VXWORKS tipc_address_t *tipc_addr; #endif #if defined ZMQ_HAVE_VMCI vmci_address_t *vmci_addr; #endif } resolved; int to_string (std::string &addr_) const; }; } #endif zeromq-4.2.5/src/platform.hpp.in0000664000372000037200000002260213255253273017503 0ustar00travistravis00000000000000/* 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. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 /* Define to 1 if you have the declaration of `LOCAL_PEERCRED', and to 0 if you don't. */ #undef HAVE_DECL_LOCAL_PEERCRED /* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you don't. */ #undef HAVE_DECL_SO_PEERCRED /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* 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. */ #undef HAVE_GETTIMEOFDAY /* 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. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* 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. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_TCP_H /* Define to 1 if you have the `perror' function. */ #undef HAVE_PERROR /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_EVENTFD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* 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 in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Enable militant API assertions */ #undef ZMQ_ACT_MILITANT /* Provide draft classes and methods */ #undef ZMQ_BUILD_DRAFT_API /* 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. */ #undef ZMQ_HAVE_ATOMIC_INTRINSICS /* 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 FreeBSD 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. */ #undef ZMQ_HAVE_IFADDRS /* 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. */ #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 */ #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. */ #undef ZMQ_HAVE_SO_KEEPALIVE /* Have SO_PEERCRED socket option */ #undef ZMQ_HAVE_SO_PEERCRED /* Whether TCP_KEEPALIVE is supported. */ #undef ZMQ_HAVE_TCP_KEEPALIVE /* Whether TCP_KEEPCNT is supported. */ #undef ZMQ_HAVE_TCP_KEEPCNT /* Whether TCP_KEEPIDLE is supported. */ #undef ZMQ_HAVE_TCP_KEEPIDLE /* Whether TCP_KEEPINTVL is supported. */ #undef ZMQ_HAVE_TCP_KEEPINTVL /* Have TIPC support */ #undef ZMQ_HAVE_TIPC /* Have uio.h header. */ #undef ZMQ_HAVE_UIO /* Have VMCI transport */ #undef ZMQ_HAVE_VMCI /* Have Windows OS */ #undef ZMQ_HAVE_WINDOWS /* Use 'devpoll' polling system */ #undef ZMQ_USE_DEVPOLL /* Use 'epoll' polling system */ #undef ZMQ_USE_EPOLL /* Use 'epoll' polling system with CLOEXEC */ #undef ZMQ_USE_EPOLL_CLOEXEC /* Use 'kqueue' polling system */ #undef ZMQ_USE_KQUEUE /* Using libsodium for curve encryption */ #undef ZMQ_USE_LIBSODIUM /* Use 'poll' polling system */ #undef ZMQ_USE_POLL /* Use 'pollset' polling system */ #undef ZMQ_USE_POLLSET /* Use 'select' polling system */ #undef ZMQ_USE_SELECT /* Using tweetnacl for curve encryption */ #undef ZMQ_USE_TWEETNACL /* 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 zeromq-4.2.5/src/pgm_socket.hpp0000664000372000037200000001003413255253220017371 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __PGM_SOCKET_HPP_INCLUDED__ #define __PGM_SOCKET_HPP_INCLUDED__ #if defined ZMQ_HAVE_OPENPGM #ifdef ZMQ_HAVE_WINDOWS #define __PGM_WININT_H__ #endif #include #if defined(ZMQ_HAVE_OSX) || defined(ZMQ_HAVE_NETBSD) #include #endif #include "fd.hpp" #include "options.hpp" namespace zmq { // Encapsulates PGM socket. class pgm_socket_t { public: // If receiver_ is true PGM transport is not generating SPM packets. pgm_socket_t (bool receiver_, const options_t &options_); // Closes the transport. ~pgm_socket_t (); // Initialize PGM network structures (GSI, GSRs). int init (bool udp_encapsulation_, const char *network_); // Resolve PGM socket address. static int init_address (const char *network_, struct pgm_addrinfo_t **addr, uint16_t *port_number); // Get receiver fds and store them into user allocated memory. void get_receiver_fds (fd_t *receive_fd_, fd_t *waiting_pipe_fd_); // Get sender and receiver fds and store it to user allocated // memory. Receive fd is used to process NAKs from peers. void get_sender_fds (fd_t *send_fd_, fd_t *receive_fd_, fd_t *rdata_notify_fd_, fd_t *pending_notify_fd_); // Send data as one APDU, transmit window owned memory. size_t send (unsigned char *data_, size_t data_len_); // Returns max tsdu size without fragmentation. size_t get_max_tsdu_size (); // Receive data from pgm socket. ssize_t receive (void **data_, const pgm_tsi_t **tsi_); long get_rx_timeout (); long get_tx_timeout (); // POLLIN on sender side should mean NAK or SPMR receiving. // process_upstream function is used to handle such a situation. void process_upstream (); private: // Compute size of the buffer based on rate and recovery interval. int compute_sqns (int tpdu_); // OpenPGM transport. pgm_sock_t *sock; int last_rx_status, last_tx_status; // Associated socket options. options_t options; // true when pgm_socket should create receiving side. bool receiver; // Array of pgm_msgv_t structures to store received data // from the socket (pgm_transport_recvmsgv). pgm_msgv_t *pgm_msgv; // Size of pgm_msgv array. size_t pgm_msgv_len; // How many bytes were read from pgm socket. size_t nbytes_rec; // How many bytes were processed from last pgm socket read. size_t nbytes_processed; // How many messages from pgm_msgv were already sent up. size_t pgm_msgv_processed; }; } #endif #endif zeromq-4.2.5/src/ipc_connecter.hpp0000664000372000037200000001027513255253220020060 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __IPC_CONNECTER_HPP_INCLUDED__ #define __IPC_CONNECTER_HPP_INCLUDED__ #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class session_base_t; struct address_t; class ipc_connecter_t : public own_t, public io_object_t { public: // If 'delayed_start' is true connecter first waits for a while, // then starts connection process. ipc_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_); ~ipc_connecter_t (); private: // ID of the timer used to delay the reconnection. enum { reconnect_timer_id = 1 }; // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); void out_event (); void timer_event (int id_); // Internal function to start the actual connection establishment. void start_connecting (); // Internal function to add a reconnect timer void add_reconnect_timer (); // Internal function to return a reconnect backoff delay. // Will modify the current_reconnect_ivl used for next call // Returns the currently used interval int get_new_reconnect_ivl (); // Open IPC connecting socket. Returns -1 in case of error, // 0 if connect was successful immediately. Returns -1 with // EAGAIN errno if async connect was launched. int open (); // Close the connecting socket. int close (); // Get the file descriptor of newly created connection. Returns // retired_fd if the connection was unsuccessful. fd_t connect (); // Address to connect to. Owned by session_base_t. const address_t *addr; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // If true file descriptor is registered with the poller and 'handle' // contains valid value. bool handle_valid; // If true, connecter is waiting a while before trying to connect. const bool delayed_start; // True iff a timer has been started. bool timer_started; // Reference to the session we belong to. zmq::session_base_t *session; // Current reconnect ivl, updated for backoff strategy int current_reconnect_ivl; // String representation of endpoint to connect to std::string endpoint; // Socket zmq::socket_base_t *socket; ipc_connecter_t (const ipc_connecter_t &); const ipc_connecter_t &operator= (const ipc_connecter_t &); }; } #endif #endif zeromq-4.2.5/src/mechanism.cpp0000664000372000037200000003010013255253220017171 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "mechanism.hpp" #include "options.hpp" #include "msg.hpp" #include "err.hpp" #include "wire.hpp" #include "session_base.hpp" zmq::mechanism_t::mechanism_t (const options_t &options_) : options (options_) { } zmq::mechanism_t::~mechanism_t () { } void zmq::mechanism_t::set_peer_routing_id (const void *id_ptr, size_t id_size) { routing_id.set (static_cast (id_ptr), id_size); } void zmq::mechanism_t::peer_routing_id (msg_t *msg_) { const int rc = msg_->init_size (routing_id.size ()); errno_assert (rc == 0); memcpy (msg_->data (), routing_id.data (), routing_id.size ()); msg_->set_flags (msg_t::routing_id); } void zmq::mechanism_t::set_user_id (const void *data_, size_t size_) { user_id.set (static_cast (data_), size_); zap_properties.ZMQ_MAP_INSERT_OR_EMPLACE ( ZMQ_MSG_PROPERTY_USER_ID, std::string ((char *) data_, size_)); } const zmq::blob_t &zmq::mechanism_t::get_user_id () const { return user_id; } const char socket_type_pair[] = "PAIR"; const char socket_type_pub[] = "PUB"; const char socket_type_sub[] = "SUB"; const char socket_type_req[] = "REQ"; const char socket_type_rep[] = "REP"; const char socket_type_dealer[] = "DEALER"; const char socket_type_router[] = "ROUTER"; const char socket_type_pull[] = "PULL"; const char socket_type_push[] = "PUSH"; const char socket_type_xpub[] = "XPUB"; const char socket_type_xsub[] = "XSUB"; const char socket_type_stream[] = "STREAM"; #ifdef ZMQ_BUILD_DRAFT_API const char socket_type_server[] = "SERVER"; const char socket_type_client[] = "CLIENT"; const char socket_type_radio[] = "RADIO"; const char socket_type_dish[] = "DISH"; const char socket_type_gather[] = "GATHER"; const char socket_type_scatter[] = "SCATTER"; const char socket_type_dgram[] = "DGRAM"; #endif const char *zmq::mechanism_t::socket_type_string (int socket_type) const { // TODO the order must of the names must correspond to the values resp. order of ZMQ_* socket type definitions in zmq.h! static const char *names[] = { socket_type_pair, socket_type_pub, socket_type_sub, socket_type_req, socket_type_rep, socket_type_dealer, socket_type_router, socket_type_pull, socket_type_push, socket_type_xpub, socket_type_xsub, socket_type_stream, #ifdef ZMQ_BUILD_DRAFT_API socket_type_server, socket_type_client, socket_type_radio, socket_type_dish, socket_type_gather, socket_type_scatter, socket_type_dgram #endif }; static const size_t names_count = sizeof (names) / sizeof (names[0]); zmq_assert (socket_type >= 0 && socket_type < (int) names_count); return names[socket_type]; } static size_t property_len (size_t name_len, size_t value_len) { return 1 + name_len + 4 + value_len; } static size_t name_len (const char *name) { const size_t name_len = strlen (name); zmq_assert (name_len <= 255); return name_len; } size_t zmq::mechanism_t::add_property (unsigned char *ptr, size_t ptr_capacity, const char *name, const void *value, size_t value_len) { const size_t name_len = ::name_len (name); const size_t total_len = ::property_len (name_len, value_len); zmq_assert (total_len <= ptr_capacity); *ptr++ = static_cast (name_len); memcpy (ptr, name, name_len); ptr += name_len; zmq_assert (value_len <= 0x7FFFFFFF); put_uint32 (ptr, static_cast (value_len)); ptr += 4; memcpy (ptr, value, value_len); return total_len; } size_t zmq::mechanism_t::property_len (const char *name, size_t value_len) { return ::property_len (name_len (name), value_len); } #define ZMTP_PROPERTY_SOCKET_TYPE "Socket-Type" #define ZMTP_PROPERTY_IDENTITY "Identity" size_t zmq::mechanism_t::add_basic_properties (unsigned char *buf, size_t buf_capacity) const { unsigned char *ptr = buf; // Add socket type property const char *socket_type = socket_type_string (options.type); ptr += add_property (ptr, buf_capacity, ZMTP_PROPERTY_SOCKET_TYPE, socket_type, strlen (socket_type)); // Add identity (aka routing id) property if (options.type == ZMQ_REQ || options.type == ZMQ_DEALER || options.type == ZMQ_ROUTER) { ptr += add_property (ptr, buf_capacity - (ptr - buf), ZMTP_PROPERTY_IDENTITY, options.routing_id, options.routing_id_size); } for (std::map::const_iterator it = options.app_metadata.begin (); it != options.app_metadata.end (); ++it) ptr += add_property (ptr, buf_capacity - (ptr - buf), it->first.c_str (), it->second.c_str (), strlen (it->second.c_str ())); return ptr - buf; } size_t zmq::mechanism_t::basic_properties_len () const { const char *socket_type = socket_type_string (options.type); int meta_len = 0; for (std::map::const_iterator it = options.app_metadata.begin (); it != options.app_metadata.end (); ++it) meta_len += property_len (it->first.c_str (), strlen (it->second.c_str ())); return property_len (ZMTP_PROPERTY_SOCKET_TYPE, strlen (socket_type)) + meta_len + ((options.type == ZMQ_REQ || options.type == ZMQ_DEALER || options.type == ZMQ_ROUTER) ? property_len (ZMTP_PROPERTY_IDENTITY, options.routing_id_size) : 0); } void zmq::mechanism_t::make_command_with_basic_properties ( msg_t *msg_, const char *prefix_, size_t prefix_len_) const { const size_t command_size = prefix_len_ + basic_properties_len (); const int rc = msg_->init_size (command_size); errno_assert (rc == 0); unsigned char *ptr = (unsigned char *) msg_->data (); // Add prefix memcpy (ptr, prefix_, prefix_len_); ptr += prefix_len_; add_basic_properties (ptr, command_size - (ptr - (unsigned char *) msg_->data ())); } int zmq::mechanism_t::parse_metadata (const unsigned char *ptr_, size_t length_, bool zap_flag_) { size_t bytes_left = length_; while (bytes_left > 1) { const size_t name_length = static_cast (*ptr_); ptr_ += 1; bytes_left -= 1; if (bytes_left < name_length) break; const std::string name = std::string ((char *) ptr_, name_length); ptr_ += name_length; bytes_left -= name_length; if (bytes_left < 4) break; const size_t value_length = static_cast (get_uint32 (ptr_)); ptr_ += 4; bytes_left -= 4; if (bytes_left < value_length) break; const uint8_t *value = ptr_; ptr_ += value_length; bytes_left -= value_length; if (name == ZMTP_PROPERTY_IDENTITY && options.recv_routing_id) set_peer_routing_id (value, value_length); else if (name == ZMTP_PROPERTY_SOCKET_TYPE) { if (!check_socket_type ((const char *) value, value_length)) { errno = EINVAL; return -1; } } else { const int rc = property (name, value, value_length); if (rc == -1) return -1; } (zap_flag_ ? zap_properties : zmtp_properties) .ZMQ_MAP_INSERT_OR_EMPLACE ( name, std::string ((char *) value, value_length)); } if (bytes_left > 0) { errno = EPROTO; return -1; } return 0; } int zmq::mechanism_t::property (const std::string & /* name_ */, const void * /* value_ */, size_t /* length_ */) { // Default implementation does not check // property values and returns 0 to signal success. return 0; } template static bool strequals (const char *actual_type_, const size_t actual_len_, const char (&expected_type_)[N]) { return actual_len_ == N - 1 && memcmp (actual_type_, expected_type_, N - 1) == 0; } bool zmq::mechanism_t::check_socket_type (const char *type_, const size_t len_) const { switch (options.type) { case ZMQ_REQ: return strequals (type_, len_, socket_type_rep) || strequals (type_, len_, socket_type_router); case ZMQ_REP: return strequals (type_, len_, socket_type_req) || strequals (type_, len_, socket_type_dealer); case ZMQ_DEALER: return strequals (type_, len_, socket_type_rep) || strequals (type_, len_, socket_type_dealer) || strequals (type_, len_, socket_type_router); case ZMQ_ROUTER: return strequals (type_, len_, socket_type_req) || strequals (type_, len_, socket_type_dealer) || strequals (type_, len_, socket_type_router); case ZMQ_PUSH: return strequals (type_, len_, socket_type_pull); case ZMQ_PULL: return strequals (type_, len_, socket_type_push); case ZMQ_PUB: return strequals (type_, len_, socket_type_sub) || strequals (type_, len_, socket_type_xsub); case ZMQ_SUB: return strequals (type_, len_, socket_type_pub) || strequals (type_, len_, socket_type_xpub); case ZMQ_XPUB: return strequals (type_, len_, socket_type_sub) || strequals (type_, len_, socket_type_xsub); case ZMQ_XSUB: return strequals (type_, len_, socket_type_pub) || strequals (type_, len_, socket_type_xpub); case ZMQ_PAIR: return strequals (type_, len_, socket_type_pair); #ifdef ZMQ_BUILD_DRAFT_API case ZMQ_SERVER: return strequals (type_, len_, socket_type_client); case ZMQ_CLIENT: return strequals (type_, len_, socket_type_server); case ZMQ_RADIO: return strequals (type_, len_, socket_type_dish); case ZMQ_DISH: return strequals (type_, len_, socket_type_radio); case ZMQ_GATHER: return strequals (type_, len_, socket_type_scatter); case ZMQ_SCATTER: return strequals (type_, len_, socket_type_gather); case ZMQ_DGRAM: return strequals (type_, len_, socket_type_dgram); #endif default: break; } return false; } zeromq-4.2.5/src/signaler.hpp0000664000372000037200000000557413255253220017057 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SIGNALER_HPP_INCLUDED__ #define __ZMQ_SIGNALER_HPP_INCLUDED__ #ifdef HAVE_FORK #include #endif #include "fd.hpp" namespace zmq { // This is a cross-platform equivalent to signal_fd. However, as opposed // to signal_fd there can be at most one signal in the signaler at any // given moment. Attempt to send a signal before receiving the previous // one will result in undefined behaviour. class signaler_t { public: signaler_t (); ~signaler_t (); // Returns the socket/file descriptor // May return retired_fd if the signaler could not be initialized. fd_t get_fd () const; void send (); int wait (int timeout_); void recv (); int recv_failable (); bool valid () const; #ifdef HAVE_FORK // close the file descriptors in a forked child process so that they // do not interfere with the context in the parent process. void forked (); #endif private: // Underlying write & read file descriptor // Will be -1 if an error occurred during initialization, e.g. we // exceeded the number of available handles fd_t w; fd_t r; // Disable copying of signaler_t object. signaler_t (const signaler_t &); const signaler_t &operator= (const signaler_t &); #ifdef HAVE_FORK // the process that created this context. Used to detect forking. pid_t pid; // idempotent close of file descriptors that is safe to use by destructor // and forked(). void close_internal (); #endif }; } #endif zeromq-4.2.5/src/tipc_address.hpp0000664000372000037200000000457713255253220017721 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__ #define __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__ #include #include "platform.hpp" #if defined ZMQ_HAVE_TIPC #include #if defined ZMQ_HAVE_VXWORKS #include #else #include #endif namespace zmq { class tipc_address_t { public: tipc_address_t (); tipc_address_t (const sockaddr *sa, socklen_t sa_len); ~tipc_address_t (); // This function sets up the address "{type, lower, upper}" for TIPC transport int resolve (const char *name); // The opposite to resolve() int to_string (std::string &addr_); // Handling different TIPC address types bool is_service () const; bool is_random () const; void set_random (); const sockaddr *addr () const; socklen_t addrlen () const; private: bool _random; struct sockaddr_tipc address; tipc_address_t (const tipc_address_t &); const tipc_address_t &operator= (const tipc_address_t &); }; } #endif #endif zeromq-4.2.5/src/ypipe_conflate.hpp0000664000372000037200000001003613255253220020241 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_YPIPE_CONFLATE_HPP_INCLUDED__ #define __ZMQ_YPIPE_CONFLATE_HPP_INCLUDED__ #include "platform.hpp" #include "dbuffer.hpp" #include "ypipe_base.hpp" namespace zmq { // Adapter for dbuffer, to plug it in instead of a queue for the sake // of implementing the conflate socket option, which, if set, makes // the receiving side to discard all incoming messages but the last one. // // reader_awake flag is needed here to mimic ypipe delicate behaviour // around the reader being asleep (see 'c' pointer being NULL in ypipe.hpp) template class ypipe_conflate_t : public ypipe_base_t { public: // Initialises the pipe. inline ypipe_conflate_t () : reader_awake (false) {} // The destructor doesn't have to be virtual. It is made virtual // just to keep ICC and code checking tools from complaining. inline virtual ~ypipe_conflate_t () {} // Following function (write) deliberately copies uninitialised data // when used with zmq_msg. Initialising the VSM body for // non-VSM messages won't be good for performance. #ifdef ZMQ_HAVE_OPENVMS #pragma message save #pragma message disable(UNINIT) #endif inline void write (const T &value_, bool incomplete_) { (void) incomplete_; dbuffer.write (value_); } #ifdef ZMQ_HAVE_OPENVMS #pragma message restore #endif // There are no incomplete items for conflate ypipe inline bool unwrite (T *) { return false; } // Flush is no-op for conflate ypipe. Reader asleep behaviour // is as of the usual ypipe. // Returns false if the reader thread is sleeping. In that case, // caller is obliged to wake the reader up before using the pipe again. inline bool flush () { return reader_awake; } // Check whether item is available for reading. inline bool check_read () { bool res = dbuffer.check_read (); if (!res) reader_awake = false; return res; } // Reads an item from the pipe. Returns false if there is no value. // available. inline bool read (T *value_) { if (!check_read ()) return false; return dbuffer.read (value_); } // Applies the function fn to the first elemenent in the pipe // and returns the value returned by the fn. // The pipe mustn't be empty or the function crashes. inline bool probe (bool (*fn) (const T &)) { return dbuffer.probe (fn); } protected: dbuffer_t dbuffer; bool reader_awake; // Disable copying of ypipe object. ypipe_conflate_t (const ypipe_conflate_t &); const ypipe_conflate_t &operator= (const ypipe_conflate_t &); }; } #endif zeromq-4.2.5/src/sub.cpp0000664000372000037200000000525313255253220016031 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "sub.hpp" #include "msg.hpp" zmq::sub_t::sub_t (class ctx_t *parent_, uint32_t tid_, int sid_) : xsub_t (parent_, tid_, sid_) { options.type = ZMQ_SUB; // Switch filtering messages on (as opposed to XSUB which where the // filtering is off). options.filter = true; } zmq::sub_t::~sub_t () { } int zmq::sub_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { if (option_ != ZMQ_SUBSCRIBE && option_ != ZMQ_UNSUBSCRIBE) { errno = EINVAL; return -1; } // Create the subscription message. msg_t msg; int rc = msg.init_size (optvallen_ + 1); errno_assert (rc == 0); unsigned char *data = (unsigned char *) msg.data (); *data = (option_ == ZMQ_SUBSCRIBE); // We explicitly allow a NULL subscription with size zero if (optvallen_) { assert (optval_); memcpy (data + 1, optval_, optvallen_); } // Pass it further on in the stack. rc = xsub_t::xsend (&msg); return close_and_return (&msg, rc); } int zmq::sub_t::xsend (msg_t *) { // Override the XSUB's send. errno = ENOTSUP; return -1; } bool zmq::sub_t::xhas_out () { // Override the XSUB's send. return false; } zeromq-4.2.5/src/trie.cpp0000664000372000037200000002570713255253220016211 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "err.hpp" #include "trie.hpp" #include #include #include zmq::trie_t::trie_t () : refcnt (0), min (0), count (0), live_nodes (0) { } zmq::trie_t::~trie_t () { if (count == 1) { zmq_assert (next.node); LIBZMQ_DELETE (next.node); } else if (count > 1) { for (unsigned short i = 0; i != count; ++i) { LIBZMQ_DELETE (next.table[i]); } free (next.table); } } bool zmq::trie_t::add (unsigned char *prefix_, size_t size_) { // We are at the node corresponding to the prefix. We are done. if (!size_) { ++refcnt; return refcnt == 1; } unsigned char c = *prefix_; if (c < min || c >= min + count) { // The character is out of range of currently handled // characters. We have to extend the table. if (!count) { min = c; count = 1; next.node = NULL; } else if (count == 1) { unsigned char oldc = min; trie_t *oldp = next.node; count = (min < c ? c - min : min - c) + 1; next.table = (trie_t **) malloc (sizeof (trie_t *) * count); alloc_assert (next.table); for (unsigned short i = 0; i != count; ++i) next.table[i] = 0; min = std::min (min, c); next.table[oldc - min] = oldp; } else if (min < c) { // The new character is above the current character range. unsigned short old_count = count; count = c - min + 1; next.table = (trie_t **) realloc ((void *) next.table, sizeof (trie_t *) * count); zmq_assert (next.table); for (unsigned short i = old_count; i != count; i++) next.table[i] = NULL; } else { // The new character is below the current character range. unsigned short old_count = count; count = (min + old_count) - c; next.table = (trie_t **) realloc ((void *) next.table, sizeof (trie_t *) * count); zmq_assert (next.table); memmove (next.table + min - c, next.table, old_count * sizeof (trie_t *)); for (unsigned short i = 0; i != min - c; i++) next.table[i] = NULL; min = c; } } // If next node does not exist, create one. if (count == 1) { if (!next.node) { next.node = new (std::nothrow) trie_t; alloc_assert (next.node); ++live_nodes; zmq_assert (live_nodes == 1); } return next.node->add (prefix_ + 1, size_ - 1); } else { if (!next.table[c - min]) { next.table[c - min] = new (std::nothrow) trie_t; alloc_assert (next.table[c - min]); ++live_nodes; zmq_assert (live_nodes > 1); } return next.table[c - min]->add (prefix_ + 1, size_ - 1); } } bool zmq::trie_t::rm (unsigned char *prefix_, size_t size_) { // TODO: Shouldn't an error be reported if the key does not exist? if (!size_) { if (!refcnt) return false; refcnt--; return refcnt == 0; } unsigned char c = *prefix_; if (!count || c < min || c >= min + count) return false; trie_t *next_node = count == 1 ? next.node : next.table[c - min]; if (!next_node) return false; bool ret = next_node->rm (prefix_ + 1, size_ - 1); // Prune redundant nodes if (next_node->is_redundant ()) { LIBZMQ_DELETE (next_node); zmq_assert (count > 0); if (count == 1) { // The just pruned node is was the only live node next.node = 0; count = 0; --live_nodes; zmq_assert (live_nodes == 0); } else { next.table[c - min] = 0; zmq_assert (live_nodes > 1); --live_nodes; // Compact the table if possible if (live_nodes == 1) { // We can switch to using the more compact single-node // representation since the table only contains one live node trie_t *node = 0; // Since we always compact the table the pruned node must // either be the left-most or right-most ptr in the node // table if (c == min) { // The pruned node is the left-most node ptr in the // node table => keep the right-most node node = next.table[count - 1]; min += count - 1; } else if (c == min + count - 1) { // The pruned node is the right-most node ptr in the // node table => keep the left-most node node = next.table[0]; } zmq_assert (node); free (next.table); next.node = node; count = 1; } else if (c == min) { // We can compact the table "from the left". // Find the left-most non-null node ptr, which we'll use as // our new min unsigned char new_min = min; for (unsigned short i = 1; i < count; ++i) { if (next.table[i]) { new_min = i + min; break; } } zmq_assert (new_min != min); trie_t **old_table = next.table; zmq_assert (new_min > min); zmq_assert (count > new_min - min); count = count - (new_min - min); next.table = (trie_t **) malloc (sizeof (trie_t *) * count); alloc_assert (next.table); memmove (next.table, old_table + (new_min - min), sizeof (trie_t *) * count); free (old_table); min = new_min; } else if (c == min + count - 1) { // We can compact the table "from the right". // Find the right-most non-null node ptr, which we'll use to // determine the new table size unsigned short new_count = count; for (unsigned short i = 1; i < count; ++i) { if (next.table[count - 1 - i]) { new_count = count - i; break; } } zmq_assert (new_count != count); count = new_count; trie_t **old_table = next.table; next.table = (trie_t **) malloc (sizeof (trie_t *) * count); alloc_assert (next.table); memmove (next.table, old_table, sizeof (trie_t *) * count); free (old_table); } } } return ret; } bool zmq::trie_t::check (unsigned char *data_, size_t size_) { // This function is on critical path. It deliberately doesn't use // recursion to get a bit better performance. trie_t *current = this; while (true) { // We've found a corresponding subscription! if (current->refcnt) return true; // We've checked all the data and haven't found matching subscription. if (!size_) return false; // If there's no corresponding slot for the first character // of the prefix, the message does not match. unsigned char c = *data_; if (c < current->min || c >= current->min + current->count) return false; // Move to the next character. if (current->count == 1) current = current->next.node; else { current = current->next.table[c - current->min]; if (!current) return false; } data_++; size_--; } } void zmq::trie_t::apply ( void (*func_) (unsigned char *data_, size_t size_, void *arg_), void *arg_) { unsigned char *buff = NULL; apply_helper (&buff, 0, 0, func_, arg_); free (buff); } void zmq::trie_t::apply_helper (unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void (*func_) (unsigned char *data_, size_t size_, void *arg_), void *arg_) { // If this node is a subscription, apply the function. if (refcnt) func_ (*buff_, buffsize_, arg_); // Adjust the buffer. if (buffsize_ >= maxbuffsize_) { maxbuffsize_ = buffsize_ + 256; *buff_ = (unsigned char *) realloc (*buff_, maxbuffsize_); zmq_assert (*buff_); } // If there are no subnodes in the trie, return. if (count == 0) return; // If there's one subnode (optimisation). if (count == 1) { (*buff_)[buffsize_] = min; buffsize_++; next.node->apply_helper (buff_, buffsize_, maxbuffsize_, func_, arg_); return; } // If there are multiple subnodes. for (unsigned short c = 0; c != count; c++) { (*buff_)[buffsize_] = min + c; if (next.table[c]) next.table[c]->apply_helper (buff_, buffsize_ + 1, maxbuffsize_, func_, arg_); } } bool zmq::trie_t::is_redundant () const { return refcnt == 0 && live_nodes == 0; } zeromq-4.2.5/src/radio.cpp0000664000372000037200000001757413255253220016347 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "radio.hpp" #include "macros.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::radio_t::radio_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true), lossy (true) { options.type = ZMQ_RADIO; } zmq::radio_t::~radio_t () { } void zmq::radio_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); // Don't delay pipe termination as there is no one // to receive the delimiter. pipe_->set_nodelay (); dist.attach (pipe_); if (subscribe_to_all_) udp_pipes.push_back (pipe_); // The pipe is active when attached. Let's read the subscriptions from // it, if any. else xread_activated (pipe_); } void zmq::radio_t::xread_activated (pipe_t *pipe_) { // There are some subscriptions waiting. Let's process them. msg_t msg; while (pipe_->read (&msg)) { // Apply the subscription to the trie if (msg.is_join () || msg.is_leave ()) { std::string group = std::string (msg.group ()); if (msg.is_join ()) subscriptions.ZMQ_MAP_INSERT_OR_EMPLACE (ZMQ_MOVE (group), pipe_); else { std::pair range = subscriptions.equal_range (group); for (subscriptions_t::iterator it = range.first; it != range.second; ++it) { if (it->second == pipe_) { subscriptions.erase (it); break; } } } } msg.close (); } } void zmq::radio_t::xwrite_activated (pipe_t *pipe_) { dist.activated (pipe_); } int zmq::radio_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { if (optvallen_ != sizeof (int) || *static_cast (optval_) < 0) { errno = EINVAL; return -1; } if (option_ == ZMQ_XPUB_NODROP) lossy = (*static_cast (optval_) == 0); else { errno = EINVAL; return -1; } return 0; } void zmq::radio_t::xpipe_terminated (pipe_t *pipe_) { // NOTE: erase invalidates an iterator, and that's why it's not incrementing in post-loop // read-after-free caught by Valgrind, see https://github.com/zeromq/libzmq/pull/1771 for (subscriptions_t::iterator it = subscriptions.begin (); it != subscriptions.end ();) { if (it->second == pipe_) { subscriptions.erase (it++); } else { ++it; } } udp_pipes_t::iterator it = std::find (udp_pipes.begin (), udp_pipes.end (), pipe_); if (it != udp_pipes.end ()) udp_pipes.erase (it); dist.pipe_terminated (pipe_); } int zmq::radio_t::xsend (msg_t *msg_) { // Radio sockets do not allow multipart data (ZMQ_SNDMORE) if (msg_->flags () & msg_t::more) { errno = EINVAL; return -1; } dist.unmatch (); std::pair range = subscriptions.equal_range (std::string (msg_->group ())); for (subscriptions_t::iterator it = range.first; it != range.second; ++it) dist.match (it->second); for (udp_pipes_t::iterator it = udp_pipes.begin (); it != udp_pipes.end (); ++it) dist.match (*it); int rc = -1; if (lossy || dist.check_hwm ()) { if (dist.send_to_matching (msg_) == 0) { rc = 0; // Yay, sent successfully } } else errno = EAGAIN; return rc; } bool zmq::radio_t::xhas_out () { return dist.has_out (); } int zmq::radio_t::xrecv (msg_t *msg_) { // Messages cannot be received from PUB socket. LIBZMQ_UNUSED (msg_); errno = ENOTSUP; return -1; } bool zmq::radio_t::xhas_in () { return false; } zmq::radio_session_t::radio_session_t (io_thread_t *io_thread_, bool connect_, socket_base_t *socket_, const options_t &options_, address_t *addr_) : session_base_t (io_thread_, connect_, socket_, options_, addr_), state (group) { } zmq::radio_session_t::~radio_session_t () { } int zmq::radio_session_t::push_msg (msg_t *msg_) { if (msg_->flags () & msg_t::command) { char *command_data = static_cast (msg_->data ()); const size_t data_size = msg_->size (); int group_length; char *group; msg_t join_leave_msg; int rc; // Set the msg type to either JOIN or LEAVE if (data_size >= 5 && memcmp (command_data, "\4JOIN", 5) == 0) { group_length = (int) data_size - 5; group = command_data + 5; rc = join_leave_msg.init_join (); } else if (data_size >= 6 && memcmp (command_data, "\5LEAVE", 6) == 0) { group_length = (int) data_size - 6; group = command_data + 6; rc = join_leave_msg.init_leave (); } // If it is not a JOIN or LEAVE just push the message else return session_base_t::push_msg (msg_); errno_assert (rc == 0); // Set the group rc = join_leave_msg.set_group (group, group_length); errno_assert (rc == 0); // Close the current command rc = msg_->close (); errno_assert (rc == 0); // Push the join or leave command *msg_ = join_leave_msg; return session_base_t::push_msg (msg_); } else return session_base_t::push_msg (msg_); } int zmq::radio_session_t::pull_msg (msg_t *msg_) { if (state == group) { int rc = session_base_t::pull_msg (&pending_msg); if (rc != 0) return rc; const char *group = pending_msg.group (); int length = (int) strlen (group); // First frame is the group rc = msg_->init_size (length); errno_assert (rc == 0); msg_->set_flags (msg_t::more); memcpy (msg_->data (), group, length); // Next status is the body state = body; return 0; } else { *msg_ = pending_msg; state = group; return 0; } } void zmq::radio_session_t::reset () { session_base_t::reset (); state = group; } zeromq-4.2.5/src/socket_poller.hpp0000664000372000037200000001042713255253220020111 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SOCKET_POLLER_HPP_INCLUDED__ #define __ZMQ_SOCKET_POLLER_HPP_INCLUDED__ #include "poller.hpp" #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS #include #endif #if defined ZMQ_HAVE_WINDOWS #include "windows.hpp" #elif defined ZMQ_HAVE_VXWORKS #include #include #include #else #include #endif #include #include #include "socket_base.hpp" #include "signaler.hpp" namespace zmq { class socket_poller_t { public: socket_poller_t (); ~socket_poller_t (); typedef struct event_t { socket_base_t *socket; fd_t fd; void *user_data; short events; } event_t; int add (socket_base_t *socket, void *user_data, short events); int modify (socket_base_t *socket, short events); int remove (socket_base_t *socket); int add_fd (fd_t fd, void *user_data, short events); int modify_fd (fd_t fd, short events); int remove_fd (fd_t fd); int wait (event_t *event, int n_events, long timeout); inline int size (void) { return static_cast (items.size ()); }; // Return false if object is not a socket. bool check_tag (); private: void zero_trail_events (zmq::socket_poller_t::event_t *events_, int n_events_, int found); #if defined ZMQ_POLL_BASED_ON_POLL int check_events (zmq::socket_poller_t::event_t *events_, int n_events_); #elif defined ZMQ_POLL_BASED_ON_SELECT int check_events (zmq::socket_poller_t::event_t *events_, int n_events_, fd_set &inset, fd_set &outset, fd_set &errset); #endif int adjust_timeout (zmq::clock_t &clock, long timeout_, uint64_t &now, uint64_t &end, bool &first_pass); void rebuild (); // Used to check whether the object is a socket_poller. uint32_t tag; // Signaler used for thread safe sockets polling signaler_t *signaler; typedef struct item_t { socket_base_t *socket; fd_t fd; void *user_data; short events; #if defined ZMQ_POLL_BASED_ON_POLL int pollfd_index; #endif } item_t; // List of sockets typedef std::vector items_t; items_t items; // Does the pollset needs rebuilding? bool need_rebuild; // Should the signaler be used for the thread safe polling? bool use_signaler; // Size of the pollset int poll_size; #if defined ZMQ_POLL_BASED_ON_POLL pollfd *pollfds; #elif defined ZMQ_POLL_BASED_ON_SELECT fd_set pollset_in; fd_set pollset_out; fd_set pollset_err; zmq::fd_t maxfd; #endif socket_poller_t (const socket_poller_t &); const socket_poller_t &operator= (const socket_poller_t &); }; } #endif zeromq-4.2.5/src/socket_base.hpp0000664000372000037200000002500113255253220017520 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SOCKET_BASE_HPP_INCLUDED__ #define __ZMQ_SOCKET_BASE_HPP_INCLUDED__ #include #include #include #include "own.hpp" #include "array.hpp" #include "blob.hpp" #include "stdint.hpp" #include "poller.hpp" #include "atomic_counter.hpp" #include "i_poll_events.hpp" #include "i_mailbox.hpp" #include "stdint.hpp" #include "clock.hpp" #include "pipe.hpp" extern "C" { void zmq_free_event (void *data, void *hint); } namespace zmq { class ctx_t; class msg_t; class pipe_t; class socket_base_t : public own_t, public array_item_t<>, public i_poll_events, public i_pipe_events { friend class reaper_t; public: // Returns false if object is not a socket. bool check_tag (); // Create a socket of a specified type. static socket_base_t * create (int type_, zmq::ctx_t *parent_, uint32_t tid_, int sid_); // Returns the mailbox associated with this socket. i_mailbox *get_mailbox (); // Interrupt blocking call if the socket is stuck in one. // This function can be called from a different thread! void stop (); // Interface for communication with the API layer. int setsockopt (int option_, const void *optval_, size_t optvallen_); int getsockopt (int option_, void *optval_, size_t *optvallen_); int bind (const char *addr_); int connect (const char *addr_); int term_endpoint (const char *addr_); int send (zmq::msg_t *msg_, int flags_); int recv (zmq::msg_t *msg_, int flags_); void add_signaler (signaler_t *s); void remove_signaler (signaler_t *s); int close (); // These functions are used by the polling mechanism to determine // which events are to be reported from this socket. bool has_in (); bool has_out (); // Joining and leaving groups int join (const char *group); int leave (const char *group); // Using this function reaper thread ask the socket to register with // its poller. void start_reaping (poller_t *poller_); // i_poll_events implementation. This interface is used when socket // is handled by the poller in the reaper thread. void in_event (); void out_event (); void timer_event (int id_); // i_pipe_events interface implementation. void read_activated (pipe_t *pipe_); void write_activated (pipe_t *pipe_); void hiccuped (pipe_t *pipe_); void pipe_terminated (pipe_t *pipe_); void lock (); void unlock (); int monitor (const char *endpoint_, int events_); void event_connected (const std::string &addr_, zmq::fd_t fd_); void event_connect_delayed (const std::string &addr_, int err_); void event_connect_retried (const std::string &addr_, int interval_); void event_listening (const std::string &addr_, zmq::fd_t fd_); void event_bind_failed (const std::string &addr_, int err_); void event_accepted (const std::string &addr_, zmq::fd_t fd_); void event_accept_failed (const std::string &addr_, int err_); void event_closed (const std::string &addr_, zmq::fd_t fd_); void event_close_failed (const std::string &addr_, int err_); void event_disconnected (const std::string &addr_, zmq::fd_t fd_); void event_handshake_failed_no_detail (const std::string &addr_, int err_); void event_handshake_failed_protocol (const std::string &addr_, int err_); void event_handshake_failed_auth (const std::string &addr_, int err_); void event_handshake_succeeded (const std::string &addr_, int err_); // Query the state of a specific peer. The default implementation // always returns an ENOTSUP error. virtual int get_peer_state (const void *identity, size_t identity_size) const; protected: socket_base_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_, bool thread_safe_ = false); virtual ~socket_base_t (); // Concrete algorithms for the x- methods are to be defined by // individual socket types. virtual void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false) = 0; // The default implementation assumes there are no specific socket // options for the particular socket type. If not so, override this // method. virtual int xsetsockopt (int option_, const void *optval_, size_t optvallen_); // The default implementation assumes that send is not supported. virtual bool xhas_out (); virtual int xsend (zmq::msg_t *msg_); // The default implementation assumes that recv in not supported. virtual bool xhas_in (); virtual int xrecv (zmq::msg_t *msg_); // Returns the credential for the peer from which we have received // the last message. If no message has been received yet, // the function returns empty credential. virtual const blob_t &get_credential () const; // i_pipe_events will be forwarded to these functions. virtual void xread_activated (pipe_t *pipe_); virtual void xwrite_activated (pipe_t *pipe_); virtual void xhiccuped (pipe_t *pipe_); virtual void xpipe_terminated (pipe_t *pipe_) = 0; // the default implementation assumes that joub and leave are not supported. virtual int xjoin (const char *group_); virtual int xleave (const char *group_); // Delay actual destruction of the socket. void process_destroy (); // Next assigned name on a zmq_connect() call used by ROUTER and STREAM socket types std::string connect_routing_id; private: // test if event should be sent and then dispatch it void event (const std::string &addr_, intptr_t fd_, int type_); // Socket event data dispatch void monitor_event (int event_, intptr_t value_, const std::string &addr_); // Monitor socket cleanup void stop_monitor (bool send_monitor_stopped_event_ = true); // Creates new endpoint ID and adds the endpoint to the map. void add_endpoint (const char *addr_, own_t *endpoint_, pipe_t *pipe); // Map of open endpoints. typedef std::pair endpoint_pipe_t; typedef std::multimap endpoints_t; endpoints_t endpoints; // Map of open inproc endpoints. typedef std::multimap inprocs_t; inprocs_t inprocs; // To be called after processing commands or invoking any command // handlers explicitly. If required, it will deallocate the socket. void check_destroy (); // Moves the flags from the message to local variables, // to be later retrieved by getsockopt. void extract_flags (msg_t *msg_); // Used to check whether the object is a socket. uint32_t tag; // If true, associated context was already terminated. bool ctx_terminated; // If true, object should have been already destroyed. However, // destruction is delayed while we unwind the stack to the point // where it doesn't intersect the object being destroyed. bool destroyed; // Parse URI string. int parse_uri (const char *uri_, std::string &protocol_, std::string &address_); // Check whether transport protocol, as specified in connect or // bind, is available and compatible with the socket type. int check_protocol (const std::string &protocol_); // Register the pipe with this socket. void attach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false); // Processes commands sent to this socket (if any). If timeout is -1, // returns only after at least one command was processed. // If throttle argument is true, commands are processed at most once // in a predefined time period. int process_commands (int timeout_, bool throttle_); // Handlers for incoming commands. void process_stop (); void process_bind (zmq::pipe_t *pipe_); void process_term (int linger_); void process_term_endpoint (std::string *endpoint_); void update_pipe_options (int option_); // Socket's mailbox object. i_mailbox *mailbox; // List of attached pipes. typedef array_t pipes_t; pipes_t pipes; // Reaper's poller and handle of this socket within it. poller_t *poller; poller_t::handle_t handle; // Timestamp of when commands were processed the last time. uint64_t last_tsc; // Number of messages received since last command processing. int ticks; // True if the last message received had MORE flag set. bool rcvmore; // Improves efficiency of time measurement. clock_t clock; // Monitor socket; void *monitor_socket; // Bitmask of events being monitored int monitor_events; // Last socket endpoint resolved URI std::string last_endpoint; // Indicate if the socket is thread safe const bool thread_safe; // Signaler to be used in the reaping stage signaler_t *reaper_signaler; // Mutex for synchronize access to the socket in thread safe mode mutex_t sync; // Mutex to synchronize access to the monitor Pair socket mutex_t monitor_sync; socket_base_t (const socket_base_t &); const socket_base_t &operator= (const socket_base_t &); }; } #endif zeromq-4.2.5/src/atomic_ptr.hpp0000664000372000037200000002211713255253220017404 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ATOMIC_PTR_HPP_INCLUDED__ #define __ZMQ_ATOMIC_PTR_HPP_INCLUDED__ #if defined ZMQ_FORCE_MUTEXES #define ZMQ_ATOMIC_PTR_MUTEX #elif defined ZMQ_HAVE_ATOMIC_INTRINSICS #define ZMQ_ATOMIC_PTR_INTRINSIC #elif (defined __cplusplus && __cplusplus >= 201103L) \ || (defined _MSC_VER && _MSC_VER >= 1900) #define ZMQ_ATOMIC_PTR_CXX11 #elif (defined __i386__ || defined __x86_64__) && defined __GNUC__ #define ZMQ_ATOMIC_PTR_X86 #elif defined __ARM_ARCH_7A__ && defined __GNUC__ #define ZMQ_ATOMIC_PTR_ARM #elif defined __tile__ #define ZMQ_ATOMIC_PTR_TILE #elif defined ZMQ_HAVE_WINDOWS #define ZMQ_ATOMIC_PTR_WINDOWS #elif (defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_NETBSD \ || defined ZMQ_HAVE_GNU) #define ZMQ_ATOMIC_PTR_ATOMIC_H #else #define ZMQ_ATOMIC_PTR_MUTEX #endif #if defined ZMQ_ATOMIC_PTR_MUTEX #include "mutex.hpp" #elif defined ZMQ_ATOMIC_PTR_CXX11 #include #elif defined ZMQ_ATOMIC_PTR_WINDOWS #include "windows.hpp" #elif defined ZMQ_ATOMIC_PTR_ATOMIC_H #include #elif defined ZMQ_ATOMIC_PTR_TILE #include #endif namespace zmq { #if !defined ZMQ_ATOMIC_PTR_CXX11 inline void *atomic_xchg_ptr (void **ptr, void *const val_ #if defined ZMQ_ATOMIC_PTR_MUTEX , mutex_t &sync #endif ) { #if defined ZMQ_ATOMIC_PTR_WINDOWS return InterlockedExchangePointer ((PVOID *) ptr, val_); #elif defined ZMQ_ATOMIC_PTR_INTRINSIC return __atomic_exchange_n (ptr, val_, __ATOMIC_ACQ_REL); #elif defined ZMQ_ATOMIC_PTR_ATOMIC_H return atomic_swap_ptr (ptr, val_); #elif defined ZMQ_ATOMIC_PTR_TILE return arch_atomic_exchange (ptr, val_); #elif defined ZMQ_ATOMIC_PTR_X86 void *old; __asm__ volatile("lock; xchg %0, %2" : "=r"(old), "=m"(*ptr) : "m"(*ptr), "0"(val_)); return old; #elif defined ZMQ_ATOMIC_PTR_ARM void *old; unsigned int flag; __asm__ volatile(" dmb sy\n\t" "1: ldrex %1, [%3]\n\t" " strex %0, %4, [%3]\n\t" " teq %0, #0\n\t" " bne 1b\n\t" " dmb sy\n\t" : "=&r"(flag), "=&r"(old), "+Qo"(*ptr) : "r"(ptr), "r"(val_) : "cc"); return old; #elif defined ZMQ_ATOMIC_PTR_MUTEX sync.lock (); void *old = *ptr; *ptr = val_; sync.unlock (); return old; #else #error atomic_ptr is not implemented for this platform #endif } inline void *atomic_cas (void *volatile *ptr_, void *cmp_, void *val_ #if defined ZMQ_ATOMIC_PTR_MUTEX , mutex_t &sync #endif ) { #if defined ZMQ_ATOMIC_PTR_WINDOWS return InterlockedCompareExchangePointer ((volatile PVOID *) ptr_, val_, cmp_); #elif defined ZMQ_ATOMIC_PTR_INTRINSIC void *old = cmp_; __atomic_compare_exchange_n (ptr_, &old, val_, false, __ATOMIC_RELEASE, __ATOMIC_ACQUIRE); return old; #elif defined ZMQ_ATOMIC_PTR_ATOMIC_H return atomic_cas_ptr (ptr_, cmp_, val_); #elif defined ZMQ_ATOMIC_PTR_TILE return arch_atomic_val_compare_and_exchange (ptr_, cmp_, val_); #elif defined ZMQ_ATOMIC_PTR_X86 void *old; __asm__ volatile("lock; cmpxchg %2, %3" : "=a"(old), "=m"(*ptr_) : "r"(val_), "m"(*ptr_), "0"(cmp_) : "cc"); return old; #elif defined ZMQ_ATOMIC_PTR_ARM void *old; unsigned int flag; __asm__ volatile(" dmb sy\n\t" "1: ldrex %1, [%3]\n\t" " mov %0, #0\n\t" " teq %1, %4\n\t" " it eq\n\t" " strexeq %0, %5, [%3]\n\t" " teq %0, #0\n\t" " bne 1b\n\t" " dmb sy\n\t" : "=&r"(flag), "=&r"(old), "+Qo"(*ptr_) : "r"(ptr_), "r"(cmp_), "r"(val_) : "cc"); return old; #elif defined ZMQ_ATOMIC_PTR_MUTEX sync.lock (); void *old = *ptr_; if (*ptr_ == cmp_) *ptr_ = val_; sync.unlock (); return old; #else #error atomic_ptr is not implemented for this platform #endif } #endif // This class encapsulates several atomic operations on pointers. template class atomic_ptr_t { public: // Initialise atomic pointer inline atomic_ptr_t () { ptr = NULL; } // Destroy atomic pointer inline ~atomic_ptr_t () {} // Set value of atomic pointer in a non-threadsafe way // Use this function only when you are sure that at most one // thread is accessing the pointer at the moment. inline void set (T *ptr_) { this->ptr = ptr_; } // Perform atomic 'exchange pointers' operation. Pointer is set // to the 'val' value. Old value is returned. inline T *xchg (T *val_) { #if defined ZMQ_ATOMIC_PTR_CXX11 return ptr.exchange (val_, std::memory_order_acq_rel); #else return (T *) atomic_xchg_ptr ((void **) &ptr, val_ #if defined ZMQ_ATOMIC_PTR_MUTEX , sync #endif ); #endif } // Perform atomic 'compare and swap' operation on the pointer. // The pointer is compared to 'cmp' argument and if they are // equal, its value is set to 'val'. Old value of the pointer // is returned. inline T *cas (T *cmp_, T *val_) { #if defined ZMQ_ATOMIC_PTR_CXX11 ptr.compare_exchange_strong (cmp_, val_, std::memory_order_acq_rel); return cmp_; #else return (T *) atomic_cas ((void **) &ptr, cmp_, val_ #if defined ZMQ_ATOMIC_PTR_MUTEX , sync #endif ); #endif } private: #if defined ZMQ_ATOMIC_PTR_CXX11 std::atomic ptr; #else volatile T *ptr; #endif #if defined ZMQ_ATOMIC_PTR_MUTEX mutex_t sync; #endif #if !defined ZMQ_ATOMIC_PTR_CXX11 atomic_ptr_t (const atomic_ptr_t &); const atomic_ptr_t &operator= (const atomic_ptr_t &); #endif }; struct atomic_value_t { atomic_value_t (const int value_) : value (value_) {} atomic_value_t (const atomic_value_t &src) : value (src.load ()) {} void store (const int value_) { #if defined ZMQ_ATOMIC_PTR_CXX11 value.store (value_, std::memory_order_release); #else atomic_xchg_ptr ((void **) &value, (void *) (ptrdiff_t) value_ #if defined ZMQ_ATOMIC_PTR_MUTEX , sync #endif ); #endif } int load () const { #if defined ZMQ_ATOMIC_PTR_CXX11 return value.load (std::memory_order_acquire); #else return (int) (ptrdiff_t) atomic_cas ((void **) &value, 0, 0 #if defined ZMQ_ATOMIC_PTR_MUTEX , sync #endif ); #endif } private: #if defined ZMQ_ATOMIC_PTR_CXX11 std::atomic value; #else volatile ptrdiff_t value; #endif #if defined ZMQ_ATOMIC_PTR_MUTEX #if defined ZMQ_HAVE_VXWORKS mutable mutex_t sync; #else mutex_t sync; #endif #endif private: atomic_value_t &operator= (const atomic_value_t &src); }; } // Remove macros local to this file. #undef ZMQ_ATOMIC_PTR_MUTEX #undef ZMQ_ATOMIC_PTR_INTRINSIC #undef ZMQ_ATOMIC_PTR_CXX11 #undef ZMQ_ATOMIC_PTR_X86 #undef ZMQ_ATOMIC_PTR_ARM #undef ZMQ_ATOMIC_PTR_TILE #undef ZMQ_ATOMIC_PTR_WINDOWS #undef ZMQ_ATOMIC_PTR_ATOMIC_H #endif zeromq-4.2.5/src/dbuffer.hpp0000664000372000037200000000730213255253220016657 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DBUFFER_HPP_INCLUDED__ #define __ZMQ_DBUFFER_HPP_INCLUDED__ #include #include #include #include "mutex.hpp" #include "msg.hpp" namespace zmq { // dbuffer is a single-producer single-consumer double-buffer // implementation. // // The producer writes to a back buffer and then tries to swap // pointers between the back and front buffers. If it fails, // due to the consumer reading from the front buffer, it just // gives up, which is ok since writes are many and redundant. // // The reader simply reads from the front buffer. // // has_msg keeps track of whether there has been a not yet read // value written, it is used by ypipe_conflate to mimic ypipe // functionality regarding a reader being asleep template class dbuffer_t; template <> class dbuffer_t { public: inline dbuffer_t () : back (&storage[0]), front (&storage[1]), has_msg (false) { back->init (); front->init (); } inline ~dbuffer_t () { back->close (); front->close (); } inline void write (const msg_t &value_) { msg_t &xvalue = const_cast (value_); zmq_assert (xvalue.check ()); back->move (xvalue); // cannot just overwrite, might leak zmq_assert (back->check ()); if (sync.try_lock ()) { std::swap (back, front); has_msg = true; sync.unlock (); } } inline bool read (msg_t *value_) { if (!value_) return false; { scoped_lock_t lock (sync); if (!has_msg) return false; zmq_assert (front->check ()); *value_ = *front; front->init (); // avoid double free has_msg = false; return true; } } inline bool check_read () { scoped_lock_t lock (sync); return has_msg; } inline bool probe (bool (*fn) (const msg_t &)) { scoped_lock_t lock (sync); return (*fn) (*front); } private: msg_t storage[2]; msg_t *back, *front; mutex_t sync; bool has_msg; // Disable copying of dbuffer. dbuffer_t (const dbuffer_t &); const dbuffer_t &operator= (const dbuffer_t &); }; } #endif zeromq-4.2.5/src/tipc_listener.cpp0000664000372000037200000001503713255253220020105 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "tipc_listener.hpp" #if defined ZMQ_HAVE_TIPC #include #include #include "stream_engine.hpp" #include "tipc_address.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" #include "socket_base.hpp" #include #include #include #if defined ZMQ_HAVE_VXWORKS #include #include #else #include #endif zmq::tipc_listener_t::tipc_listener_t (io_thread_t *io_thread_, socket_base_t *socket_, const options_t &options_) : own_t (io_thread_, options_), io_object_t (io_thread_), s (retired_fd), socket (socket_) { } zmq::tipc_listener_t::~tipc_listener_t () { zmq_assert (s == retired_fd); } void zmq::tipc_listener_t::process_plug () { // Start polling for incoming connections. handle = add_fd (s); set_pollin (handle); } void zmq::tipc_listener_t::process_term (int linger_) { rm_fd (handle); close (); own_t::process_term (linger_); } void zmq::tipc_listener_t::in_event () { fd_t fd = accept (); // If connection was reset by the peer in the meantime, just ignore it. // TODO: Handle specific errors like ENFILE/EMFILE etc. if (fd == retired_fd) { socket->event_accept_failed (endpoint, zmq_errno ()); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); // Create and launch a session object. session_base_t *session = session_base_t::create (io_thread, false, socket, options, NULL); errno_assert (session); session->inc_seqnum (); launch_child (session); send_attach (session, engine, false); socket->event_accepted (endpoint, fd); } int zmq::tipc_listener_t::get_address (std::string &addr_) { struct sockaddr_storage ss; socklen_t sl = sizeof (ss); #ifdef ZMQ_HAVE_VXWORKS int rc = getsockname (s, (sockaddr *) &ss, (int *) &sl); #else int rc = getsockname (s, (sockaddr *) &ss, &sl); #endif if (rc != 0) { addr_.clear (); return rc; } tipc_address_t addr ((struct sockaddr *) &ss, sl); return addr.to_string (addr_); } int zmq::tipc_listener_t::set_address (const char *addr_) { // Convert str to address struct int rc = address.resolve (addr_); if (rc != 0) return -1; // Cannot bind non-random Port Identity struct sockaddr_tipc *a = (sockaddr_tipc *) address.addr (); if (!address.is_random () && a->addrtype == TIPC_ADDR_ID) { errno = EINVAL; return -1; } // Create a listening socket. s = open_socket (AF_TIPC, SOCK_STREAM, 0); if (s == -1) return -1; // If random Port Identity, update address object to reflect the assigned address if (address.is_random ()) { struct sockaddr_storage ss; #ifdef ZMQ_HAVE_VXWORKS int sl = sizeof (ss); #else socklen_t sl = sizeof (ss); #endif int rc = getsockname (s, (sockaddr *) &ss, &sl); if (rc != 0) goto error; tipc_address_t addr ((struct sockaddr *) &ss, sl); } address.to_string (endpoint); // Bind the socket to tipc name if (address.is_service ()) { #ifdef ZMQ_HAVE_VXWORKS rc = bind (s, (sockaddr *) address.addr (), address.addrlen ()); #else rc = bind (s, address.addr (), address.addrlen ()); #endif if (rc != 0) goto error; } // Listen for incoming connections. rc = listen (s, options.backlog); if (rc != 0) goto error; socket->event_listening (endpoint, s); return 0; error: int err = errno; close (); errno = err; return -1; } void zmq::tipc_listener_t::close () { zmq_assert (s != retired_fd); int rc = ::close (s); errno_assert (rc == 0); s = retired_fd; socket->event_closed (endpoint, s); } zmq::fd_t zmq::tipc_listener_t::accept () { // Accept one connection and deal with different failure modes. // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. struct sockaddr_storage ss = {}; socklen_t ss_len = sizeof (ss); zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_VXWORKS fd_t sock = ::accept (s, (struct sockaddr *) &ss, (int *) &ss_len); #else fd_t sock = ::accept (s, (struct sockaddr *) &ss, &ss_len); #endif if (sock == -1) { errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS || errno == EINTR || errno == ECONNABORTED || errno == EPROTO || errno == EMFILE || errno == ENFILE); return retired_fd; } /*FIXME Accept filters?*/ return sock; } #endif zeromq-4.2.5/src/fq.hpp0000664000372000037200000000550013255253220015646 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_FQ_HPP_INCLUDED__ #define __ZMQ_FQ_HPP_INCLUDED__ #include "array.hpp" #include "blob.hpp" #include "pipe.hpp" #include "msg.hpp" namespace zmq { // Class manages a set of inbound pipes. On receive it performs fair // queueing so that senders gone berserk won't cause denial of // service for decent senders. class fq_t { public: fq_t (); ~fq_t (); void attach (pipe_t *pipe_); void activated (pipe_t *pipe_); void pipe_terminated (pipe_t *pipe_); int recv (msg_t *msg_); int recvpipe (msg_t *msg_, pipe_t **pipe_); bool has_in (); const blob_t &get_credential () const; private: // Inbound pipes. typedef array_t pipes_t; pipes_t pipes; // Number of active pipes. All the active pipes are located at the // beginning of the pipes array. pipes_t::size_type active; // Pointer to the last pipe we received message from. // NULL when no message has been received or the pipe // has terminated. pipe_t *last_in; // Index of the next bound pipe to read a message from. pipes_t::size_type current; // If true, part of a multipart message was already received, but // there are following parts still waiting in the current pipe. bool more; // Holds credential after the last_active_pipe has terminated. blob_t saved_credential; fq_t (const fq_t &); const fq_t &operator= (const fq_t &); }; } #endif zeromq-4.2.5/src/xsub.cpp0000664000372000037200000001654713255253220016231 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "macros.hpp" #include "xsub.hpp" #include "err.hpp" zmq::xsub_t::xsub_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), has_message (false), more (false) { options.type = ZMQ_XSUB; // When socket is being closed down we don't want to wait till pending // subscription commands are sent to the wire. options.linger.store (0); int rc = message.init (); errno_assert (rc == 0); } zmq::xsub_t::~xsub_t () { int rc = message.close (); errno_assert (rc == 0); } void zmq::xsub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); fq.attach (pipe_); dist.attach (pipe_); // Send all the cached subscriptions to the new upstream peer. subscriptions.apply (send_subscription, pipe_); pipe_->flush (); } void zmq::xsub_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::xsub_t::xwrite_activated (pipe_t *pipe_) { dist.activated (pipe_); } void zmq::xsub_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); dist.pipe_terminated (pipe_); } void zmq::xsub_t::xhiccuped (pipe_t *pipe_) { // Send all the cached subscriptions to the hiccuped pipe. subscriptions.apply (send_subscription, pipe_); pipe_->flush (); } int zmq::xsub_t::xsend (msg_t *msg_) { size_t size = msg_->size (); unsigned char *data = (unsigned char *) msg_->data (); if (size > 0 && *data == 1) { // Process subscribe message // This used to filter out duplicate subscriptions, // however this is alread done on the XPUB side and // doing it here as well breaks ZMQ_XPUB_VERBOSE // when there are forwarding devices involved. subscriptions.add (data + 1, size - 1); return dist.send_to_all (msg_); } else if (size > 0 && *data == 0) { // Process unsubscribe message if (subscriptions.rm (data + 1, size - 1)) return dist.send_to_all (msg_); } else // User message sent upstream to XPUB socket return dist.send_to_all (msg_); int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return 0; } bool zmq::xsub_t::xhas_out () { // Subscription can be added/removed anytime. return true; } int zmq::xsub_t::xrecv (msg_t *msg_) { // If there's already a message prepared by a previous call to zmq_poll, // return it straight ahead. if (has_message) { int rc = msg_->move (message); errno_assert (rc == 0); has_message = false; more = msg_->flags () & msg_t::more ? true : false; return 0; } // TODO: This can result in infinite loop in the case of continuous // stream of non-matching messages which breaks the non-blocking recv // semantics. while (true) { // Get a message using fair queueing algorithm. int rc = fq.recv (msg_); // If there's no message available, return immediately. // The same when error occurs. if (rc != 0) return -1; // Check whether the message matches at least one subscription. // Non-initial parts of the message are passed if (more || !options.filter || match (msg_)) { more = msg_->flags () & msg_t::more ? true : false; return 0; } // Message doesn't match. Pop any remaining parts of the message // from the pipe. while (msg_->flags () & msg_t::more) { rc = fq.recv (msg_); errno_assert (rc == 0); } } } bool zmq::xsub_t::xhas_in () { // There are subsequent parts of the partly-read message available. if (more) return true; // If there's already a message prepared by a previous call to zmq_poll, // return straight ahead. if (has_message) return true; // TODO: This can result in infinite loop in the case of continuous // stream of non-matching messages. while (true) { // Get a message using fair queueing algorithm. int rc = fq.recv (&message); // If there's no message available, return immediately. // The same when error occurs. if (rc != 0) { errno_assert (errno == EAGAIN); return false; } // Check whether the message matches at least one subscription. if (!options.filter || match (&message)) { has_message = true; return true; } // Message doesn't match. Pop any remaining parts of the message // from the pipe. while (message.flags () & msg_t::more) { rc = fq.recv (&message); errno_assert (rc == 0); } } } const zmq::blob_t &zmq::xsub_t::get_credential () const { return fq.get_credential (); } bool zmq::xsub_t::match (msg_t *msg_) { bool matching = subscriptions.check ((unsigned char *) msg_->data (), msg_->size ()); return matching ^ options.invert_matching; } void zmq::xsub_t::send_subscription (unsigned char *data_, size_t size_, void *arg_) { pipe_t *pipe = (pipe_t *) arg_; // Create the subscription message. msg_t msg; int rc = msg.init_size (size_ + 1); errno_assert (rc == 0); unsigned char *data = (unsigned char *) msg.data (); data[0] = 1; // We explicitly allow a NULL subscription with size zero if (size_) { assert (data_); memcpy (data + 1, data_, size_); } // Send it to the pipe. bool sent = pipe->write (&msg); // If we reached the SNDHWM, and thus cannot send the subscription, drop // the subscription message instead. This matches the behaviour of // zmq_setsockopt(ZMQ_SUBSCRIBE, ...), which also drops subscriptions // when the SNDHWM is reached. if (!sent) msg.close (); } zeromq-4.2.5/src/io_object.cpp0000664000372000037200000000574113255253220017177 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "io_object.hpp" #include "io_thread.hpp" #include "err.hpp" zmq::io_object_t::io_object_t (io_thread_t *io_thread_) : poller (NULL) { if (io_thread_) plug (io_thread_); } zmq::io_object_t::~io_object_t () { } void zmq::io_object_t::plug (io_thread_t *io_thread_) { zmq_assert (io_thread_); zmq_assert (!poller); // Retrieve the poller from the thread we are running in. poller = io_thread_->get_poller (); } void zmq::io_object_t::unplug () { zmq_assert (poller); // Forget about old poller in preparation to be migrated // to a different I/O thread. poller = NULL; } zmq::io_object_t::handle_t zmq::io_object_t::add_fd (fd_t fd_) { return poller->add_fd (fd_, this); } void zmq::io_object_t::rm_fd (handle_t handle_) { poller->rm_fd (handle_); } void zmq::io_object_t::set_pollin (handle_t handle_) { poller->set_pollin (handle_); } void zmq::io_object_t::reset_pollin (handle_t handle_) { poller->reset_pollin (handle_); } void zmq::io_object_t::set_pollout (handle_t handle_) { poller->set_pollout (handle_); } void zmq::io_object_t::reset_pollout (handle_t handle_) { poller->reset_pollout (handle_); } void zmq::io_object_t::add_timer (int timeout_, int id_) { poller->add_timer (timeout_, this, id_); } void zmq::io_object_t::cancel_timer (int id_) { poller->cancel_timer (this, id_); } void zmq::io_object_t::in_event () { zmq_assert (false); } void zmq::io_object_t::out_event () { zmq_assert (false); } void zmq::io_object_t::timer_event (int) { zmq_assert (false); } zeromq-4.2.5/src/mechanism_base.cpp0000664000372000037200000000522413255253220020174 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "mechanism_base.hpp" #include "session_base.hpp" zmq::mechanism_base_t::mechanism_base_t (session_base_t *const session_, const options_t &options_) : mechanism_t (options_), session (session_) { } int zmq::mechanism_base_t::check_basic_command_structure (msg_t *msg_) { if (msg_->size () <= 1 || msg_->size () <= ((uint8_t *) msg_->data ())[0]) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED); errno = EPROTO; return -1; } return 0; } void zmq::mechanism_base_t::handle_error_reason (const char *error_reason, size_t error_reason_len) { if (error_reason_len == 3 && error_reason[1] == '0' && error_reason[2] == '0' && error_reason[0] >= '3' && error_reason[0] <= '5') { // it is a ZAP status code, so emit an authentication failure event session->get_socket ()->event_handshake_failed_auth ( session->get_endpoint (), (error_reason[0] - '0') * 100); } } bool zmq::mechanism_base_t::zap_required () const { return !options.zap_domain.empty (); } zeromq-4.2.5/src/gssapi_server.cpp0000664000372000037200000001600713255253220020113 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #ifdef HAVE_LIBGSSAPI_KRB5 #include #include #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "gssapi_server.hpp" #include "wire.hpp" #include zmq::gssapi_server_t::gssapi_server_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_) : mechanism_base_t (session_, options_), gssapi_mechanism_base_t (session_, options_), zap_client_t (session_, peer_address_, options_), session (session_), peer_address (peer_address_), state (recv_next_token), security_context_established (false) { maj_stat = GSS_S_CONTINUE_NEEDED; if (!options_.gss_principal.empty ()) { const std::string::size_type principal_size = options_.gss_principal.size (); principal_name = static_cast (malloc (principal_size + 1)); assert (principal_name); memcpy (principal_name, options_.gss_principal.c_str (), principal_size + 1); gss_OID name_type = convert_nametype (options_.gss_principal_nt); if (acquire_credentials (principal_name, &cred, name_type) != 0) maj_stat = GSS_S_FAILURE; } } zmq::gssapi_server_t::~gssapi_server_t () { if (cred) gss_release_cred (&min_stat, &cred); if (target_name) gss_release_name (&min_stat, &target_name); } int zmq::gssapi_server_t::next_handshake_command (msg_t *msg_) { if (state == send_ready) { int rc = produce_ready (msg_); if (rc == 0) state = recv_ready; return rc; } if (state != send_next_token) { errno = EAGAIN; return -1; } if (produce_next_token (msg_) < 0) return -1; if (maj_stat != GSS_S_CONTINUE_NEEDED && maj_stat != GSS_S_COMPLETE) return -1; if (maj_stat == GSS_S_COMPLETE) { security_context_established = true; } state = recv_next_token; return 0; } int zmq::gssapi_server_t::process_handshake_command (msg_t *msg_) { if (state == recv_ready) { int rc = process_ready (msg_); if (rc == 0) state = connected; return rc; } if (state != recv_next_token) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (security_context_established) { // Use ZAP protocol (RFC 27) to authenticate the user. // Note that rc will be -1 only if ZAP is not set up, but if it was // requested and it does not work properly the program will abort. bool expecting_zap_reply = false; int rc = session->zap_connect (); if (rc == 0) { send_zap_request (); rc = receive_and_process_zap_reply (); if (rc != 0) { if (rc == -1) return -1; expecting_zap_reply = true; } } state = expecting_zap_reply ? expect_zap_reply : send_ready; return 0; } if (process_next_token (msg_) < 0) return -1; accept_context (); state = send_next_token; errno_assert (msg_->close () == 0); errno_assert (msg_->init () == 0); return 0; } void zmq::gssapi_server_t::send_zap_request () { gss_buffer_desc principal; gss_display_name (&min_stat, target_name, &principal, NULL); zap_client_t::send_zap_request ( "GSSAPI", 6, reinterpret_cast (principal.value), principal.length); gss_release_buffer (&min_stat, &principal); } int zmq::gssapi_server_t::encode (msg_t *msg_) { zmq_assert (state == connected); if (do_encryption) return encode_message (msg_); return 0; } int zmq::gssapi_server_t::decode (msg_t *msg_) { zmq_assert (state == connected); if (do_encryption) return decode_message (msg_); return 0; } int zmq::gssapi_server_t::zap_msg_available () { if (state != expect_zap_reply) { errno = EFSM; return -1; } const int rc = receive_and_process_zap_reply (); if (rc == 0) state = send_ready; return rc == -1 ? -1 : 0; } zmq::mechanism_t::status_t zmq::gssapi_server_t::status () const { return state == connected ? mechanism_t::ready : mechanism_t::handshaking; } int zmq::gssapi_server_t::produce_next_token (msg_t *msg_) { if (send_tok.length != 0) { // Client expects another token if (produce_initiate (msg_, send_tok.value, send_tok.length) < 0) return -1; gss_release_buffer (&min_stat, &send_tok); } if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED) { gss_release_name (&min_stat, &target_name); if (context != GSS_C_NO_CONTEXT) gss_delete_sec_context (&min_stat, &context, GSS_C_NO_BUFFER); return -1; } return 0; } int zmq::gssapi_server_t::process_next_token (msg_t *msg_) { if (maj_stat == GSS_S_CONTINUE_NEEDED) { if (process_initiate (msg_, &recv_tok.value, recv_tok.length) < 0) { if (target_name != GSS_C_NO_NAME) gss_release_name (&min_stat, &target_name); return -1; } } return 0; } void zmq::gssapi_server_t::accept_context () { maj_stat = gss_accept_sec_context ( &init_sec_min_stat, &context, cred, &recv_tok, GSS_C_NO_CHANNEL_BINDINGS, &target_name, &doid, &send_tok, &ret_flags, NULL, NULL); if (recv_tok.value) { free (recv_tok.value); recv_tok.value = NULL; } } #endif zeromq-4.2.5/src/poll.cpp0000664000372000037200000001314713255253220016207 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "poll.hpp" #if defined ZMQ_USE_POLL #include #if !defined ZMQ_HAVE_WINDOWS #include #include #endif #include #include "poll.hpp" #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" zmq::poll_t::poll_t (const zmq::thread_ctx_t &ctx_) : worker_poller_base_t (ctx_), retired (false) { } zmq::poll_t::~poll_t () { stop_worker (); } zmq::poll_t::handle_t zmq::poll_t::add_fd (fd_t fd_, i_poll_events *events_) { check_thread (); zmq_assert (fd_ != retired_fd); // If the file descriptor table is too small expand it. fd_table_t::size_type sz = fd_table.size (); if (sz <= (fd_table_t::size_type) fd_) { fd_table.resize (fd_ + 1); while (sz != (fd_table_t::size_type) (fd_ + 1)) { fd_table[sz].index = retired_fd; ++sz; } } pollfd pfd = {fd_, 0, 0}; pollset.push_back (pfd); zmq_assert (fd_table[fd_].index == retired_fd); fd_table[fd_].index = pollset.size () - 1; fd_table[fd_].events = events_; // Increase the load metric of the thread. adjust_load (1); return fd_; } void zmq::poll_t::rm_fd (handle_t handle_) { check_thread (); fd_t index = fd_table[handle_].index; zmq_assert (index != retired_fd); // Mark the fd as unused. pollset[index].fd = retired_fd; fd_table[handle_].index = retired_fd; retired = true; // Decrease the load metric of the thread. adjust_load (-1); } void zmq::poll_t::set_pollin (handle_t handle_) { check_thread (); fd_t index = fd_table[handle_].index; pollset[index].events |= POLLIN; } void zmq::poll_t::reset_pollin (handle_t handle_) { check_thread (); fd_t index = fd_table[handle_].index; pollset[index].events &= ~((short) POLLIN); } void zmq::poll_t::set_pollout (handle_t handle_) { check_thread (); fd_t index = fd_table[handle_].index; pollset[index].events |= POLLOUT; } void zmq::poll_t::reset_pollout (handle_t handle_) { check_thread (); fd_t index = fd_table[handle_].index; pollset[index].events &= ~((short) POLLOUT); } void zmq::poll_t::stop () { check_thread (); // no-op... thread is stopped when no more fds or timers are registered } int zmq::poll_t::max_fds () { return -1; } void zmq::poll_t::loop () { while (true) { // Execute any due timers. int timeout = (int) execute_timers (); cleanup_retired (); if (pollset.empty ()) { zmq_assert (get_load () == 0); if (timeout == 0) break; // TODO sleep for timeout continue; } // Wait for events. int rc = poll (&pollset[0], pollset.size (), timeout ? timeout : -1); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else if (rc == -1) { errno_assert (errno == EINTR); continue; } #endif // If there are no events (i.e. it's a timeout) there's no point // in checking the pollset. if (rc == 0) continue; for (pollset_t::size_type i = 0; i != pollset.size (); i++) { zmq_assert (!(pollset[i].revents & POLLNVAL)); if (pollset[i].fd == retired_fd) continue; if (pollset[i].revents & (POLLERR | POLLHUP)) fd_table[pollset[i].fd].events->in_event (); if (pollset[i].fd == retired_fd) continue; if (pollset[i].revents & POLLOUT) fd_table[pollset[i].fd].events->out_event (); if (pollset[i].fd == retired_fd) continue; if (pollset[i].revents & POLLIN) fd_table[pollset[i].fd].events->in_event (); } } } void zmq::poll_t::cleanup_retired () { // Clean up the pollset and update the fd_table accordingly. if (retired) { pollset_t::size_type i = 0; while (i < pollset.size ()) { if (pollset[i].fd == retired_fd) pollset.erase (pollset.begin () + i); else { fd_table[pollset[i].fd].index = i; i++; } } retired = false; } } #endif zeromq-4.2.5/src/pgm_sender.hpp0000664000372000037200000000660613255253220017373 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PGM_SENDER_HPP_INCLUDED__ #define __ZMQ_PGM_SENDER_HPP_INCLUDED__ #if defined ZMQ_HAVE_OPENPGM #include "stdint.hpp" #include "io_object.hpp" #include "i_engine.hpp" #include "options.hpp" #include "pgm_socket.hpp" #include "v1_encoder.hpp" #include "msg.hpp" namespace zmq { class io_thread_t; class session_base_t; class pgm_sender_t : public io_object_t, public i_engine { public: pgm_sender_t (zmq::io_thread_t *parent_, const options_t &options_); ~pgm_sender_t (); int init (bool udp_encapsulation_, const char *network_); // i_engine interface implementation. void plug (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_); void terminate (); void restart_input (); void restart_output (); void zap_msg_available () {} const char *get_endpoint () const; // i_poll_events interface implementation. void in_event (); void out_event (); void timer_event (int token); private: // Unplug the engine from the session. void unplug (); // TX and RX timeout timer ID's. enum { tx_timer_id = 0xa0, rx_timer_id = 0xa1 }; // Timers are running. bool has_tx_timer; bool has_rx_timer; session_base_t *session; // Message encoder. v1_encoder_t encoder; msg_t msg; // Keeps track of message boundaries. bool more_flag; // PGM socket. pgm_socket_t pgm_socket; // Socket options. options_t options; // Poll handle associated with PGM socket. handle_t handle; handle_t uplink_handle; handle_t rdata_notify_handle; handle_t pending_notify_handle; // Output buffer from pgm_socket. unsigned char *out_buffer; // Output buffer size. size_t out_buffer_size; // Number of bytes in the buffer to be written to the socket. // If zero, there are no data to be sent. size_t write_size; pgm_sender_t (const pgm_sender_t &); const pgm_sender_t &operator= (const pgm_sender_t &); }; } #endif #endif zeromq-4.2.5/src/zap_client.hpp0000664000372000037200000000641113255253220017372 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ZAP_CLIENT_HPP_INCLUDED__ #define __ZMQ_ZAP_CLIENT_HPP_INCLUDED__ #include "mechanism_base.hpp" namespace zmq { class zap_client_t : public virtual mechanism_base_t { public: zap_client_t (session_base_t *const session_, const std::string &peer_address_, const options_t &options_); void send_zap_request (const char *mechanism, size_t mechanism_length, const uint8_t *credentials, size_t credentials_size); void send_zap_request (const char *mechanism, size_t mechanism_length, const uint8_t **credentials, size_t *credentials_sizes, size_t credentials_count); virtual int receive_and_process_zap_reply (); virtual void handle_zap_status_code (); protected: const std::string peer_address; // Status code as received from ZAP handler std::string status_code; }; class zap_client_common_handshake_t : public zap_client_t { protected: enum state_t { waiting_for_hello, sending_welcome, waiting_for_initiate, waiting_for_zap_reply, sending_ready, sending_error, error_sent, ready }; zap_client_common_handshake_t (session_base_t *const session_, const std::string &peer_address_, const options_t &options_, state_t zap_reply_ok_state); // methods from mechanism_t status_t status () const; int zap_msg_available (); // zap_client_t methods int receive_and_process_zap_reply (); void handle_zap_status_code (); // Current FSM state state_t state; private: const state_t zap_reply_ok_state; }; } #endif zeromq-4.2.5/src/gssapi_mechanism_base.hpp0000664000372000037200000001062513255253220021550 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GSSAPI_MECHANISM_BASE_HPP_INCLUDED__ #define __ZMQ_GSSAPI_MECHANISM_BASE_HPP_INCLUDED__ #ifdef HAVE_LIBGSSAPI_KRB5 #if HAVE_GSSAPI_GSSAPI_GENERIC_H #include #endif #include #include "mechanism_base.hpp" #include "options.hpp" namespace zmq { class msg_t; /// Commonalities between clients and servers are captured here. /// For example, clients and servers both need to produce and /// process context-level GSSAPI tokens (via INITIATE commands) /// and per-message GSSAPI tokens (via MESSAGE commands). class gssapi_mechanism_base_t : public virtual mechanism_base_t { public: gssapi_mechanism_base_t (session_base_t *session_, const options_t &options_); virtual ~gssapi_mechanism_base_t () = 0; protected: // Produce a context-level GSSAPI token (INITIATE command) // during security context initialization. int produce_initiate (msg_t *msg_, void *data_, size_t data_len_); // Process a context-level GSSAPI token (INITIATE command) // during security context initialization. int process_initiate (msg_t *msg_, void **data_, size_t &data_len_); // Produce a metadata ready msg (READY) to conclude handshake int produce_ready (msg_t *msg_); // Process a metadata ready msg (READY) int process_ready (msg_t *msg_); // Encode a per-message GSSAPI token (MESSAGE command) using // the established security context. int encode_message (msg_t *msg_); // Decode a per-message GSSAPI token (MESSAGE command) using // the established security context. int decode_message (msg_t *msg_); // Convert ZMQ_GSSAPI_NT values to GSSAPI name_type static const gss_OID convert_nametype (int zmq_name_type_); // Acquire security context credentials from the // underlying mechanism. static int acquire_credentials (char *principal_name_, gss_cred_id_t *cred_, gss_OID name_type_); protected: // Opaque GSSAPI token for outgoing data gss_buffer_desc send_tok; // Opaque GSSAPI token for incoming data gss_buffer_desc recv_tok; // Opaque GSSAPI representation of principal gss_name_t target_name; // Human-readable principal name char *principal_name; // Status code returned by GSSAPI functions OM_uint32 maj_stat; // Status code returned by the underlying mechanism OM_uint32 min_stat; // Status code returned by the underlying mechanism // during context initialization OM_uint32 init_sec_min_stat; // Flags returned by GSSAPI (ignored) OM_uint32 ret_flags; // Flags returned by GSSAPI (ignored) OM_uint32 gss_flags; // Credentials used to establish security context gss_cred_id_t cred; // Opaque GSSAPI representation of the security context gss_ctx_id_t context; // If true, use gss to encrypt messages. If false, only utilize gss for auth. bool do_encryption; }; } #endif #endif zeromq-4.2.5/src/tipc_connecter.cpp0000664000372000037200000001765613255253220020251 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "tipc_connecter.hpp" #if defined ZMQ_HAVE_TIPC #include #include #include "stream_engine.hpp" #include "io_thread.hpp" #include "platform.hpp" #include "random.hpp" #include "err.hpp" #include "ip.hpp" #include "address.hpp" #include "tipc_address.hpp" #include "session_base.hpp" #include #include #include #ifdef ZMQ_HAVE_VXWORKS #include #endif zmq::tipc_connecter_t::tipc_connecter_t (class io_thread_t *io_thread_, class session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_) : own_t (io_thread_, options_), io_object_t (io_thread_), addr (addr_), s (retired_fd), handle_valid (false), delayed_start (delayed_start_), timer_started (false), session (session_), current_reconnect_ivl (options.reconnect_ivl) { zmq_assert (addr); zmq_assert (addr->protocol == "tipc"); addr->to_string (endpoint); socket = session->get_socket (); } zmq::tipc_connecter_t::~tipc_connecter_t () { zmq_assert (!timer_started); zmq_assert (!handle_valid); zmq_assert (s == retired_fd); } void zmq::tipc_connecter_t::process_plug () { if (delayed_start) add_reconnect_timer (); else start_connecting (); } void zmq::tipc_connecter_t::process_term (int linger_) { if (timer_started) { cancel_timer (reconnect_timer_id); timer_started = false; } if (handle_valid) { rm_fd (handle); handle_valid = false; } if (s != retired_fd) close (); own_t::process_term (linger_); } void zmq::tipc_connecter_t::in_event () { // We are not polling for incoming data, so we are actually called // because of error here. However, we can get error on out event as well // on some platforms, so we'll simply handle both events in the same way. out_event (); } void zmq::tipc_connecter_t::out_event () { fd_t fd = connect (); rm_fd (handle); handle_valid = false; // Handle the error condition by attempt to reconnect. if (fd == retired_fd) { close (); add_reconnect_timer (); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Attach the engine to the corresponding session object. send_attach (session, engine); // Shut the connecter down. terminate (); socket->event_connected (endpoint, fd); } void zmq::tipc_connecter_t::timer_event (int id_) { zmq_assert (id_ == reconnect_timer_id); timer_started = false; start_connecting (); } void zmq::tipc_connecter_t::start_connecting () { // Open the connecting socket. int rc = open (); // Connect may succeed in synchronous manner. if (rc == 0) { handle = add_fd (s); handle_valid = true; out_event (); } // Connection establishment may be delayed. Poll for its completion. else if (rc == -1 && errno == EINPROGRESS) { handle = add_fd (s); handle_valid = true; set_pollout (handle); socket->event_connect_delayed (endpoint, zmq_errno ()); } // Handle any other error condition by eventual reconnect. else { if (s != retired_fd) close (); add_reconnect_timer (); } } void zmq::tipc_connecter_t::add_reconnect_timer () { int rc_ivl = get_new_reconnect_ivl (); add_timer (rc_ivl, reconnect_timer_id); socket->event_connect_retried (endpoint, rc_ivl); timer_started = true; } int zmq::tipc_connecter_t::get_new_reconnect_ivl () { // The new interval is the current interval + random value. int this_interval = current_reconnect_ivl + (generate_random () % options.reconnect_ivl); // Only change the current reconnect interval if the maximum reconnect // interval was set and if it's larger than the reconnect interval. if (options.reconnect_ivl_max > 0 && options.reconnect_ivl_max > options.reconnect_ivl) { // Calculate the next interval current_reconnect_ivl = current_reconnect_ivl * 2; if (current_reconnect_ivl >= options.reconnect_ivl_max) { current_reconnect_ivl = options.reconnect_ivl_max; } } return this_interval; } int zmq::tipc_connecter_t::open () { zmq_assert (s == retired_fd); // Cannot connect to random tipc addresses if (addr->resolved.tipc_addr->is_random ()) { errno = EINVAL; return -1; } // Create the socket. s = open_socket (AF_TIPC, SOCK_STREAM, 0); if (s == -1) return -1; // Set the non-blocking flag. unblock_socket (s); // Connect to the remote peer. #ifdef ZMQ_HAVE_VXWORKS int rc = ::connect (s, (sockaddr *) addr->resolved.tipc_addr->addr (), addr->resolved.tipc_addr->addrlen ()); #else int rc = ::connect (s, addr->resolved.tipc_addr->addr (), addr->resolved.tipc_addr->addrlen ()); #endif // Connect was successful immediately. if (rc == 0) return 0; // Translate other error codes indicating asynchronous connect has been // launched to a uniform EINPROGRESS. if (rc == -1 && errno == EINTR) { errno = EINPROGRESS; return -1; } // Forward the error. return -1; } void zmq::tipc_connecter_t::close () { zmq_assert (s != retired_fd); int rc = ::close (s); errno_assert (rc == 0); socket->event_closed (endpoint, s); s = retired_fd; } zmq::fd_t zmq::tipc_connecter_t::connect () { // Following code should handle both Berkeley-derived socket // implementations and Solaris. int err = 0; #if ZMQ_HAVE_VXWORKS int len = sizeof (err); #else socklen_t len = sizeof (err); #endif int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &err, &len); if (rc == -1) err = errno; if (err != 0) { // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. errno = err; errno_assert (errno == ECONNREFUSED || errno == ECONNRESET || errno == ETIMEDOUT || errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN); return retired_fd; } fd_t result = s; s = retired_fd; return result; } #endif zeromq-4.2.5/src/decoder_allocators.cpp0000664000372000037200000001125713255253220021071 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "decoder_allocators.hpp" #include #include "msg.hpp" zmq::shared_message_memory_allocator::shared_message_memory_allocator ( std::size_t bufsize_) : buf (NULL), bufsize (0), max_size (bufsize_), msg_content (NULL), maxCounters (static_cast ( std::ceil (static_cast (max_size) / static_cast (msg_t::max_vsm_size)))) { } zmq::shared_message_memory_allocator::shared_message_memory_allocator ( std::size_t bufsize_, std::size_t maxMessages) : buf (NULL), bufsize (0), max_size (bufsize_), msg_content (NULL), maxCounters (maxMessages) { } zmq::shared_message_memory_allocator::~shared_message_memory_allocator () { deallocate (); } unsigned char *zmq::shared_message_memory_allocator::allocate () { if (buf) { // release reference count to couple lifetime to messages zmq::atomic_counter_t *c = reinterpret_cast (buf); // if refcnt drops to 0, there are no message using the buffer // because either all messages have been closed or only vsm-messages // were created if (c->sub (1)) { // buffer is still in use as message data. "Release" it and create a new one // release pointer because we are going to create a new buffer release (); } } // if buf != NULL it is not used by any message so we can re-use it for the next run if (!buf) { // allocate memory for reference counters together with reception buffer std::size_t const allocationsize = max_size + sizeof (zmq::atomic_counter_t) + maxCounters * sizeof (zmq::msg_t::content_t); buf = static_cast (std::malloc (allocationsize)); alloc_assert (buf); new (buf) atomic_counter_t (1); } else { // release reference count to couple lifetime to messages zmq::atomic_counter_t *c = reinterpret_cast (buf); c->set (1); } bufsize = max_size; msg_content = reinterpret_cast ( buf + sizeof (atomic_counter_t) + max_size); return buf + sizeof (zmq::atomic_counter_t); } void zmq::shared_message_memory_allocator::deallocate () { zmq::atomic_counter_t *c = reinterpret_cast (buf); if (buf && !c->sub (1)) { std::free (buf); } release (); } unsigned char *zmq::shared_message_memory_allocator::release () { unsigned char *b = buf; buf = NULL; bufsize = 0; msg_content = NULL; return b; } void zmq::shared_message_memory_allocator::inc_ref () { (reinterpret_cast (buf))->add (1); } void zmq::shared_message_memory_allocator::call_dec_ref (void *, void *hint) { zmq_assert (hint); unsigned char *buf = static_cast (hint); zmq::atomic_counter_t *c = reinterpret_cast (buf); if (!c->sub (1)) { c->~atomic_counter_t (); std::free (buf); buf = NULL; } } std::size_t zmq::shared_message_memory_allocator::size () const { return bufsize; } unsigned char *zmq::shared_message_memory_allocator::data () { return buf + sizeof (zmq::atomic_counter_t); } zeromq-4.2.5/src/lb.cpp0000664000372000037200000001104513255253220015631 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "lb.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::lb_t::lb_t () : active (0), current (0), more (false), dropping (false) { } zmq::lb_t::~lb_t () { zmq_assert (pipes.empty ()); } void zmq::lb_t::attach (pipe_t *pipe_) { pipes.push_back (pipe_); activated (pipe_); } void zmq::lb_t::pipe_terminated (pipe_t *pipe_) { pipes_t::size_type index = pipes.index (pipe_); // If we are in the middle of multipart message and current pipe // have disconnected, we have to drop the remainder of the message. if (index == current && more) dropping = true; // Remove the pipe from the list; adjust number of active pipes // accordingly. if (index < active) { active--; pipes.swap (index, active); if (current == active) current = 0; } pipes.erase (pipe_); } void zmq::lb_t::activated (pipe_t *pipe_) { // Move the pipe to the list of active pipes. pipes.swap (pipes.index (pipe_), active); active++; } int zmq::lb_t::send (msg_t *msg_) { return sendpipe (msg_, NULL); } int zmq::lb_t::sendpipe (msg_t *msg_, pipe_t **pipe_) { // Drop the message if required. If we are at the end of the message // switch back to non-dropping mode. if (dropping) { more = msg_->flags () & msg_t::more ? true : false; dropping = more; int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return 0; } while (active > 0) { if (pipes[current]->write (msg_)) { if (pipe_) *pipe_ = pipes[current]; break; } // If send fails for multi-part msg rollback other // parts sent earlier and return EAGAIN. // Application should handle this as suitable if (more) { pipes[current]->rollback (); more = 0; errno = EAGAIN; return -1; } active--; if (current < active) pipes.swap (current, active); else current = 0; } // If there are no pipes we cannot send the message. if (active == 0) { errno = EAGAIN; return -1; } // If it's final part of the message we can flush it downstream and // continue round-robining (load balance). more = msg_->flags () & msg_t::more ? true : false; if (!more) { pipes[current]->flush (); if (++current >= active) current = 0; } // Detach the message from the data buffer. int rc = msg_->init (); errno_assert (rc == 0); return 0; } bool zmq::lb_t::has_out () { // If one part of the message was already written we can definitely // write the rest of the message. if (more) return true; while (active > 0) { // Check whether a pipe has room for another message. if (pipes[current]->check_write ()) return true; // Deactivate the pipe. active--; pipes.swap (current, active); if (current == active) current = 0; } return false; } zeromq-4.2.5/src/ipc_address.cpp0000664000372000037200000000611713255253220017520 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "ipc_address.hpp" #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include "err.hpp" #include #include zmq::ipc_address_t::ipc_address_t () { memset (&address, 0, sizeof address); } zmq::ipc_address_t::ipc_address_t (const sockaddr *sa, socklen_t sa_len) { zmq_assert (sa && sa_len > 0); memset (&address, 0, sizeof address); if (sa->sa_family == AF_UNIX) memcpy (&address, sa, sa_len); } zmq::ipc_address_t::~ipc_address_t () { } int zmq::ipc_address_t::resolve (const char *path_) { if (strlen (path_) >= sizeof address.sun_path) { errno = ENAMETOOLONG; return -1; } if (path_[0] == '@' && !path_[1]) { errno = EINVAL; return -1; } address.sun_family = AF_UNIX; strcpy (address.sun_path, path_); /* Abstract sockets start with '\0' */ if (path_[0] == '@') *address.sun_path = '\0'; return 0; } int zmq::ipc_address_t::to_string (std::string &addr_) { if (address.sun_family != AF_UNIX) { addr_.clear (); return -1; } std::stringstream s; s << "ipc://"; if (!address.sun_path[0] && address.sun_path[1]) s << "@" << address.sun_path + 1; else s << address.sun_path; addr_ = s.str (); return 0; } const sockaddr *zmq::ipc_address_t::addr () const { return (sockaddr *) &address; } socklen_t zmq::ipc_address_t::addrlen () const { if (!address.sun_path[0] && address.sun_path[1]) return (socklen_t) strlen (address.sun_path + 1) + sizeof (sa_family_t) + 1; return (socklen_t) sizeof address; } #endif zeromq-4.2.5/src/pollset.cpp0000664000372000037200000001461613255253220016725 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "pollset.hpp" #if defined ZMQ_USE_POLLSET #include #include #include #include #include #include "macros.hpp" #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" zmq::pollset_t::pollset_t (const zmq::thread_ctx_t &ctx_) : ctx (ctx_), stopping (false) { pollset_fd = pollset_create (-1); errno_assert (pollset_fd != -1); } zmq::pollset_t::~pollset_t () { // Wait till the worker thread exits. worker.stop (); pollset_destroy (pollset_fd); for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it) LIBZMQ_DELETE (*it); } zmq::pollset_t::handle_t zmq::pollset_t::add_fd (fd_t fd_, i_poll_events *events_) { poll_entry_t *pe = new (std::nothrow) poll_entry_t; alloc_assert (pe); pe->fd = fd_; pe->flag_pollin = false; pe->flag_pollout = false; pe->events = events_; struct poll_ctl pc; pc.fd = fd_; pc.cmd = PS_ADD; pc.events = 0; int rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); // Increase the load metric of the thread. adjust_load (1); if (fd_ >= fd_table.size ()) { fd_table.resize (fd_ + 1, NULL); } fd_table[fd_] = pe; return pe; } void zmq::pollset_t::rm_fd (handle_t handle_) { poll_entry_t *pe = (poll_entry_t *) handle_; struct poll_ctl pc; pc.fd = pe->fd; pc.cmd = PS_DELETE; pc.events = 0; pollset_ctl (pollset_fd, &pc, 1); fd_table[pe->fd] = NULL; pe->fd = retired_fd; retired.push_back (pe); // Decrease the load metric of the thread. adjust_load (-1); } void zmq::pollset_t::set_pollin (handle_t handle_) { poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (!pe->flag_pollin)) { struct poll_ctl pc; pc.fd = pe->fd; pc.cmd = PS_MOD; pc.events = POLLIN; const int rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); pe->flag_pollin = true; } } void zmq::pollset_t::reset_pollin (handle_t handle_) { poll_entry_t *pe = (poll_entry_t *) handle_; if (unlikely (!pe->flag_pollin)) { return; } struct poll_ctl pc; pc.fd = pe->fd; pc.events = 0; pc.cmd = PS_DELETE; int rc = pollset_ctl (pollset_fd, &pc, 1); if (pe->flag_pollout) { pc.events = POLLOUT; pc.cmd = PS_MOD; rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); } pe->flag_pollin = false; } void zmq::pollset_t::set_pollout (handle_t handle_) { poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (!pe->flag_pollout)) { struct poll_ctl pc; pc.fd = pe->fd; pc.cmd = PS_MOD; pc.events = POLLOUT; const int rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); pe->flag_pollout = true; } } void zmq::pollset_t::reset_pollout (handle_t handle_) { poll_entry_t *pe = (poll_entry_t *) handle_; if (unlikely (!pe->flag_pollout)) { return; } struct poll_ctl pc; pc.fd = pe->fd; pc.events = 0; pc.cmd = PS_DELETE; int rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); if (pe->flag_pollin) { pc.cmd = PS_MOD; pc.events = POLLIN; rc = pollset_ctl (pollset_fd, &pc, 1); errno_assert (rc != -1); } pe->flag_pollout = false; } void zmq::pollset_t::start () { ctx.start_thread (worker, worker_routine, this); } void zmq::pollset_t::stop () { stopping = true; } int zmq::pollset_t::max_fds () { return -1; } void zmq::pollset_t::loop () { struct pollfd polldata_array[max_io_events]; while (!stopping) { // Execute any due timers. int timeout = (int) execute_timers (); // Wait for events. int n = pollset_poll (pollset_fd, polldata_array, max_io_events, timeout ? timeout : -1); if (n == -1) { errno_assert (errno == EINTR); continue; } for (int i = 0; i < n; i++) { poll_entry_t *pe = fd_table[polldata_array[i].fd]; if (!pe) continue; if (pe->fd == retired_fd) continue; if (polldata_array[i].revents & (POLLERR | POLLHUP)) pe->events->in_event (); if (pe->fd == retired_fd) continue; if (polldata_array[i].revents & POLLOUT) pe->events->out_event (); if (pe->fd == retired_fd) continue; if (polldata_array[i].revents & POLLIN) pe->events->in_event (); } // Destroy retired event sources. for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it) LIBZMQ_DELETE (*it); retired.clear (); } } void zmq::pollset_t::worker_routine (void *arg_) { ((pollset_t *) arg_)->loop (); } #endif zeromq-4.2.5/src/vmci_address.cpp0000664000372000037200000001077113255253220017704 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "vmci_address.hpp" #if defined(ZMQ_HAVE_VMCI) #include #include #include #include "err.hpp" zmq::vmci_address_t::vmci_address_t (ctx_t *parent_) : parent (parent_) { memset (&address, 0, sizeof address); } zmq::vmci_address_t::vmci_address_t (const sockaddr *sa, socklen_t sa_len, ctx_t *parent_) : parent (parent_) { zmq_assert (sa && sa_len > 0); memset (&address, 0, sizeof address); if (sa->sa_family == parent->get_vmci_socket_family ()) memcpy (&address, sa, sa_len); } zmq::vmci_address_t::~vmci_address_t () { } int zmq::vmci_address_t::resolve (const char *path_) { // Find the ':' at end that separates address from the port number. const char *delimiter = strrchr (path_, ':'); if (!delimiter) { errno = EINVAL; return -1; } // Separate the address/port. std::string addr_str (path_, delimiter - path_); std::string port_str (delimiter + 1); unsigned int cid = VMADDR_CID_ANY; unsigned int port = VMADDR_PORT_ANY; if (!addr_str.length ()) { errno = EINVAL; return -1; } else if (addr_str == "@") { cid = VMCISock_GetLocalCID (); if (cid == VMADDR_CID_ANY) { errno = ENODEV; return -1; } } else if (addr_str != "*" && addr_str != "-1") { const char *begin = addr_str.c_str (); char *end = NULL; unsigned long l = strtoul (begin, &end, 10); if ((l == 0 && end == begin) || (l == ULONG_MAX && errno == ERANGE) || l > UINT_MAX) { errno = EINVAL; return -1; } cid = static_cast (l); } if (!port_str.length ()) { errno = EINVAL; return -1; } else if (port_str != "*" && port_str != "-1") { const char *begin = port_str.c_str (); char *end = NULL; unsigned long l = strtoul (begin, &end, 10); if ((l == 0 && end == begin) || (l == ULONG_MAX && errno == ERANGE) || l > UINT_MAX) { errno = EINVAL; return -1; } port = static_cast (l); } address.svm_family = static_cast (parent->get_vmci_socket_family ()); address.svm_cid = cid; address.svm_port = port; return 0; } int zmq::vmci_address_t::to_string (std::string &addr_) { if (address.svm_family != parent->get_vmci_socket_family ()) { addr_.clear (); return -1; } std::stringstream s; s << "vmci://"; if (address.svm_cid == VMADDR_CID_ANY) { s << "*"; } else { s << address.svm_cid; } s << ":"; if (address.svm_port == VMADDR_PORT_ANY) { s << "*"; } else { s << address.svm_port; } addr_ = s.str (); return 0; } const sockaddr *zmq::vmci_address_t::addr () const { return reinterpret_cast (&address); } socklen_t zmq::vmci_address_t::addrlen () const { return static_cast (sizeof address); } #endif zeromq-4.2.5/src/ctx.cpp0000664000372000037200000005154213255253220016040 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #endif #include #include #include #include #include #include "ctx.hpp" #include "socket_base.hpp" #include "io_thread.hpp" #include "reaper.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" #include "random.hpp" #ifdef ZMQ_HAVE_VMCI #include #endif #define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe #define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef int clipped_maxsocket (int max_requested) { if (max_requested >= zmq::poller_t::max_fds () && zmq::poller_t::max_fds () != -1) // -1 because we need room for the reaper mailbox. max_requested = zmq::poller_t::max_fds () - 1; return max_requested; } zmq::ctx_t::ctx_t () : tag (ZMQ_CTX_TAG_VALUE_GOOD), starting (true), terminating (false), reaper (NULL), slot_count (0), slots (NULL), max_sockets (clipped_maxsocket (ZMQ_MAX_SOCKETS_DFLT)), max_msgsz (INT_MAX), io_thread_count (ZMQ_IO_THREADS_DFLT), blocky (true), ipv6 (false), zero_copy (true) { #ifdef HAVE_FORK pid = getpid (); #endif #ifdef ZMQ_HAVE_VMCI vmci_fd = -1; vmci_family = -1; #endif // Initialise crypto library, if needed. zmq::random_open (); } bool zmq::ctx_t::check_tag () { return tag == ZMQ_CTX_TAG_VALUE_GOOD; } zmq::ctx_t::~ctx_t () { // Check that there are no remaining sockets. zmq_assert (sockets.empty ()); // Ask I/O threads to terminate. If stop signal wasn't sent to I/O // thread subsequent invocation of destructor would hang-up. for (io_threads_t::size_type i = 0; i != io_threads.size (); i++) { io_threads[i]->stop (); } // Wait till I/O threads actually terminate. for (io_threads_t::size_type i = 0; i != io_threads.size (); i++) { LIBZMQ_DELETE (io_threads[i]); } // Deallocate the reaper thread object. LIBZMQ_DELETE (reaper); // Deallocate the array of mailboxes. No special work is // needed as mailboxes themselves were deallocated with their // corresponding io_thread/socket objects. free (slots); // De-initialise crypto library, if needed. zmq::random_close (); // Remove the tag, so that the object is considered dead. tag = ZMQ_CTX_TAG_VALUE_BAD; } bool zmq::ctx_t::valid () const { return term_mailbox.valid (); } int zmq::ctx_t::terminate () { slot_sync.lock (); bool saveTerminating = terminating; terminating = false; // Connect up any pending inproc connections, otherwise we will hang pending_connections_t copy = pending_connections; for (pending_connections_t::iterator p = copy.begin (); p != copy.end (); ++p) { zmq::socket_base_t *s = create_socket (ZMQ_PAIR); // create_socket might fail eg: out of memory/sockets limit reached zmq_assert (s); s->bind (p->first.c_str ()); s->close (); } terminating = saveTerminating; if (!starting) { #ifdef HAVE_FORK if (pid != getpid ()) { // we are a forked child process. Close all file descriptors // inherited from the parent. for (sockets_t::size_type i = 0; i != sockets.size (); i++) sockets[i]->get_mailbox ()->forked (); term_mailbox.forked (); } #endif // Check whether termination was already underway, but interrupted and now // restarted. bool restarted = terminating; terminating = true; // First attempt to terminate the context. if (!restarted) { // First send stop command to sockets so that any blocking calls // can be interrupted. If there are no sockets we can ask reaper // thread to stop. for (sockets_t::size_type i = 0; i != sockets.size (); i++) sockets[i]->stop (); if (sockets.empty ()) reaper->stop (); } slot_sync.unlock (); // Wait till reaper thread closes all the sockets. command_t cmd; int rc = term_mailbox.recv (&cmd, -1); if (rc == -1 && errno == EINTR) return -1; errno_assert (rc == 0); zmq_assert (cmd.type == command_t::done); slot_sync.lock (); zmq_assert (sockets.empty ()); } slot_sync.unlock (); #ifdef ZMQ_HAVE_VMCI vmci_sync.lock (); VMCISock_ReleaseAFValueFd (vmci_fd); vmci_family = -1; vmci_fd = -1; vmci_sync.unlock (); #endif // Deallocate the resources. delete this; return 0; } int zmq::ctx_t::shutdown () { scoped_lock_t locker (slot_sync); if (!starting && !terminating) { terminating = true; // Send stop command to sockets so that any blocking calls // can be interrupted. If there are no sockets we can ask reaper // thread to stop. for (sockets_t::size_type i = 0; i != sockets.size (); i++) sockets[i]->stop (); if (sockets.empty ()) reaper->stop (); } return 0; } int zmq::ctx_t::set (int option_, int optval_) { int rc = 0; if (option_ == ZMQ_MAX_SOCKETS && optval_ >= 1 && optval_ == clipped_maxsocket (optval_)) { scoped_lock_t locker (opt_sync); max_sockets = optval_; } else if (option_ == ZMQ_IO_THREADS && optval_ >= 0) { scoped_lock_t locker (opt_sync); io_thread_count = optval_; } else if (option_ == ZMQ_IPV6 && optval_ >= 0) { scoped_lock_t locker (opt_sync); ipv6 = (optval_ != 0); } else if (option_ == ZMQ_BLOCKY && optval_ >= 0) { scoped_lock_t locker (opt_sync); blocky = (optval_ != 0); } else if (option_ == ZMQ_MAX_MSGSZ && optval_ >= 0) { scoped_lock_t locker (opt_sync); max_msgsz = optval_ < INT_MAX ? optval_ : INT_MAX; } else if (option_ == ZMQ_ZERO_COPY_RECV && optval_ >= 0) { scoped_lock_t locker (opt_sync); zero_copy = (optval_ != 0); } else { rc = thread_ctx_t::set (option_, optval_); } return rc; } int zmq::ctx_t::get (int option_) { int rc = 0; if (option_ == ZMQ_MAX_SOCKETS) rc = max_sockets; else if (option_ == ZMQ_SOCKET_LIMIT) rc = clipped_maxsocket (65535); else if (option_ == ZMQ_IO_THREADS) rc = io_thread_count; else if (option_ == ZMQ_IPV6) rc = ipv6; else if (option_ == ZMQ_BLOCKY) rc = blocky; else if (option_ == ZMQ_MAX_MSGSZ) rc = max_msgsz; else if (option_ == ZMQ_MSG_T_SIZE) rc = sizeof (zmq_msg_t); else if (option_ == ZMQ_ZERO_COPY_RECV) { rc = zero_copy; } else { errno = EINVAL; rc = -1; } return rc; } bool zmq::ctx_t::start () { // Initialise the array of mailboxes. Additional three slots are for // zmq_ctx_term thread and reaper thread. opt_sync.lock (); int mazmq = max_sockets; int ios = io_thread_count; opt_sync.unlock (); slot_count = mazmq + ios + 2; slots = (i_mailbox **) malloc (sizeof (i_mailbox *) * slot_count); if (!slots) { errno = ENOMEM; goto fail; } // Initialise the infrastructure for zmq_ctx_term thread. slots[term_tid] = &term_mailbox; // Create the reaper thread. reaper = new (std::nothrow) reaper_t (this, reaper_tid); if (!reaper) { errno = ENOMEM; goto fail_cleanup_slots; } if (!reaper->get_mailbox ()->valid ()) goto fail_cleanup_reaper; slots[reaper_tid] = reaper->get_mailbox (); reaper->start (); // Create I/O thread objects and launch them. for (int32_t i = (int32_t) slot_count - 1; i >= (int32_t) 2; i--) { slots[i] = NULL; } for (int i = 2; i != ios + 2; i++) { io_thread_t *io_thread = new (std::nothrow) io_thread_t (this, i); if (!io_thread) { errno = ENOMEM; goto fail_cleanup_reaper; } if (!io_thread->get_mailbox ()->valid ()) { delete io_thread; goto fail_cleanup_reaper; } io_threads.push_back (io_thread); slots[i] = io_thread->get_mailbox (); io_thread->start (); } // In the unused part of the slot array, create a list of empty slots. for (int32_t i = (int32_t) slot_count - 1; i >= (int32_t) ios + 2; i--) { empty_slots.push_back (i); } starting = false; return true; fail_cleanup_reaper: reaper->stop (); delete reaper; reaper = NULL; fail_cleanup_slots: free (slots); slots = NULL; fail: return false; } zmq::socket_base_t *zmq::ctx_t::create_socket (int type_) { scoped_lock_t locker (slot_sync); if (unlikely (starting)) { if (!start ()) return NULL; } // Once zmq_ctx_term() was called, we can't create new sockets. if (terminating) { errno = ETERM; return NULL; } // If max_sockets limit was reached, return error. if (empty_slots.empty ()) { errno = EMFILE; return NULL; } // Choose a slot for the socket. uint32_t slot = empty_slots.back (); empty_slots.pop_back (); // Generate new unique socket ID. int sid = ((int) max_socket_id.add (1)) + 1; // Create the socket and register its mailbox. socket_base_t *s = socket_base_t::create (type_, this, slot, sid); if (!s) { empty_slots.push_back (slot); return NULL; } sockets.push_back (s); slots[slot] = s->get_mailbox (); return s; } void zmq::ctx_t::destroy_socket (class socket_base_t *socket_) { scoped_lock_t locker (slot_sync); // Free the associated thread slot. uint32_t tid = socket_->get_tid (); empty_slots.push_back (tid); slots[tid] = NULL; // Remove the socket from the list of sockets. sockets.erase (socket_); // If zmq_ctx_term() was already called and there are no more socket // we can ask reaper thread to terminate. if (terminating && sockets.empty ()) reaper->stop (); } zmq::object_t *zmq::ctx_t::get_reaper () { return reaper; } zmq::thread_ctx_t::thread_ctx_t () : thread_priority (ZMQ_THREAD_PRIORITY_DFLT), thread_sched_policy (ZMQ_THREAD_SCHED_POLICY_DFLT) { } void zmq::thread_ctx_t::start_thread (thread_t &thread_, thread_fn *tfn_, void *arg_) const { static unsigned int nthreads_started = 0; thread_.setSchedulingParameters (thread_priority, thread_sched_policy, thread_affinity_cpus); thread_.start (tfn_, arg_); #ifndef ZMQ_HAVE_ANDROID std::ostringstream s; if (!thread_name_prefix.empty ()) s << thread_name_prefix << "/"; s << "ZMQbg/" << nthreads_started; thread_.setThreadName (s.str ().c_str ()); #endif nthreads_started++; } int zmq::thread_ctx_t::set (int option_, int optval_) { int rc = 0; if (option_ == ZMQ_THREAD_SCHED_POLICY && optval_ >= 0) { scoped_lock_t locker (opt_sync); thread_sched_policy = optval_; } else if (option_ == ZMQ_THREAD_AFFINITY_CPU_ADD && optval_ >= 0) { scoped_lock_t locker (opt_sync); thread_affinity_cpus.insert (optval_); } else if (option_ == ZMQ_THREAD_AFFINITY_CPU_REMOVE && optval_ >= 0) { scoped_lock_t locker (opt_sync); std::set::iterator it = thread_affinity_cpus.find (optval_); if (it != thread_affinity_cpus.end ()) { thread_affinity_cpus.erase (it); } else { errno = EINVAL; rc = -1; } } else if (option_ == ZMQ_THREAD_NAME_PREFIX && optval_ >= 0) { std::ostringstream s; s << optval_; scoped_lock_t locker (opt_sync); thread_name_prefix = s.str (); } else if (option_ == ZMQ_THREAD_PRIORITY && optval_ >= 0) { scoped_lock_t locker (opt_sync); thread_priority = optval_; } else { errno = EINVAL; rc = -1; } return rc; } void zmq::ctx_t::send_command (uint32_t tid_, const command_t &command_) { slots[tid_]->send (command_); } zmq::io_thread_t *zmq::ctx_t::choose_io_thread (uint64_t affinity_) { if (io_threads.empty ()) return NULL; // Find the I/O thread with minimum load. int min_load = -1; io_thread_t *selected_io_thread = NULL; for (io_threads_t::size_type i = 0; i != io_threads.size (); i++) { if (!affinity_ || (affinity_ & (uint64_t (1) << i))) { int load = io_threads[i]->get_load (); if (selected_io_thread == NULL || load < min_load) { min_load = load; selected_io_thread = io_threads[i]; } } } return selected_io_thread; } int zmq::ctx_t::register_endpoint (const char *addr_, const endpoint_t &endpoint_) { scoped_lock_t locker (endpoints_sync); const bool inserted = endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, endpoint_).second; if (!inserted) { errno = EADDRINUSE; return -1; } return 0; } int zmq::ctx_t::unregister_endpoint (const std::string &addr_, socket_base_t *socket_) { scoped_lock_t locker (endpoints_sync); const endpoints_t::iterator it = endpoints.find (addr_); if (it == endpoints.end () || it->second.socket != socket_) { errno = ENOENT; return -1; } // Remove endpoint. endpoints.erase (it); return 0; } void zmq::ctx_t::unregister_endpoints (socket_base_t *socket_) { scoped_lock_t locker (endpoints_sync); endpoints_t::iterator it = endpoints.begin (); while (it != endpoints.end ()) { if (it->second.socket == socket_) { endpoints_t::iterator to_erase = it; ++it; endpoints.erase (to_erase); continue; } ++it; } } zmq::endpoint_t zmq::ctx_t::find_endpoint (const char *addr_) { scoped_lock_t locker (endpoints_sync); endpoints_t::iterator it = endpoints.find (addr_); if (it == endpoints.end ()) { errno = ECONNREFUSED; endpoint_t empty = {NULL, options_t ()}; return empty; } endpoint_t endpoint = it->second; // Increment the command sequence number of the peer so that it won't // get deallocated until "bind" command is issued by the caller. // The subsequent 'bind' has to be called with inc_seqnum parameter // set to false, so that the seqnum isn't incremented twice. endpoint.socket->inc_seqnum (); return endpoint; } void zmq::ctx_t::pend_connection (const std::string &addr_, const endpoint_t &endpoint_, pipe_t **pipes_) { scoped_lock_t locker (endpoints_sync); const pending_connection_t pending_connection = {endpoint_, pipes_[0], pipes_[1]}; endpoints_t::iterator it = endpoints.find (addr_); if (it == endpoints.end ()) { // Still no bind. endpoint_.socket->inc_seqnum (); pending_connections.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, pending_connection); } else { // Bind has happened in the mean time, connect directly connect_inproc_sockets (it->second.socket, it->second.options, pending_connection, connect_side); } } void zmq::ctx_t::connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_) { scoped_lock_t locker (endpoints_sync); std::pair pending = pending_connections.equal_range (addr_); for (pending_connections_t::iterator p = pending.first; p != pending.second; ++p) connect_inproc_sockets (bind_socket_, endpoints[addr_].options, p->second, bind_side); pending_connections.erase (pending.first, pending.second); } void zmq::ctx_t::connect_inproc_sockets ( zmq::socket_base_t *bind_socket_, options_t &bind_options, const pending_connection_t &pending_connection_, side side_) { bind_socket_->inc_seqnum (); pending_connection_.bind_pipe->set_tid (bind_socket_->get_tid ()); if (!bind_options.recv_routing_id) { msg_t msg; const bool ok = pending_connection_.bind_pipe->read (&msg); zmq_assert (ok); const int rc = msg.close (); errno_assert (rc == 0); } bool conflate = pending_connection_.endpoint.options.conflate && (pending_connection_.endpoint.options.type == ZMQ_DEALER || pending_connection_.endpoint.options.type == ZMQ_PULL || pending_connection_.endpoint.options.type == ZMQ_PUSH || pending_connection_.endpoint.options.type == ZMQ_PUB || pending_connection_.endpoint.options.type == ZMQ_SUB); if (!conflate) { pending_connection_.connect_pipe->set_hwms_boost (bind_options.sndhwm, bind_options.rcvhwm); pending_connection_.bind_pipe->set_hwms_boost ( pending_connection_.endpoint.options.sndhwm, pending_connection_.endpoint.options.rcvhwm); pending_connection_.connect_pipe->set_hwms ( pending_connection_.endpoint.options.rcvhwm, pending_connection_.endpoint.options.sndhwm); pending_connection_.bind_pipe->set_hwms (bind_options.rcvhwm, bind_options.sndhwm); } else { pending_connection_.connect_pipe->set_hwms (-1, -1); pending_connection_.bind_pipe->set_hwms (-1, -1); } if (side_ == bind_side) { command_t cmd; cmd.type = command_t::bind; cmd.args.bind.pipe = pending_connection_.bind_pipe; bind_socket_->process_command (cmd); bind_socket_->send_inproc_connected ( pending_connection_.endpoint.socket); } else pending_connection_.connect_pipe->send_bind ( bind_socket_, pending_connection_.bind_pipe, false); // When a ctx is terminated all pending inproc connection will be // connected, but the socket will already be closed and the pipe will be // in waiting_for_delimiter state, which means no more writes can be done // and the routing id write fails and causes an assert. Check if the socket // is open before sending. if (pending_connection_.endpoint.options.recv_routing_id && pending_connection_.endpoint.socket->check_tag ()) { msg_t routing_id; const int rc = routing_id.init_size (bind_options.routing_id_size); errno_assert (rc == 0); memcpy (routing_id.data (), bind_options.routing_id, bind_options.routing_id_size); routing_id.set_flags (msg_t::routing_id); const bool written = pending_connection_.bind_pipe->write (&routing_id); zmq_assert (written); pending_connection_.bind_pipe->flush (); } } #ifdef ZMQ_HAVE_VMCI int zmq::ctx_t::get_vmci_socket_family () { zmq::scoped_lock_t locker (vmci_sync); if (vmci_fd == -1) { vmci_family = VMCISock_GetAFValueFd (&vmci_fd); if (vmci_fd != -1) { #ifdef FD_CLOEXEC int rc = fcntl (vmci_fd, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif } } return vmci_family; } #endif // The last used socket ID, or 0 if no socket was used so far. Note that this // is a global variable. Thus, even sockets created in different contexts have // unique IDs. zmq::atomic_counter_t zmq::ctx_t::max_socket_id; zeromq-4.2.5/src/session_base.hpp0000664000372000037200000001300713255253220017716 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SESSION_BASE_HPP_INCLUDED__ #define __ZMQ_SESSION_BASE_HPP_INCLUDED__ #include #include #include "own.hpp" #include "io_object.hpp" #include "pipe.hpp" #include "socket_base.hpp" #include "stream_engine.hpp" namespace zmq { class pipe_t; class io_thread_t; class socket_base_t; struct i_engine; struct address_t; class session_base_t : public own_t, public io_object_t, public i_pipe_events { public: // Create a session of the particular type. static session_base_t *create (zmq::io_thread_t *io_thread_, bool active_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_); // To be used once only, when creating the session. void attach_pipe (zmq::pipe_t *pipe_); // Following functions are the interface exposed towards the engine. virtual void reset (); void flush (); void engine_error (zmq::stream_engine_t::error_reason_t reason); // i_pipe_events interface implementation. void read_activated (zmq::pipe_t *pipe_); void write_activated (zmq::pipe_t *pipe_); void hiccuped (zmq::pipe_t *pipe_); void pipe_terminated (zmq::pipe_t *pipe_); // Delivers a message. Returns 0 if successful; -1 otherwise. // The function takes ownership of the message. virtual int push_msg (msg_t *msg_); int zap_connect (); bool zap_enabled (); // Fetches a message. Returns 0 if successful; -1 otherwise. // The caller is responsible for freeing the message when no // longer used. virtual int pull_msg (msg_t *msg_); // Receives message from ZAP socket. // Returns 0 on success; -1 otherwise. // The caller is responsible for freeing the message. int read_zap_msg (msg_t *msg_); // Sends message to ZAP socket. // Returns 0 on success; -1 otherwise. // The function takes ownership of the message. int write_zap_msg (msg_t *msg_); socket_base_t *get_socket (); const char *get_endpoint () const; protected: session_base_t (zmq::io_thread_t *io_thread_, bool active_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_); virtual ~session_base_t (); private: void start_connecting (bool wait_); void reconnect (); // Handlers for incoming commands. void process_plug (); void process_attach (zmq::i_engine *engine_); void process_term (int linger_); // i_poll_events handlers. void timer_event (int id_); // Remove any half processed messages. Flush unflushed messages. // Call this function when engine disconnect to get rid of leftovers. void clean_pipes (); // If true, this session (re)connects to the peer. Otherwise, it's // a transient session created by the listener. const bool active; // Pipe connecting the session to its socket. zmq::pipe_t *pipe; // Pipe used to exchange messages with ZAP socket. zmq::pipe_t *zap_pipe; // This set is added to with pipes we are disconnecting, but haven't yet completed std::set terminating_pipes; // This flag is true if the remainder of the message being processed // is still in the in pipe. bool incomplete_in; // True if termination have been suspended to push the pending // messages to the network. bool pending; // The protocol I/O engine connected to the session. zmq::i_engine *engine; // The socket the session belongs to. zmq::socket_base_t *socket; // I/O thread the session is living in. It will be used to plug in // the engines into the same thread. zmq::io_thread_t *io_thread; // ID of the linger timer enum { linger_timer_id = 0x20 }; // True is linger timer is running. bool has_linger_timer; // Protocol and address to use when connecting. address_t *addr; session_base_t (const session_base_t &); const session_base_t &operator= (const session_base_t &); }; } #endif zeromq-4.2.5/src/xpub.hpp0000664000372000037200000001017013255253220016215 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_XPUB_HPP_INCLUDED__ #define __ZMQ_XPUB_HPP_INCLUDED__ #include #include #include "socket_base.hpp" #include "session_base.hpp" #include "mtrie.hpp" #include "array.hpp" #include "dist.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class xpub_t : public socket_base_t { public: xpub_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~xpub_t (); // Implementations of virtual functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false); int xsend (zmq::msg_t *msg_); bool xhas_out (); int xrecv (zmq::msg_t *msg_); bool xhas_in (); void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Function to be applied to the trie to send all the subscriptions // upstream. static void send_unsubscription (zmq::mtrie_t::prefix_t data_, size_t size_, xpub_t *self_); // Function to be applied to each matching pipes. static void mark_as_matching (zmq::pipe_t *pipe_, xpub_t *arg_); // List of all subscriptions mapped to corresponding pipes. mtrie_t subscriptions; // List of manual subscriptions mapped to corresponding pipes. mtrie_t manual_subscriptions; // Distributor of messages holding the list of outbound pipes. dist_t dist; // If true, send all subscription messages upstream, not just // unique ones bool verbose_subs; // If true, send all unsubscription messages upstream, not just // unique ones bool verbose_unsubs; // True if we are in the middle of sending a multi-part message. bool more; // Drop messages if HWM reached, otherwise return with EAGAIN bool lossy; // Subscriptions will not bed added automatically, only after calling set option with ZMQ_SUBSCRIBE or ZMQ_UNSUBSCRIBE bool manual; // Last pipe that sent subscription message, only used if xpub is on manual pipe_t *last_pipe; // Pipes that sent subscriptions messages that have not yet been processed, only used if xpub is on manual std::deque pending_pipes; // Welcome message to send to pipe when attached msg_t welcome_msg; // List of pending (un)subscriptions, ie. those that were already // applied to the trie, but not yet received by the user. std::deque pending_data; std::deque pending_metadata; std::deque pending_flags; xpub_t (const xpub_t &); const xpub_t &operator= (const xpub_t &); }; } #endif zeromq-4.2.5/src/tweetnacl.h0000664000372000037200000000557713255253220016704 0ustar00travistravis00000000000000/* Copyright (c) 2016-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef TWEETNACL_H #define TWEETNACL_H #if defined(ZMQ_USE_TWEETNACL) #define crypto_box_SECRETKEYBYTES 32 #define crypto_box_BOXZEROBYTES 16 #define crypto_box_NONCEBYTES 24 #define crypto_box_ZEROBYTES 32 #define crypto_box_PUBLICKEYBYTES 32 #define crypto_box_BEFORENMBYTES 32 #define crypto_secretbox_KEYBYTES 32 #define crypto_secretbox_NONCEBYTES 24 #define crypto_secretbox_ZEROBYTES 32 #define crypto_secretbox_BOXZEROBYTES 16 typedef unsigned char u8; typedef unsigned long u32; typedef unsigned long long u64; typedef long long i64; typedef i64 gf[16]; #ifdef __cplusplus extern "C" { #endif void randombytes (unsigned char *, unsigned long long); // Do not call manually! Use random_close from random.hpp int randombytes_close (void); // Do not call manually! Use random_open from random.hpp int sodium_init (void); int crypto_box_keypair (u8 *y, u8 *x); int crypto_box_afternm (u8 *c, const u8 *m, u64 d, const u8 *n, const u8 *k); int crypto_box_open_afternm ( u8 *m, const u8 *c, u64 d, const u8 *n, const u8 *k); int crypto_box ( u8 *c, const u8 *m, u64 d, const u8 *n, const u8 *y, const u8 *x); int crypto_box_open ( u8 *m, const u8 *c, u64 d, const u8 *n, const u8 *y, const u8 *x); int crypto_box_beforenm (u8 *k, const u8 *y, const u8 *x); int crypto_scalarmult_base (u8 *q, const u8 *n); int crypto_secretbox (u8 *c, const u8 *m, u64 d, const u8 *n, const u8 *k); int crypto_secretbox_open (u8 *m, const u8 *c, u64 d, const u8 *n, const u8 *k); #ifdef __cplusplus } #endif #endif #endif zeromq-4.2.5/src/libzmq.pc.cmake.in0000664000372000037200000000051413255253220020035 0ustar00travistravis00000000000000prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include Name: libzmq Description: 0MQ c++ library Version: @ZMQ_VERSION_MAJOR@.@ZMQ_VERSION_MINOR@.@ZMQ_VERSION_PATCH@ Libs: -L${libdir} -lzmq Libs.private: -lstdc++ @pkg_config_libs_private@ Cflags: -I${includedir} @pkg_config_defines@ zeromq-4.2.5/src/object.hpp0000664000372000037200000001320113255253220016503 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_OBJECT_HPP_INCLUDED__ #define __ZMQ_OBJECT_HPP_INCLUDED__ #include #include "stdint.hpp" namespace zmq { struct i_engine; struct endpoint_t; struct pending_connection_t; struct command_t; class ctx_t; class pipe_t; class socket_base_t; class session_base_t; class io_thread_t; class own_t; // Base class for all objects that participate in inter-thread // communication. class object_t { public: object_t (zmq::ctx_t *ctx_, uint32_t tid_); object_t (object_t *parent_); virtual ~object_t (); uint32_t get_tid (); void set_tid (uint32_t id); ctx_t *get_ctx (); void process_command (zmq::command_t &cmd_); void send_inproc_connected (zmq::socket_base_t *socket_); void send_bind (zmq::own_t *destination_, zmq::pipe_t *pipe_, bool inc_seqnum_ = true); protected: // Using following function, socket is able to access global // repository of inproc endpoints. int register_endpoint (const char *addr_, const zmq::endpoint_t &endpoint_); int unregister_endpoint (const std::string &addr_, socket_base_t *socket_); void unregister_endpoints (zmq::socket_base_t *socket_); zmq::endpoint_t find_endpoint (const char *addr_); void pend_connection (const std::string &addr_, const endpoint_t &endpoint, pipe_t **pipes_); void connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_); void destroy_socket (zmq::socket_base_t *socket_); // Logs an message. void log (const char *format_, ...); // Chooses least loaded I/O thread. zmq::io_thread_t *choose_io_thread (uint64_t affinity_); // Derived object can use these functions to send commands // to other objects. void send_stop (); void send_plug (zmq::own_t *destination_, bool inc_seqnum_ = true); void send_own (zmq::own_t *destination_, zmq::own_t *object_); void send_attach (zmq::session_base_t *destination_, zmq::i_engine *engine_, bool inc_seqnum_ = true); void send_activate_read (zmq::pipe_t *destination_); void send_activate_write (zmq::pipe_t *destination_, uint64_t msgs_read_); void send_hiccup (zmq::pipe_t *destination_, void *pipe_); void send_pipe_term (zmq::pipe_t *destination_); void send_pipe_term_ack (zmq::pipe_t *destination_); void send_pipe_hwm (zmq::pipe_t *destination_, int inhwm_, int outhwm_); void send_term_req (zmq::own_t *destination_, zmq::own_t *object_); void send_term (zmq::own_t *destination_, int linger_); void send_term_ack (zmq::own_t *destination_); void send_term_endpoint (own_t *destination_, std::string *endpoint_); void send_reap (zmq::socket_base_t *socket_); void send_reaped (); void send_done (); // These handlers can be overridden by the derived objects. They are // called when command arrives from another thread. virtual void process_stop (); virtual void process_plug (); virtual void process_own (zmq::own_t *object_); virtual void process_attach (zmq::i_engine *engine_); virtual void process_bind (zmq::pipe_t *pipe_); virtual void process_activate_read (); virtual void process_activate_write (uint64_t msgs_read_); virtual void process_hiccup (void *pipe_); virtual void process_pipe_term (); virtual void process_pipe_term_ack (); virtual void process_pipe_hwm (int inhwm_, int outhwm_); virtual void process_term_req (zmq::own_t *object_); virtual void process_term (int linger_); virtual void process_term_ack (); virtual void process_term_endpoint (std::string *endpoint_); virtual void process_reap (zmq::socket_base_t *socket_); virtual void process_reaped (); // Special handler called after a command that requires a seqnum // was processed. The implementation should catch up with its counter // of processed commands here. virtual void process_seqnum (); private: // Context provides access to the global state. zmq::ctx_t *const ctx; // Thread ID of the thread the object belongs to. uint32_t tid; void send_command (command_t &cmd_); object_t (const object_t &); const object_t &operator= (const object_t &); }; } #endif zeromq-4.2.5/src/vmci.hpp0000664000372000037200000000426713255253220016207 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_VMCI_HPP_INCLUDED__ #define __ZMQ_VMCI_HPP_INCLUDED__ #include #include "platform.hpp" #include "fd.hpp" #include "ctx.hpp" #if defined ZMQ_HAVE_VMCI #if defined ZMQ_HAVE_WINDOWS #include "windows.hpp" #else #include #endif namespace zmq { void tune_vmci_buffer_size (ctx_t *context_, fd_t sockfd_, uint64_t default_size_, uint64_t min_size_, uint64_t max_size_); #if defined ZMQ_HAVE_WINDOWS void tune_vmci_connect_timeout (ctx_t *context_, fd_t sockfd_, DWORD timeout_); #else void tune_vmci_connect_timeout (ctx_t *context_, fd_t sockfd_, struct timeval timeout_); #endif } #endif #endif zeromq-4.2.5/src/random.hpp0000664000372000037200000000360013255253220016517 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_RANDOM_HPP_INCLUDED__ #define __ZMQ_RANDOM_HPP_INCLUDED__ #include "stdint.hpp" namespace zmq { // Seeds the random number generator. void seed_random (); // Generates random value. uint32_t generate_random (); // [De-]Initialise crypto library, if needed. // Serialised and refcounted, so that it can be called // from multiple threads, each with its own context, and from // the various zmq_utils curve functions safely. void random_open (); void random_close (); } #endif zeromq-4.2.5/src/wire.hpp0000664000372000037200000000666513255253220016223 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_WIRE_HPP_INCLUDED__ #define __ZMQ_WIRE_HPP_INCLUDED__ #include "stdint.hpp" namespace zmq { // Helper functions to convert different integer types to/from network // byte order. inline void put_uint8 (unsigned char *buffer_, uint8_t value) { *buffer_ = value; } inline uint8_t get_uint8 (const unsigned char *buffer_) { return *buffer_; } inline void put_uint16 (unsigned char *buffer_, uint16_t value) { buffer_[0] = (unsigned char) (((value) >> 8) & 0xff); buffer_[1] = (unsigned char) (value & 0xff); } inline uint16_t get_uint16 (const unsigned char *buffer_) { return (((uint16_t) buffer_[0]) << 8) | ((uint16_t) buffer_[1]); } inline void put_uint32 (unsigned char *buffer_, uint32_t value) { buffer_[0] = (unsigned char) (((value) >> 24) & 0xff); buffer_[1] = (unsigned char) (((value) >> 16) & 0xff); buffer_[2] = (unsigned char) (((value) >> 8) & 0xff); buffer_[3] = (unsigned char) (value & 0xff); } inline uint32_t get_uint32 (const unsigned char *buffer_) { return (((uint32_t) buffer_[0]) << 24) | (((uint32_t) buffer_[1]) << 16) | (((uint32_t) buffer_[2]) << 8) | ((uint32_t) buffer_[3]); } inline void put_uint64 (unsigned char *buffer_, uint64_t value) { buffer_[0] = (unsigned char) (((value) >> 56) & 0xff); buffer_[1] = (unsigned char) (((value) >> 48) & 0xff); buffer_[2] = (unsigned char) (((value) >> 40) & 0xff); buffer_[3] = (unsigned char) (((value) >> 32) & 0xff); buffer_[4] = (unsigned char) (((value) >> 24) & 0xff); buffer_[5] = (unsigned char) (((value) >> 16) & 0xff); buffer_[6] = (unsigned char) (((value) >> 8) & 0xff); buffer_[7] = (unsigned char) (value & 0xff); } inline uint64_t get_uint64 (const unsigned char *buffer_) { return (((uint64_t) buffer_[0]) << 56) | (((uint64_t) buffer_[1]) << 48) | (((uint64_t) buffer_[2]) << 40) | (((uint64_t) buffer_[3]) << 32) | (((uint64_t) buffer_[4]) << 24) | (((uint64_t) buffer_[5]) << 16) | (((uint64_t) buffer_[6]) << 8) | ((uint64_t) buffer_[7]); } } #endif zeromq-4.2.5/src/reaper.hpp0000664000372000037200000000525413255253220016524 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_REAPER_HPP_INCLUDED__ #define __ZMQ_REAPER_HPP_INCLUDED__ #include "object.hpp" #include "mailbox.hpp" #include "poller.hpp" #include "i_poll_events.hpp" namespace zmq { class ctx_t; class socket_base_t; class reaper_t : public object_t, public i_poll_events { public: reaper_t (zmq::ctx_t *ctx_, uint32_t tid_); ~reaper_t (); mailbox_t *get_mailbox (); void start (); void stop (); // i_poll_events implementation. void in_event (); void out_event (); void timer_event (int id_); private: // Command handlers. void process_stop (); void process_reap (zmq::socket_base_t *socket_); void process_reaped (); // Reaper thread accesses incoming commands via this mailbox. mailbox_t mailbox; // Handle associated with mailbox' file descriptor. poller_t::handle_t mailbox_handle; // I/O multiplexing is performed using a poller object. poller_t *poller; // Number of sockets being reaped at the moment. int sockets; // If true, we were already asked to terminate. bool terminating; reaper_t (const reaper_t &); const reaper_t &operator= (const reaper_t &); #ifdef HAVE_FORK // the process that created this context. Used to detect forking. pid_t pid; #endif }; } #endif zeromq-4.2.5/src/object.cpp0000664000372000037200000002624613255253220016513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "object.hpp" #include "ctx.hpp" #include "err.hpp" #include "pipe.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "socket_base.hpp" zmq::object_t::object_t (ctx_t *ctx_, uint32_t tid_) : ctx (ctx_), tid (tid_) { } zmq::object_t::object_t (object_t *parent_) : ctx (parent_->ctx), tid (parent_->tid) { } zmq::object_t::~object_t () { } uint32_t zmq::object_t::get_tid () { return tid; } void zmq::object_t::set_tid (uint32_t id) { tid = id; } zmq::ctx_t *zmq::object_t::get_ctx () { return ctx; } void zmq::object_t::process_command (command_t &cmd_) { switch (cmd_.type) { case command_t::activate_read: process_activate_read (); break; case command_t::activate_write: process_activate_write (cmd_.args.activate_write.msgs_read); break; case command_t::stop: process_stop (); break; case command_t::plug: process_plug (); process_seqnum (); break; case command_t::own: process_own (cmd_.args.own.object); process_seqnum (); break; case command_t::attach: process_attach (cmd_.args.attach.engine); process_seqnum (); break; case command_t::bind: process_bind (cmd_.args.bind.pipe); process_seqnum (); break; case command_t::hiccup: process_hiccup (cmd_.args.hiccup.pipe); break; case command_t::pipe_term: process_pipe_term (); break; case command_t::pipe_term_ack: process_pipe_term_ack (); break; case command_t::pipe_hwm: process_pipe_hwm (cmd_.args.pipe_hwm.inhwm, cmd_.args.pipe_hwm.outhwm); break; case command_t::term_req: process_term_req (cmd_.args.term_req.object); break; case command_t::term: process_term (cmd_.args.term.linger); break; case command_t::term_ack: process_term_ack (); break; case command_t::term_endpoint: process_term_endpoint (cmd_.args.term_endpoint.endpoint); break; case command_t::reap: process_reap (cmd_.args.reap.socket); break; case command_t::reaped: process_reaped (); break; case command_t::inproc_connected: process_seqnum (); break; case command_t::done: default: zmq_assert (false); } } int zmq::object_t::register_endpoint (const char *addr_, const endpoint_t &endpoint_) { return ctx->register_endpoint (addr_, endpoint_); } int zmq::object_t::unregister_endpoint (const std::string &addr_, socket_base_t *socket_) { return ctx->unregister_endpoint (addr_, socket_); } void zmq::object_t::unregister_endpoints (socket_base_t *socket_) { return ctx->unregister_endpoints (socket_); } zmq::endpoint_t zmq::object_t::find_endpoint (const char *addr_) { return ctx->find_endpoint (addr_); } void zmq::object_t::pend_connection (const std::string &addr_, const endpoint_t &endpoint_, pipe_t **pipes_) { ctx->pend_connection (addr_, endpoint_, pipes_); } void zmq::object_t::connect_pending (const char *addr_, zmq::socket_base_t *bind_socket_) { return ctx->connect_pending (addr_, bind_socket_); } void zmq::object_t::destroy_socket (socket_base_t *socket_) { ctx->destroy_socket (socket_); } zmq::io_thread_t *zmq::object_t::choose_io_thread (uint64_t affinity_) { return ctx->choose_io_thread (affinity_); } void zmq::object_t::send_stop () { // 'stop' command goes always from administrative thread to // the current object. command_t cmd; cmd.destination = this; cmd.type = command_t::stop; ctx->send_command (tid, cmd); } void zmq::object_t::send_plug (own_t *destination_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; cmd.destination = destination_; cmd.type = command_t::plug; send_command (cmd); } void zmq::object_t::send_own (own_t *destination_, own_t *object_) { destination_->inc_seqnum (); command_t cmd; cmd.destination = destination_; cmd.type = command_t::own; cmd.args.own.object = object_; send_command (cmd); } void zmq::object_t::send_attach (session_base_t *destination_, i_engine *engine_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; cmd.destination = destination_; cmd.type = command_t::attach; cmd.args.attach.engine = engine_; send_command (cmd); } void zmq::object_t::send_bind (own_t *destination_, pipe_t *pipe_, bool inc_seqnum_) { if (inc_seqnum_) destination_->inc_seqnum (); command_t cmd; cmd.destination = destination_; cmd.type = command_t::bind; cmd.args.bind.pipe = pipe_; send_command (cmd); } void zmq::object_t::send_activate_read (pipe_t *destination_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::activate_read; send_command (cmd); } void zmq::object_t::send_activate_write (pipe_t *destination_, uint64_t msgs_read_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::activate_write; cmd.args.activate_write.msgs_read = msgs_read_; send_command (cmd); } void zmq::object_t::send_hiccup (pipe_t *destination_, void *pipe_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::hiccup; cmd.args.hiccup.pipe = pipe_; send_command (cmd); } void zmq::object_t::send_pipe_term (pipe_t *destination_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::pipe_term; send_command (cmd); } void zmq::object_t::send_pipe_term_ack (pipe_t *destination_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::pipe_term_ack; send_command (cmd); } void zmq::object_t::send_pipe_hwm (pipe_t *destination_, int inhwm_, int outhwm_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::pipe_hwm; cmd.args.pipe_hwm.inhwm = inhwm_; cmd.args.pipe_hwm.outhwm = outhwm_; send_command (cmd); } void zmq::object_t::send_term_req (own_t *destination_, own_t *object_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::term_req; cmd.args.term_req.object = object_; send_command (cmd); } void zmq::object_t::send_term (own_t *destination_, int linger_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::term; cmd.args.term.linger = linger_; send_command (cmd); } void zmq::object_t::send_term_ack (own_t *destination_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::term_ack; send_command (cmd); } void zmq::object_t::send_term_endpoint (own_t *destination_, std::string *endpoint_) { command_t cmd; cmd.destination = destination_; cmd.type = command_t::term_endpoint; cmd.args.term_endpoint.endpoint = endpoint_; send_command (cmd); } void zmq::object_t::send_reap (class socket_base_t *socket_) { command_t cmd; cmd.destination = ctx->get_reaper (); cmd.type = command_t::reap; cmd.args.reap.socket = socket_; send_command (cmd); } void zmq::object_t::send_reaped () { command_t cmd; cmd.destination = ctx->get_reaper (); cmd.type = command_t::reaped; send_command (cmd); } void zmq::object_t::send_inproc_connected (zmq::socket_base_t *socket_) { command_t cmd; cmd.destination = socket_; cmd.type = command_t::inproc_connected; send_command (cmd); } void zmq::object_t::send_done () { command_t cmd; cmd.destination = NULL; cmd.type = command_t::done; ctx->send_command (ctx_t::term_tid, cmd); } void zmq::object_t::process_stop () { zmq_assert (false); } void zmq::object_t::process_plug () { zmq_assert (false); } void zmq::object_t::process_own (own_t *) { zmq_assert (false); } void zmq::object_t::process_attach (i_engine *) { zmq_assert (false); } void zmq::object_t::process_bind (pipe_t *) { zmq_assert (false); } void zmq::object_t::process_activate_read () { zmq_assert (false); } void zmq::object_t::process_activate_write (uint64_t) { zmq_assert (false); } void zmq::object_t::process_hiccup (void *) { zmq_assert (false); } void zmq::object_t::process_pipe_term () { zmq_assert (false); } void zmq::object_t::process_pipe_term_ack () { zmq_assert (false); } void zmq::object_t::process_pipe_hwm (int, int) { zmq_assert (false); } void zmq::object_t::process_term_req (own_t *) { zmq_assert (false); } void zmq::object_t::process_term (int) { zmq_assert (false); } void zmq::object_t::process_term_ack () { zmq_assert (false); } void zmq::object_t::process_term_endpoint (std::string *) { zmq_assert (false); } void zmq::object_t::process_reap (class socket_base_t *) { zmq_assert (false); } void zmq::object_t::process_reaped () { zmq_assert (false); } void zmq::object_t::process_seqnum () { zmq_assert (false); } void zmq::object_t::send_command (command_t &cmd_) { ctx->send_command (cmd_.destination->get_tid (), cmd_); } zeromq-4.2.5/src/plain_server.cpp0000664000372000037200000002100613255253220017723 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "msg.hpp" #include "session_base.hpp" #include "err.hpp" #include "plain_server.hpp" #include "wire.hpp" zmq::plain_server_t::plain_server_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_) : mechanism_base_t (session_, options_), zap_client_common_handshake_t ( session_, peer_address_, options_, sending_welcome) { // Note that there is no point to PLAIN if ZAP is not set up to handle the // username and password, so if ZAP is not configured it is considered a // failure. // Given this is a backward-incompatible change, it's behind a socket // option disabled by default. if (options.zap_enforce_domain) zmq_assert (zap_required ()); } zmq::plain_server_t::~plain_server_t () { } int zmq::plain_server_t::next_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case sending_welcome: rc = produce_welcome (msg_); if (rc == 0) state = waiting_for_initiate; break; case sending_ready: rc = produce_ready (msg_); if (rc == 0) state = ready; break; case sending_error: rc = produce_error (msg_); if (rc == 0) state = error_sent; break; default: errno = EAGAIN; rc = -1; } return rc; } int zmq::plain_server_t::process_handshake_command (msg_t *msg_) { int rc = 0; switch (state) { case waiting_for_hello: rc = process_hello (msg_); break; case waiting_for_initiate: rc = process_initiate (msg_); break; default: // TODO see comment in curve_server_t::process_handshake_command session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED); errno = EPROTO; rc = -1; break; } if (rc == 0) { rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } return rc; } int zmq::plain_server_t::process_hello (msg_t *msg_) { int rc = check_basic_command_structure (msg_); if (rc == -1) return -1; const unsigned char *ptr = static_cast (msg_->data ()); size_t bytes_left = msg_->size (); if (bytes_left < 6 || memcmp (ptr, "\x05HELLO", 6)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } ptr += 6; bytes_left -= 6; if (bytes_left < 1) { // PLAIN I: invalid PLAIN client, did not send username session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } const uint8_t username_length = *ptr++; bytes_left -= 1; if (bytes_left < username_length) { // PLAIN I: invalid PLAIN client, sent malformed username session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } const std::string username = std::string ((char *) ptr, username_length); ptr += username_length; bytes_left -= username_length; if (bytes_left < 1) { // PLAIN I: invalid PLAIN client, did not send password session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } const uint8_t password_length = *ptr++; bytes_left -= 1; if (bytes_left < password_length) { // PLAIN I: invalid PLAIN client, sent malformed password session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } const std::string password = std::string ((char *) ptr, password_length); ptr += password_length; bytes_left -= password_length; if (bytes_left > 0) { // PLAIN I: invalid PLAIN client, sent extraneous data session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO); errno = EPROTO; return -1; } // Use ZAP protocol (RFC 27) to authenticate the user. rc = session->zap_connect (); if (rc != 0) { session->get_socket ()->event_handshake_failed_no_detail ( session->get_endpoint (), EFAULT); return -1; } send_zap_request (username, password); state = waiting_for_zap_reply; // TODO actually, it is quite unlikely that we can read the ZAP // reply already, but removing this has some strange side-effect // (probably because the pipe's in_active flag is true until a read // is attempted) return receive_and_process_zap_reply () == -1 ? -1 : 0; } int zmq::plain_server_t::produce_welcome (msg_t *msg_) const { const int rc = msg_->init_size (8); errno_assert (rc == 0); memcpy (msg_->data (), "\x07WELCOME", 8); return 0; } int zmq::plain_server_t::process_initiate (msg_t *msg_) { const unsigned char *ptr = static_cast (msg_->data ()); const size_t bytes_left = msg_->size (); if (bytes_left < 9 || memcmp (ptr, "\x08INITIATE", 9)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } const int rc = parse_metadata (ptr + 9, bytes_left - 9); if (rc == 0) state = sending_ready; return rc; } int zmq::plain_server_t::produce_ready (msg_t *msg_) const { make_command_with_basic_properties (msg_, "\5READY", 6); return 0; } int zmq::plain_server_t::produce_error (msg_t *msg_) const { zmq_assert (status_code.length () == 3); const int rc = msg_->init_size (6 + 1 + status_code.length ()); zmq_assert (rc == 0); char *msg_data = static_cast (msg_->data ()); memcpy (msg_data, "\5ERROR", 6); msg_data[6] = (char) status_code.length (); memcpy (msg_data + 7, status_code.c_str (), status_code.length ()); return 0; } void zmq::plain_server_t::send_zap_request (const std::string &username, const std::string &password) { const uint8_t *credentials[] = { reinterpret_cast (username.c_str ()), reinterpret_cast (password.c_str ())}; size_t credentials_sizes[] = {username.size (), password.size ()}; zap_client_t::send_zap_request ("PLAIN", 5, credentials, credentials_sizes, 2); } zeromq-4.2.5/src/client.cpp0000664000372000037200000000611413255253220016513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "client.hpp" #include "err.hpp" #include "msg.hpp" zmq::client_t::client_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true) { options.type = ZMQ_CLIENT; } zmq::client_t::~client_t () { } void zmq::client_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); fq.attach (pipe_); lb.attach (pipe_); } int zmq::client_t::xsend (msg_t *msg_) { // CLIENT sockets do not allow multipart data (ZMQ_SNDMORE) if (msg_->flags () & msg_t::more) { errno = EINVAL; return -1; } return lb.sendpipe (msg_, NULL); } int zmq::client_t::xrecv (msg_t *msg_) { int rc = fq.recvpipe (msg_, NULL); // Drop any messages with more flag while (rc == 0 && msg_->flags () & msg_t::more) { // drop all frames of the current multi-frame message rc = fq.recvpipe (msg_, NULL); while (rc == 0 && msg_->flags () & msg_t::more) rc = fq.recvpipe (msg_, NULL); // get the new message if (rc == 0) rc = fq.recvpipe (msg_, NULL); } return rc; } bool zmq::client_t::xhas_in () { return fq.has_in (); } bool zmq::client_t::xhas_out () { return lb.has_out (); } const zmq::blob_t &zmq::client_t::get_credential () const { return fq.get_credential (); } void zmq::client_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::client_t::xwrite_activated (pipe_t *pipe_) { lb.activated (pipe_); } void zmq::client_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); lb.pipe_terminated (pipe_); } zeromq-4.2.5/src/ipc_listener.hpp0000664000372000037200000000735213255253220017727 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_IPC_LISTENER_HPP_INCLUDED__ #define __ZMQ_IPC_LISTENER_HPP_INCLUDED__ #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class socket_base_t; class ipc_listener_t : public own_t, public io_object_t { public: ipc_listener_t (zmq::io_thread_t *io_thread_, zmq::socket_base_t *socket_, const options_t &options_); ~ipc_listener_t (); // Set address to listen on. int set_address (const char *addr_); // Get the bound address for use with wildcards int get_address (std::string &addr_); private: // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); // Close the listening socket. int close (); // Create wildcard path address static int create_wildcard_address (std::string &path_, std::string &file_); // Filter new connections if the OS provides a mechanism to get // the credentials of the peer process. Called from accept(). #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED bool filter (fd_t sock); #endif // Accept the new connection. Returns the file descriptor of the // newly created connection. The function may return retired_fd // if the connection was dropped while waiting in the listen backlog. fd_t accept (); // True, if the underlying file for UNIX domain socket exists. bool has_file; // Name of the temporary directory (if any) that has the // the UNIX domain socket std::string tmp_socket_dirname; // Name of the file associated with the UNIX domain address. std::string filename; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // Socket the listener belongs to. zmq::socket_base_t *socket; // String representation of endpoint to bind to std::string endpoint; // Acceptable temporary directory environment variables static const char *tmp_env_vars[]; ipc_listener_t (const ipc_listener_t &); const ipc_listener_t &operator= (const ipc_listener_t &); }; } #endif #endif zeromq-4.2.5/src/ip.cpp0000664000372000037200000004760213255253220015654 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "ip.hpp" #include "err.hpp" #include "macros.hpp" #include "config.hpp" #if !defined ZMQ_HAVE_WINDOWS #include #include #include #include #include #include #else #include "tcp.hpp" #endif #if defined ZMQ_HAVE_OPENVMS || defined ZMQ_HAVE_VXWORKS #include #endif #if defined ZMQ_HAVE_VXWORKS #include #include #include #endif #if defined ZMQ_HAVE_EVENTFD #include #endif #if defined ZMQ_HAVE_OPENPGM #ifdef ZMQ_HAVE_WINDOWS #define __PGM_WININT_H__ #endif #include #endif zmq::fd_t zmq::open_socket (int domain_, int type_, int protocol_) { int rc; // Setting this option result in sane behaviour when exec() functions // are used. Old sockets are closed and don't block TCP ports etc. #if defined ZMQ_HAVE_SOCK_CLOEXEC type_ |= SOCK_CLOEXEC; #endif fd_t s = socket (domain_, type_, protocol_); #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) return INVALID_SOCKET; #else if (s == -1) return -1; #endif // If there's no SOCK_CLOEXEC, let's try the second best option. Note that // race condition can cause socket not to be closed (if fork happens // between socket creation and this point). #if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC rc = fcntl (s, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif // On Windows, preventing sockets to be inherited by child processes. #if defined ZMQ_HAVE_WINDOWS && defined HANDLE_FLAG_INHERIT BOOL brc = SetHandleInformation ((HANDLE) s, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif // Socket is not yet connected so EINVAL is not a valid networking error rc = zmq::set_nosigpipe (s); errno_assert (rc == 0); return s; } void zmq::unblock_socket (fd_t s_) { #if defined ZMQ_HAVE_WINDOWS u_long nonblock = 1; int rc = ioctlsocket (s_, FIONBIO, &nonblock); wsa_assert (rc != SOCKET_ERROR); #elif defined ZMQ_HAVE_OPENVMS || defined ZMQ_HAVE_VXWORKS int nonblock = 1; int rc = ioctl (s_, FIONBIO, &nonblock); errno_assert (rc != -1); #else int flags = fcntl (s_, F_GETFL, 0); if (flags == -1) flags = 0; int rc = fcntl (s_, F_SETFL, flags | O_NONBLOCK); errno_assert (rc != -1); #endif } void zmq::enable_ipv4_mapping (fd_t s_) { (void) s_; #if defined IPV6_V6ONLY && !defined ZMQ_HAVE_OPENBSD #ifdef ZMQ_HAVE_WINDOWS DWORD flag = 0; #else int flag = 0; #endif int rc = setsockopt (s_, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &flag, sizeof (flag)); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif #endif } int zmq::get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_) { int rc; struct sockaddr_storage ss; #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_WINDOWS \ || defined ZMQ_HAVE_VXWORKS int addrlen = static_cast (sizeof ss); #else socklen_t addrlen = sizeof ss; #endif rc = getpeername (sockfd_, (struct sockaddr *) &ss, &addrlen); #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { const int last_error = WSAGetLastError (); wsa_assert (last_error != WSANOTINITIALISED && last_error != WSAEFAULT && last_error != WSAEINPROGRESS && last_error != WSAENOTSOCK); return 0; } #else if (rc == -1) { errno_assert (errno != EBADF && errno != EFAULT && errno != ENOTSOCK); return 0; } #endif char host[NI_MAXHOST]; rc = getnameinfo ((struct sockaddr *) &ss, addrlen, host, sizeof host, NULL, 0, NI_NUMERICHOST); if (rc != 0) return 0; ip_addr_ = host; union { struct sockaddr sa; struct sockaddr_storage sa_stor; } u; u.sa_stor = ss; return (int) u.sa.sa_family; } void zmq::set_ip_type_of_service (fd_t s_, int iptos) { int rc = setsockopt (s_, IPPROTO_IP, IP_TOS, reinterpret_cast (&iptos), sizeof (iptos)); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif // Windows and Hurd do not support IPV6_TCLASS #if !defined(ZMQ_HAVE_WINDOWS) && defined(IPV6_TCLASS) rc = setsockopt (s_, IPPROTO_IPV6, IPV6_TCLASS, reinterpret_cast (&iptos), sizeof (iptos)); // If IPv6 is not enabled ENOPROTOOPT will be returned on Linux and // EINVAL on OSX if (rc == -1) { errno_assert (errno == ENOPROTOOPT || errno == EINVAL); } #endif } int zmq::set_nosigpipe (fd_t s_) { #ifdef SO_NOSIGPIPE // Make sure that SIGPIPE signal is not generated when writing to a // connection that was already closed by the peer. // As per POSIX spec, EINVAL will be returned if the socket was valid but // the connection has been reset by the peer. Return an error so that the // socket can be closed and the connection retried if necessary. int set = 1; int rc = setsockopt (s_, SOL_SOCKET, SO_NOSIGPIPE, &set, sizeof (int)); if (rc != 0 && errno == EINVAL) return -1; errno_assert (rc == 0); #else LIBZMQ_UNUSED (s_); #endif return 0; } void zmq::bind_to_device (fd_t s_, std::string &bound_device_) { #ifdef ZMQ_HAVE_SO_BINDTODEVICE int rc = setsockopt (s_, SOL_SOCKET, SO_BINDTODEVICE, bound_device_.c_str (), bound_device_.length ()); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif #else LIBZMQ_UNUSED (s_); LIBZMQ_UNUSED (bound_device_); #endif } bool zmq::initialize_network () { #if defined ZMQ_HAVE_OPENPGM // Init PGM transport. Ensure threading and timer are enabled. Find PGM // protocol ID. Note that if you want to use gettimeofday and sleep for // openPGM timing, set environment variables PGM_TIMER to "GTOD" and // PGM_SLEEP to "USLEEP". pgm_error_t *pgm_error = NULL; const bool ok = pgm_init (&pgm_error); if (ok != TRUE) { // Invalid parameters don't set pgm_error_t zmq_assert (pgm_error != NULL); if (pgm_error->domain == PGM_ERROR_DOMAIN_TIME && (pgm_error->code == PGM_ERROR_FAILED)) { // Failed to access RTC or HPET device. pgm_error_free (pgm_error); errno = EINVAL; return false; } // PGM_ERROR_DOMAIN_ENGINE: WSAStartup errors or missing WSARecvMsg. zmq_assert (false); } #endif #ifdef ZMQ_HAVE_WINDOWS // Intialise Windows sockets. Note that WSAStartup can be called multiple // times given that WSACleanup will be called for each WSAStartup. WORD version_requested = MAKEWORD (2, 2); WSADATA wsa_data; int rc = WSAStartup (version_requested, &wsa_data); zmq_assert (rc == 0); zmq_assert (LOBYTE (wsa_data.wVersion) == 2 && HIBYTE (wsa_data.wVersion) == 2); #endif return true; } void zmq::shutdown_network () { #ifdef ZMQ_HAVE_WINDOWS // On Windows, uninitialise socket layer. int rc = WSACleanup (); wsa_assert (rc != SOCKET_ERROR); #endif #if defined ZMQ_HAVE_OPENPGM // Shut down the OpenPGM library. if (pgm_shutdown () != TRUE) zmq_assert (false); #endif } #if defined ZMQ_HAVE_WINDOWS static void tune_socket (const SOCKET socket) { BOOL tcp_nodelay = 1; int rc = setsockopt (socket, IPPROTO_TCP, TCP_NODELAY, (char *) &tcp_nodelay, sizeof tcp_nodelay); wsa_assert (rc != SOCKET_ERROR); zmq::tcp_tune_loopback_fast_path (socket); } #endif int zmq::make_fdpair (fd_t *r_, fd_t *w_) { #if defined ZMQ_HAVE_EVENTFD int flags = 0; #if defined ZMQ_HAVE_EVENTFD_CLOEXEC // Setting this option result in sane behaviour when exec() functions // are used. Old sockets are closed and don't block TCP ports, avoid // leaks, etc. flags |= EFD_CLOEXEC; #endif fd_t fd = eventfd (0, flags); if (fd == -1) { errno_assert (errno == ENFILE || errno == EMFILE); *w_ = *r_ = -1; return -1; } else { *w_ = *r_ = fd; return 0; } #elif defined ZMQ_HAVE_WINDOWS #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP // Windows CE does not manage security attributes SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES sa; memset (&sd, 0, sizeof sd); memset (&sa, 0, sizeof sa); InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl (&sd, TRUE, 0, FALSE); sa.nLength = sizeof (SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = &sd; #endif // This function has to be in a system-wide critical section so that // two instances of the library don't accidentally create signaler // crossing the process boundary. // We'll use named event object to implement the critical section. // Note that if the event object already exists, the CreateEvent requests // EVENT_ALL_ACCESS access right. If this fails, we try to open // the event object asking for SYNCHRONIZE access only. HANDLE sync = NULL; // Create critical section only if using fixed signaler port // Use problematic Event implementation for compatibility if using old port 5905. // Otherwise use Mutex implementation. int event_signaler_port = 5905; if (signaler_port == event_signaler_port) { #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP sync = CreateEventW (&sa, FALSE, TRUE, L"Global\\zmq-signaler-port-sync"); #else sync = CreateEventW (NULL, FALSE, TRUE, L"Global\\zmq-signaler-port-sync"); #endif if (sync == NULL && GetLastError () == ERROR_ACCESS_DENIED) sync = OpenEventW (SYNCHRONIZE | EVENT_MODIFY_STATE, FALSE, L"Global\\zmq-signaler-port-sync"); win_assert (sync != NULL); } else if (signaler_port != 0) { wchar_t mutex_name[MAX_PATH]; #ifdef __MINGW32__ _snwprintf (mutex_name, MAX_PATH, L"Global\\zmq-signaler-port-%d", signaler_port); #else swprintf (mutex_name, MAX_PATH, L"Global\\zmq-signaler-port-%d", signaler_port); #endif #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP sync = CreateMutexW (&sa, FALSE, mutex_name); #else sync = CreateMutexW (NULL, FALSE, mutex_name); #endif if (sync == NULL && GetLastError () == ERROR_ACCESS_DENIED) sync = OpenMutexW (SYNCHRONIZE, FALSE, mutex_name); win_assert (sync != NULL); } // Windows has no 'socketpair' function. CreatePipe is no good as pipe // handles cannot be polled on. Here we create the socketpair by hand. *w_ = INVALID_SOCKET; *r_ = INVALID_SOCKET; // Create listening socket. SOCKET listener; listener = open_socket (AF_INET, SOCK_STREAM, 0); wsa_assert (listener != INVALID_SOCKET); // Set SO_REUSEADDR and TCP_NODELAY on listening socket. BOOL so_reuseaddr = 1; int rc = setsockopt (listener, SOL_SOCKET, SO_REUSEADDR, (char *) &so_reuseaddr, sizeof so_reuseaddr); wsa_assert (rc != SOCKET_ERROR); tune_socket (listener); // Init sockaddr to signaler port. struct sockaddr_in addr; memset (&addr, 0, sizeof addr); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); addr.sin_port = htons (signaler_port); // Create the writer socket. *w_ = open_socket (AF_INET, SOCK_STREAM, 0); wsa_assert (*w_ != INVALID_SOCKET); // Set TCP_NODELAY on writer socket. tune_socket (*w_); if (sync != NULL) { // Enter the critical section. DWORD dwrc = WaitForSingleObject (sync, INFINITE); zmq_assert (dwrc == WAIT_OBJECT_0 || dwrc == WAIT_ABANDONED); } // Bind listening socket to signaler port. rc = bind (listener, (const struct sockaddr *) &addr, sizeof addr); if (rc != SOCKET_ERROR && signaler_port == 0) { // Retrieve ephemeral port number int addrlen = sizeof addr; rc = getsockname (listener, (struct sockaddr *) &addr, &addrlen); } // Listen for incoming connections. if (rc != SOCKET_ERROR) rc = listen (listener, 1); // Connect writer to the listener. if (rc != SOCKET_ERROR) rc = connect (*w_, (struct sockaddr *) &addr, sizeof addr); // Accept connection from writer. if (rc != SOCKET_ERROR) *r_ = accept (listener, NULL, NULL); // Send/receive large chunk to work around TCP slow start // This code is a workaround for #1608 if (*r_ != INVALID_SOCKET) { size_t dummy_size = 1024 * 1024; // 1M to overload default receive buffer unsigned char *dummy = (unsigned char *) malloc (dummy_size); wsa_assert (dummy); int still_to_send = (int) dummy_size; int still_to_recv = (int) dummy_size; while (still_to_send || still_to_recv) { int nbytes; if (still_to_send > 0) { nbytes = ::send (*w_, (char *) (dummy + dummy_size - still_to_send), still_to_send, 0); wsa_assert (nbytes != SOCKET_ERROR); still_to_send -= nbytes; } nbytes = ::recv (*r_, (char *) (dummy + dummy_size - still_to_recv), still_to_recv, 0); wsa_assert (nbytes != SOCKET_ERROR); still_to_recv -= nbytes; } free (dummy); } // Save errno if error occurred in bind/listen/connect/accept. int saved_errno = 0; if (*r_ == INVALID_SOCKET) saved_errno = WSAGetLastError (); // We don't need the listening socket anymore. Close it. rc = closesocket (listener); wsa_assert (rc != SOCKET_ERROR); if (sync != NULL) { // Exit the critical section. BOOL brc; if (signaler_port == event_signaler_port) brc = SetEvent (sync); else brc = ReleaseMutex (sync); win_assert (brc != 0); // Release the kernel object brc = CloseHandle (sync); win_assert (brc != 0); } if (*r_ != INVALID_SOCKET) { #if !defined _WIN32_WCE && !defined ZMQ_HAVE_WINDOWS_UWP // On Windows, preventing sockets to be inherited by child processes. BOOL brc = SetHandleInformation ((HANDLE) *r_, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif return 0; } else { // Cleanup writer if connection failed if (*w_ != INVALID_SOCKET) { rc = closesocket (*w_); wsa_assert (rc != SOCKET_ERROR); *w_ = INVALID_SOCKET; } // Set errno from saved value errno = wsa_error_to_errno (saved_errno); return -1; } #elif defined ZMQ_HAVE_OPENVMS // Whilst OpenVMS supports socketpair - it maps to AF_INET only. Further, // it does not set the socket options TCP_NODELAY and TCP_NODELACK which // can lead to performance problems. // // The bug will be fixed in V5.6 ECO4 and beyond. In the meantime, we'll // create the socket pair manually. struct sockaddr_in lcladdr; memset (&lcladdr, 0, sizeof lcladdr); lcladdr.sin_family = AF_INET; lcladdr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); lcladdr.sin_port = 0; int listener = open_socket (AF_INET, SOCK_STREAM, 0); errno_assert (listener != -1); int on = 1; int rc = setsockopt (listener, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on); errno_assert (rc != -1); rc = setsockopt (listener, IPPROTO_TCP, TCP_NODELACK, &on, sizeof on); errno_assert (rc != -1); rc = bind (listener, (struct sockaddr *) &lcladdr, sizeof lcladdr); errno_assert (rc != -1); socklen_t lcladdr_len = sizeof lcladdr; rc = getsockname (listener, (struct sockaddr *) &lcladdr, &lcladdr_len); errno_assert (rc != -1); rc = listen (listener, 1); errno_assert (rc != -1); *w_ = open_socket (AF_INET, SOCK_STREAM, 0); errno_assert (*w_ != -1); rc = setsockopt (*w_, IPPROTO_TCP, TCP_NODELAY, &on, sizeof on); errno_assert (rc != -1); rc = setsockopt (*w_, IPPROTO_TCP, TCP_NODELACK, &on, sizeof on); errno_assert (rc != -1); rc = connect (*w_, (struct sockaddr *) &lcladdr, sizeof lcladdr); errno_assert (rc != -1); *r_ = accept (listener, NULL, NULL); errno_assert (*r_ != -1); close (listener); return 0; #elif defined ZMQ_HAVE_VXWORKS struct sockaddr_in lcladdr; memset (&lcladdr, 0, sizeof lcladdr); lcladdr.sin_family = AF_INET; lcladdr.sin_addr.s_addr = htonl (INADDR_LOOPBACK); lcladdr.sin_port = 0; int listener = open_socket (AF_INET, SOCK_STREAM, 0); errno_assert (listener != -1); int on = 1; int rc = setsockopt (listener, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof on); errno_assert (rc != -1); rc = bind (listener, (struct sockaddr *) &lcladdr, sizeof lcladdr); errno_assert (rc != -1); socklen_t lcladdr_len = sizeof lcladdr; rc = getsockname (listener, (struct sockaddr *) &lcladdr, (int *) &lcladdr_len); errno_assert (rc != -1); rc = listen (listener, 1); errno_assert (rc != -1); *w_ = open_socket (AF_INET, SOCK_STREAM, 0); errno_assert (*w_ != -1); rc = setsockopt (*w_, IPPROTO_TCP, TCP_NODELAY, (char *) &on, sizeof on); errno_assert (rc != -1); rc = connect (*w_, (struct sockaddr *) &lcladdr, sizeof lcladdr); errno_assert (rc != -1); *r_ = accept (listener, NULL, NULL); errno_assert (*r_ != -1); close (listener); return 0; #else // All other implementations support socketpair() int sv[2]; int type = SOCK_STREAM; // Setting this option result in sane behaviour when exec() functions // are used. Old sockets are closed and don't block TCP ports, avoid // leaks, etc. #if defined ZMQ_HAVE_SOCK_CLOEXEC type |= SOCK_CLOEXEC; #endif int rc = socketpair (AF_UNIX, type, 0, sv); if (rc == -1) { errno_assert (errno == ENFILE || errno == EMFILE); *w_ = *r_ = -1; return -1; } else { // If there's no SOCK_CLOEXEC, let's try the second best option. Note that // race condition can cause socket not to be closed (if fork happens // between socket creation and this point). #if !defined ZMQ_HAVE_SOCK_CLOEXEC && defined FD_CLOEXEC rc = fcntl (sv[0], F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); rc = fcntl (sv[1], F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif *w_ = sv[0]; *r_ = sv[1]; return 0; } #endif } zeromq-4.2.5/src/raw_encoder.hpp0000664000372000037200000000376013255253220017536 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_RAW_ENCODER_HPP_INCLUDED__ #define __ZMQ_RAW_ENCODER_HPP_INCLUDED__ #include #include #include #include #include "err.hpp" #include "msg.hpp" #include "i_encoder.hpp" namespace zmq { // Encoder for 0MQ framing protocol. Converts messages into data batches. class raw_encoder_t : public encoder_base_t { public: raw_encoder_t (size_t bufsize_); ~raw_encoder_t (); private: void raw_message_ready (); raw_encoder_t (const raw_encoder_t &); const raw_encoder_t &operator= (const raw_encoder_t &); }; } #endif zeromq-4.2.5/src/tcp.cpp0000664000372000037200000002770513255253220016034 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "ip.hpp" #include "tcp.hpp" #include "err.hpp" #if !defined ZMQ_HAVE_WINDOWS #include #include #include #include #include #ifdef ZMQ_HAVE_VXWORKS #include #endif #endif #if defined ZMQ_HAVE_OPENVMS #include #endif int zmq::tune_tcp_socket (fd_t s_) { // Disable Nagle's algorithm. We are doing data batching on 0MQ level, // so using Nagle wouldn't improve throughput in anyway, but it would // hurt latency. int nodelay = 1; int rc = setsockopt (s_, IPPROTO_TCP, TCP_NODELAY, (char *) &nodelay, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; #ifdef ZMQ_HAVE_OPENVMS // Disable delayed acknowledgements as they hurt latency significantly. int nodelack = 1; rc = setsockopt (s_, IPPROTO_TCP, TCP_NODELACK, (char *) &nodelack, sizeof (int)); tcp_assert_tuning_error (s_, rc); #endif return rc; } int zmq::set_tcp_send_buffer (fd_t sockfd_, int bufsize_) { const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_SNDBUF, (char *) &bufsize_, sizeof bufsize_); tcp_assert_tuning_error (sockfd_, rc); return rc; } int zmq::set_tcp_receive_buffer (fd_t sockfd_, int bufsize_) { const int rc = setsockopt (sockfd_, SOL_SOCKET, SO_RCVBUF, (char *) &bufsize_, sizeof bufsize_); tcp_assert_tuning_error (sockfd_, rc); return rc; } int zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_) { // These options are used only under certain #ifdefs below. LIBZMQ_UNUSED (keepalive_); LIBZMQ_UNUSED (keepalive_cnt_); LIBZMQ_UNUSED (keepalive_idle_); LIBZMQ_UNUSED (keepalive_intvl_); // If none of the #ifdefs apply, then s_ is unused. LIBZMQ_UNUSED (s_); // Tuning TCP keep-alives if platform allows it // All values = -1 means skip and leave it for OS #ifdef ZMQ_HAVE_WINDOWS if (keepalive_ != -1) { tcp_keepalive keepalive_opts; keepalive_opts.onoff = keepalive_; keepalive_opts.keepalivetime = keepalive_idle_ != -1 ? keepalive_idle_ * 1000 : 7200000; keepalive_opts.keepaliveinterval = keepalive_intvl_ != -1 ? keepalive_intvl_ * 1000 : 1000; DWORD num_bytes_returned; int rc = WSAIoctl (s_, SIO_KEEPALIVE_VALS, &keepalive_opts, sizeof (keepalive_opts), NULL, 0, &num_bytes_returned, NULL, NULL); tcp_assert_tuning_error (s_, rc); if (rc == SOCKET_ERROR) return rc; } #else #ifdef ZMQ_HAVE_SO_KEEPALIVE if (keepalive_ != -1) { int rc = setsockopt (s_, SOL_SOCKET, SO_KEEPALIVE, (char *) &keepalive_, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; #ifdef ZMQ_HAVE_TCP_KEEPCNT if (keepalive_cnt_ != -1) { int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPCNT, &keepalive_cnt_, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; } #endif // ZMQ_HAVE_TCP_KEEPCNT #ifdef ZMQ_HAVE_TCP_KEEPIDLE if (keepalive_idle_ != -1) { int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPIDLE, &keepalive_idle_, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; } #else // ZMQ_HAVE_TCP_KEEPIDLE #ifdef ZMQ_HAVE_TCP_KEEPALIVE if (keepalive_idle_ != -1) { int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPALIVE, &keepalive_idle_, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; } #endif // ZMQ_HAVE_TCP_KEEPALIVE #endif // ZMQ_HAVE_TCP_KEEPIDLE #ifdef ZMQ_HAVE_TCP_KEEPINTVL if (keepalive_intvl_ != -1) { int rc = setsockopt (s_, IPPROTO_TCP, TCP_KEEPINTVL, &keepalive_intvl_, sizeof (int)); tcp_assert_tuning_error (s_, rc); if (rc != 0) return rc; } #endif // ZMQ_HAVE_TCP_KEEPINTVL } #endif // ZMQ_HAVE_SO_KEEPALIVE #endif // ZMQ_HAVE_WINDOWS return 0; } int zmq::tune_tcp_maxrt (fd_t sockfd_, int timeout_) { if (timeout_ <= 0) return 0; LIBZMQ_UNUSED (sockfd_); #if defined(ZMQ_HAVE_WINDOWS) && defined(TCP_MAXRT) // msdn says it's supported in >= Vista, >= Windows Server 2003 timeout_ /= 1000; // in seconds int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_MAXRT, (char *) &timeout_, sizeof (timeout_)); tcp_assert_tuning_error (sockfd_, rc); return rc; // FIXME: should be ZMQ_HAVE_TCP_USER_TIMEOUT #elif defined(TCP_USER_TIMEOUT) int rc = setsockopt (sockfd_, IPPROTO_TCP, TCP_USER_TIMEOUT, &timeout_, sizeof (timeout_)); tcp_assert_tuning_error (sockfd_, rc); return rc; #endif return 0; } int zmq::tcp_write (fd_t s_, const void *data_, size_t size_) { #ifdef ZMQ_HAVE_WINDOWS int nbytes = send (s_, (char *) data_, (int) size_, 0); // If not a single byte can be written to the socket in non-blocking mode // we'll get an error (this may happen during the speculative write). const int last_error = WSAGetLastError (); if (nbytes == SOCKET_ERROR && last_error == WSAEWOULDBLOCK) return 0; // Signalise peer failure. if (nbytes == SOCKET_ERROR && (last_error == WSAENETDOWN || last_error == WSAENETRESET || last_error == WSAEHOSTUNREACH || last_error == WSAECONNABORTED || last_error == WSAETIMEDOUT || last_error == WSAECONNRESET)) return -1; // Circumvent a Windows bug: // See https://support.microsoft.com/en-us/kb/201213 // See https://zeromq.jira.com/browse/LIBZMQ-195 if (nbytes == SOCKET_ERROR && last_error == WSAENOBUFS) return 0; wsa_assert (nbytes != SOCKET_ERROR); return nbytes; #else ssize_t nbytes = send (s_, (char *) data_, size_, 0); // Several errors are OK. When speculative write is being done we may not // be able to write a single byte from the socket. Also, SIGSTOP issued // by a debugging tool can result in EINTR error. if (nbytes == -1 && (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)) return 0; // Signalise peer failure. if (nbytes == -1) { errno_assert (errno != EACCES && errno != EBADF && errno != EDESTADDRREQ && errno != EFAULT && errno != EISCONN && errno != EMSGSIZE && errno != ENOMEM && errno != ENOTSOCK && errno != EOPNOTSUPP); return -1; } return static_cast (nbytes); #endif } int zmq::tcp_read (fd_t s_, void *data_, size_t size_) { #ifdef ZMQ_HAVE_WINDOWS const int rc = recv (s_, (char *) data_, (int) size_, 0); // If not a single byte can be read from the socket in non-blocking mode // we'll get an error (this may happen during the speculative read). if (rc == SOCKET_ERROR) { const int last_error = WSAGetLastError (); if (last_error == WSAEWOULDBLOCK) { errno = EAGAIN; } else { wsa_assert ( last_error == WSAENETDOWN || last_error == WSAENETRESET || last_error == WSAECONNABORTED || last_error == WSAETIMEDOUT || last_error == WSAECONNRESET || last_error == WSAECONNREFUSED || last_error == WSAENOTCONN); errno = wsa_error_to_errno (last_error); } } return rc == SOCKET_ERROR ? -1 : rc; #else const ssize_t rc = recv (s_, (char *) data_, size_, 0); // Several errors are OK. When speculative read is being done we may not // be able to read a single byte from the socket. Also, SIGSTOP issued // by a debugging tool can result in EINTR error. if (rc == -1) { errno_assert (errno != EBADF && errno != EFAULT && errno != ENOMEM && errno != ENOTSOCK); if (errno == EWOULDBLOCK || errno == EINTR) errno = EAGAIN; } return static_cast (rc); #endif } void zmq::tcp_assert_tuning_error (zmq::fd_t s_, int rc_) { if (rc_ == 0) return; // Check whether an error occurred int err = 0; #if defined ZMQ_HAVE_HPUX || defined ZMQ_HAVE_VXWORKS int len = sizeof err; #else socklen_t len = sizeof err; #endif int rc = getsockopt (s_, SOL_SOCKET, SO_ERROR, (char *) &err, &len); // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. #ifdef ZMQ_HAVE_WINDOWS zmq_assert (rc == 0); if (err != 0) { wsa_assert (err == WSAECONNREFUSED || err == WSAECONNRESET || err == WSAECONNABORTED || err == WSAEINTR || err == WSAETIMEDOUT || err == WSAEHOSTUNREACH || err == WSAENETUNREACH || err == WSAENETDOWN || err == WSAENETRESET || err == WSAEACCES || err == WSAEINVAL || err == WSAEADDRINUSE); } #else // Following code should handle both Berkeley-derived socket // implementations and Solaris. if (rc == -1) err = errno; if (err != 0) { errno = err; errno_assert (errno == ECONNREFUSED || errno == ECONNRESET || errno == ECONNABORTED || errno == EINTR || errno == ETIMEDOUT || errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN || errno == ENETRESET || errno == EINVAL); } #endif } void zmq::tcp_tune_loopback_fast_path (const fd_t socket_) { #if defined ZMQ_HAVE_WINDOWS && defined SIO_LOOPBACK_FAST_PATH int sio_loopback_fastpath = 1; DWORD numberOfBytesReturned = 0; int rc = WSAIoctl (socket_, SIO_LOOPBACK_FAST_PATH, &sio_loopback_fastpath, sizeof sio_loopback_fastpath, NULL, 0, &numberOfBytesReturned, 0, 0); if (SOCKET_ERROR == rc) { DWORD lastError = ::WSAGetLastError (); if (WSAEOPNOTSUPP == lastError) { // This system is not Windows 8 or Server 2012, and the call is not supported. } else { wsa_assert (false); } } #else LIBZMQ_UNUSED (socket_); #endif } zeromq-4.2.5/src/stdint.hpp0000664000372000037200000000421313255253220016545 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_STDINT_HPP_INCLUDED__ #define __ZMQ_STDINT_HPP_INCLUDED__ #if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS #include #elif defined _MSC_VER && _MSC_VER < 1600 #ifndef int8_t typedef __int8 int8_t; #endif #ifndef int16_t typedef __int16 int16_t; #endif #ifndef int32_t typedef __int32 int32_t; #endif #ifndef int64_t typedef __int64 int64_t; #endif #ifndef uint8_t typedef unsigned __int8 uint8_t; #endif #ifndef uint16_t typedef unsigned __int16 uint16_t; #endif #ifndef uint32_t typedef unsigned __int32 uint32_t; #endif #ifndef uint64_t typedef unsigned __int64 uint64_t; #endif #ifndef UINT32_MAX #define UINT32_MAX _UI32_MAX #endif #else #include #endif #ifndef UINT8_MAX #define UINT8_MAX 0xFF #endif #endif zeromq-4.2.5/src/dealer.cpp0000664000372000037200000000715413255253220016476 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "dealer.hpp" #include "err.hpp" #include "msg.hpp" zmq::dealer_t::dealer_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), probe_router (false) { options.type = ZMQ_DEALER; } zmq::dealer_t::~dealer_t () { } void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); if (probe_router) { msg_t probe_msg_; int rc = probe_msg_.init (); errno_assert (rc == 0); rc = pipe_->write (&probe_msg_); // zmq_assert (rc) is not applicable here, since it is not a bug. pipe_->flush (); rc = probe_msg_.close (); errno_assert (rc == 0); } fq.attach (pipe_); lb.attach (pipe_); } int zmq::dealer_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { bool is_int = (optvallen_ == sizeof (int)); int value = 0; if (is_int) memcpy (&value, optval_, sizeof (int)); switch (option_) { case ZMQ_PROBE_ROUTER: if (is_int && value >= 0) { probe_router = (value != 0); return 0; } break; default: break; } errno = EINVAL; return -1; } int zmq::dealer_t::xsend (msg_t *msg_) { return sendpipe (msg_, NULL); } int zmq::dealer_t::xrecv (msg_t *msg_) { return recvpipe (msg_, NULL); } bool zmq::dealer_t::xhas_in () { return fq.has_in (); } bool zmq::dealer_t::xhas_out () { return lb.has_out (); } const zmq::blob_t &zmq::dealer_t::get_credential () const { return fq.get_credential (); } void zmq::dealer_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::dealer_t::xwrite_activated (pipe_t *pipe_) { lb.activated (pipe_); } void zmq::dealer_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); lb.pipe_terminated (pipe_); } int zmq::dealer_t::sendpipe (msg_t *msg_, pipe_t **pipe_) { return lb.sendpipe (msg_, pipe_); } int zmq::dealer_t::recvpipe (msg_t *msg_, pipe_t **pipe_) { return fq.recvpipe (msg_, pipe_); } zeromq-4.2.5/src/mailbox_safe.hpp0000664000372000037200000000572313255253220017700 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MAILBOX_SAFE_HPP_INCLUDED__ #define __ZMQ_MAILBOX_SAFE_HPP_INCLUDED__ #include #include #include "signaler.hpp" #include "fd.hpp" #include "config.hpp" #include "command.hpp" #include "ypipe.hpp" #include "mutex.hpp" #include "i_mailbox.hpp" #include "condition_variable.hpp" namespace zmq { class mailbox_safe_t : public i_mailbox { public: mailbox_safe_t (mutex_t *sync_); ~mailbox_safe_t (); void send (const command_t &cmd_); int recv (command_t *cmd_, int timeout_); // Add signaler to mailbox which will be called when a message is ready void add_signaler (signaler_t *signaler); void remove_signaler (signaler_t *signaler); void clear_signalers (); #ifdef HAVE_FORK // close the file descriptors in the signaller. This is used in a forked // child process to close the file descriptors so that they do not interfere // with the context in the parent process. void forked () { // TODO: call fork on the condition variable } #endif private: // The pipe to store actual commands. typedef ypipe_t cpipe_t; cpipe_t cpipe; // Condition variable to pass signals from writer thread to reader thread. condition_variable_t cond_var; // Synchronize access to the mailbox from receivers and senders mutex_t *const sync; std::vector signalers; // Disable copying of mailbox_t object. mailbox_safe_t (const mailbox_safe_t &); const mailbox_safe_t &operator= (const mailbox_safe_t &); }; } #endif zeromq-4.2.5/src/socket_base.cpp0000664000372000037200000014741513255253220017531 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include #include "macros.hpp" #if defined ZMQ_HAVE_WINDOWS #if defined _MSC_VER #if defined _WIN32_WCE #include #else #include #endif #endif #else #include #include #endif #include "socket_base.hpp" #include "tcp_listener.hpp" #include "ipc_listener.hpp" #include "tipc_listener.hpp" #include "tcp_connecter.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "config.hpp" #include "pipe.hpp" #include "err.hpp" #include "ctx.hpp" #include "likely.hpp" #include "msg.hpp" #include "address.hpp" #include "ipc_address.hpp" #include "tcp_address.hpp" #include "udp_address.hpp" #include "tipc_address.hpp" #include "mailbox.hpp" #include "mailbox_safe.hpp" #if defined ZMQ_HAVE_VMCI #include "vmci_address.hpp" #include "vmci_listener.hpp" #endif #ifdef ZMQ_HAVE_OPENPGM #include "pgm_socket.hpp" #endif #include "pair.hpp" #include "pub.hpp" #include "sub.hpp" #include "req.hpp" #include "rep.hpp" #include "pull.hpp" #include "push.hpp" #include "dealer.hpp" #include "router.hpp" #include "xpub.hpp" #include "xsub.hpp" #include "stream.hpp" #include "server.hpp" #include "client.hpp" #include "radio.hpp" #include "dish.hpp" #include "gather.hpp" #include "scatter.hpp" #include "dgram.hpp" bool zmq::socket_base_t::check_tag () { return tag == 0xbaddecaf; } zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_, uint32_t tid_, int sid_) { socket_base_t *s = NULL; switch (type_) { case ZMQ_PAIR: s = new (std::nothrow) pair_t (parent_, tid_, sid_); break; case ZMQ_PUB: s = new (std::nothrow) pub_t (parent_, tid_, sid_); break; case ZMQ_SUB: s = new (std::nothrow) sub_t (parent_, tid_, sid_); break; case ZMQ_REQ: s = new (std::nothrow) req_t (parent_, tid_, sid_); break; case ZMQ_REP: s = new (std::nothrow) rep_t (parent_, tid_, sid_); break; case ZMQ_DEALER: s = new (std::nothrow) dealer_t (parent_, tid_, sid_); break; case ZMQ_ROUTER: s = new (std::nothrow) router_t (parent_, tid_, sid_); break; case ZMQ_PULL: s = new (std::nothrow) pull_t (parent_, tid_, sid_); break; case ZMQ_PUSH: s = new (std::nothrow) push_t (parent_, tid_, sid_); break; case ZMQ_XPUB: s = new (std::nothrow) xpub_t (parent_, tid_, sid_); break; case ZMQ_XSUB: s = new (std::nothrow) xsub_t (parent_, tid_, sid_); break; case ZMQ_STREAM: s = new (std::nothrow) stream_t (parent_, tid_, sid_); break; case ZMQ_SERVER: s = new (std::nothrow) server_t (parent_, tid_, sid_); break; case ZMQ_CLIENT: s = new (std::nothrow) client_t (parent_, tid_, sid_); break; case ZMQ_RADIO: s = new (std::nothrow) radio_t (parent_, tid_, sid_); break; case ZMQ_DISH: s = new (std::nothrow) dish_t (parent_, tid_, sid_); break; case ZMQ_GATHER: s = new (std::nothrow) gather_t (parent_, tid_, sid_); break; case ZMQ_SCATTER: s = new (std::nothrow) scatter_t (parent_, tid_, sid_); break; case ZMQ_DGRAM: s = new (std::nothrow) dgram_t (parent_, tid_, sid_); break; default: errno = EINVAL; return NULL; } alloc_assert (s); if (s->mailbox == NULL) { s->destroyed = true; LIBZMQ_DELETE (s); return NULL; } return s; } zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_, int sid_, bool thread_safe_) : own_t (parent_, tid_), tag (0xbaddecaf), ctx_terminated (false), destroyed (false), poller (NULL), handle ((poller_t::handle_t) NULL), last_tsc (0), ticks (0), rcvmore (false), monitor_socket (NULL), monitor_events (0), thread_safe (thread_safe_), reaper_signaler (NULL), sync (), monitor_sync () { options.socket_id = sid_; options.ipv6 = (parent_->get (ZMQ_IPV6) != 0); options.linger.store (parent_->get (ZMQ_BLOCKY) ? -1 : 0); options.zero_copy = parent_->get (ZMQ_ZERO_COPY_RECV); if (thread_safe) { mailbox = new (std::nothrow) mailbox_safe_t (&sync); zmq_assert (mailbox); } else { mailbox_t *m = new (std::nothrow) mailbox_t (); zmq_assert (m); if (m->get_fd () != retired_fd) mailbox = m; else { LIBZMQ_DELETE (m); mailbox = NULL; } } } int zmq::socket_base_t::get_peer_state (const void *routing_id_, size_t routing_id_size_) const { LIBZMQ_UNUSED (routing_id_); LIBZMQ_UNUSED (routing_id_size_); // Only ROUTER sockets support this errno = ENOTSUP; return -1; } zmq::socket_base_t::~socket_base_t () { if (mailbox) LIBZMQ_DELETE (mailbox); if (reaper_signaler) LIBZMQ_DELETE (reaper_signaler); scoped_lock_t lock (monitor_sync); stop_monitor (); zmq_assert (destroyed); } zmq::i_mailbox *zmq::socket_base_t::get_mailbox () { return mailbox; } void zmq::socket_base_t::stop () { // Called by ctx when it is terminated (zmq_ctx_term). // 'stop' command is sent from the threads that called zmq_ctx_term to // the thread owning the socket. This way, blocking call in the // owner thread can be interrupted. send_stop (); } int zmq::socket_base_t::parse_uri (const char *uri_, std::string &protocol_, std::string &address_) { zmq_assert (uri_ != NULL); std::string uri (uri_); std::string::size_type pos = uri.find ("://"); if (pos == std::string::npos) { errno = EINVAL; return -1; } protocol_ = uri.substr (0, pos); address_ = uri.substr (pos + 3); if (protocol_.empty () || address_.empty ()) { errno = EINVAL; return -1; } return 0; } int zmq::socket_base_t::check_protocol (const std::string &protocol_) { // First check out whether the protocol is something we are aware of. if (protocol_ != "inproc" #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS && protocol_ != "ipc" #endif && protocol_ != "tcp" #if defined ZMQ_HAVE_OPENPGM // pgm/epgm transports only available if 0MQ is compiled with OpenPGM. && protocol_ != "pgm" && protocol_ != "epgm" #endif #if defined ZMQ_HAVE_TIPC // TIPC transport is only available on Linux. && protocol_ != "tipc" #endif #if defined ZMQ_HAVE_NORM && protocol_ != "norm" #endif #if defined ZMQ_HAVE_VMCI && protocol_ != "vmci" #endif && protocol_ != "udp") { errno = EPROTONOSUPPORT; return -1; } // Check whether socket type and transport protocol match. // Specifically, multicast protocols can't be combined with // bi-directional messaging patterns (socket types). #if defined ZMQ_HAVE_OPENPGM || defined ZMQ_HAVE_NORM if ((protocol_ == "pgm" || protocol_ == "epgm" || protocol_ == "norm") && options.type != ZMQ_PUB && options.type != ZMQ_SUB && options.type != ZMQ_XPUB && options.type != ZMQ_XSUB) { errno = ENOCOMPATPROTO; return -1; } #endif if (protocol_ == "udp" && (options.type != ZMQ_DISH && options.type != ZMQ_RADIO && options.type != ZMQ_DGRAM)) { errno = ENOCOMPATPROTO; return -1; } // Protocol is available. return 0; } void zmq::socket_base_t::attach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { // First, register the pipe so that we can terminate it later on. pipe_->set_event_sink (this); pipes.push_back (pipe_); // Let the derived socket type know about new pipe. xattach_pipe (pipe_, subscribe_to_all_); // If the socket is already being closed, ask any new pipes to terminate // straight away. if (is_terminating ()) { register_term_acks (1); pipe_->terminate (false); } } int zmq::socket_base_t::setsockopt (int option_, const void *optval_, size_t optvallen_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); if (!options.is_valid (option_)) { errno = EINVAL; return -1; } if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // First, check whether specific socket type overloads the option. int rc = xsetsockopt (option_, optval_, optvallen_); if (rc == 0 || errno != EINVAL) { return rc; } // If the socket type doesn't support the option, pass it to // the generic option parser. rc = options.setsockopt (option_, optval_, optvallen_); update_pipe_options (option_); return rc; } int zmq::socket_base_t::getsockopt (int option_, void *optval_, size_t *optvallen_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } if (option_ == ZMQ_RCVMORE) { return do_getsockopt (optval_, optvallen_, rcvmore ? 1 : 0); } if (option_ == ZMQ_FD) { if (thread_safe) { // thread safe socket doesn't provide file descriptor errno = EINVAL; return -1; } return do_getsockopt (optval_, optvallen_, ((mailbox_t *) mailbox)->get_fd ()); } if (option_ == ZMQ_EVENTS) { int rc = process_commands (0, false); if (rc != 0 && (errno == EINTR || errno == ETERM)) { return -1; } errno_assert (rc == 0); return do_getsockopt (optval_, optvallen_, (has_out () ? ZMQ_POLLOUT : 0) | (has_in () ? ZMQ_POLLIN : 0)); } if (option_ == ZMQ_LAST_ENDPOINT) { return do_getsockopt (optval_, optvallen_, last_endpoint); } if (option_ == ZMQ_THREAD_SAFE) { return do_getsockopt (optval_, optvallen_, thread_safe ? 1 : 0); } return options.getsockopt (option_, optval_, optvallen_); } int zmq::socket_base_t::join (const char *group_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); int rc = xjoin (group_); return rc; } int zmq::socket_base_t::leave (const char *group_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); int rc = xleave (group_); return rc; } void zmq::socket_base_t::add_signaler (signaler_t *s_) { zmq_assert (thread_safe); scoped_lock_t sync_lock (sync); ((mailbox_safe_t *) mailbox)->add_signaler (s_); } void zmq::socket_base_t::remove_signaler (signaler_t *s_) { zmq_assert (thread_safe); scoped_lock_t sync_lock (sync); ((mailbox_safe_t *) mailbox)->remove_signaler (s_); } int zmq::socket_base_t::bind (const char *addr_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Process pending commands, if any. int rc = process_commands (0, false); if (unlikely (rc != 0)) { return -1; } // Parse addr_ string. std::string protocol; std::string address; if (parse_uri (addr_, protocol, address) || check_protocol (protocol)) { return -1; } if (protocol == "inproc") { const endpoint_t endpoint = {this, options}; rc = register_endpoint (addr_, endpoint); if (rc == 0) { connect_pending (addr_, this); last_endpoint.assign (addr_); options.connected = true; } return rc; } if (protocol == "pgm" || protocol == "epgm" || protocol == "norm") { // For convenience's sake, bind can be used interchangeable with // connect for PGM, EPGM, NORM transports. rc = connect (addr_); if (rc != -1) options.connected = true; return rc; } if (protocol == "udp") { if (!(options.type == ZMQ_DGRAM || options.type == ZMQ_DISH)) { errno = ENOCOMPATPROTO; return -1; } // Choose the I/O thread to run the session in. io_thread_t *io_thread = choose_io_thread (options.affinity); if (!io_thread) { errno = EMTHREAD; return -1; } address_t *paddr = new (std::nothrow) address_t (protocol, address, this->get_ctx ()); alloc_assert (paddr); paddr->resolved.udp_addr = new (std::nothrow) udp_address_t (); alloc_assert (paddr->resolved.udp_addr); rc = paddr->resolved.udp_addr->resolve (address.c_str (), true); if (rc != 0) { LIBZMQ_DELETE (paddr); return -1; } session_base_t *session = session_base_t::create (io_thread, true, this, options, paddr); errno_assert (session); pipe_t *newpipe = NULL; // Create a bi-directional pipe. object_t *parents[2] = {this, session}; pipe_t *new_pipes[2] = {NULL, NULL}; int hwms[2] = {options.sndhwm, options.rcvhwm}; bool conflates[2] = {false, false}; rc = pipepair (parents, new_pipes, hwms, conflates); errno_assert (rc == 0); // Attach local end of the pipe to the socket object. attach_pipe (new_pipes[0], true); newpipe = new_pipes[0]; // Attach remote end of the pipe to the session object later on. session->attach_pipe (new_pipes[1]); // Save last endpoint URI paddr->to_string (last_endpoint); add_endpoint (addr_, (own_t *) session, newpipe); return 0; } // Remaining transports require to be run in an I/O thread, so at this // point we'll choose one. io_thread_t *io_thread = choose_io_thread (options.affinity); if (!io_thread) { errno = EMTHREAD; return -1; } if (protocol == "tcp") { tcp_listener_t *listener = new (std::nothrow) tcp_listener_t (io_thread, this, options); alloc_assert (listener); rc = listener->set_address (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (listener); event_bind_failed (address, zmq_errno ()); return -1; } // Save last endpoint URI listener->get_address (last_endpoint); add_endpoint (last_endpoint.c_str (), (own_t *) listener, NULL); options.connected = true; return 0; } #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS if (protocol == "ipc") { ipc_listener_t *listener = new (std::nothrow) ipc_listener_t (io_thread, this, options); alloc_assert (listener); int rc = listener->set_address (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (listener); event_bind_failed (address, zmq_errno ()); return -1; } // Save last endpoint URI listener->get_address (last_endpoint); add_endpoint (last_endpoint.c_str (), (own_t *) listener, NULL); options.connected = true; return 0; } #endif #if defined ZMQ_HAVE_TIPC if (protocol == "tipc") { tipc_listener_t *listener = new (std::nothrow) tipc_listener_t (io_thread, this, options); alloc_assert (listener); int rc = listener->set_address (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (listener); event_bind_failed (address, zmq_errno ()); return -1; } // Save last endpoint URI listener->get_address (last_endpoint); add_endpoint (addr_, (own_t *) listener, NULL); options.connected = true; return 0; } #endif #if defined ZMQ_HAVE_VMCI if (protocol == "vmci") { vmci_listener_t *listener = new (std::nothrow) vmci_listener_t (io_thread, this, options); alloc_assert (listener); int rc = listener->set_address (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (listener); event_bind_failed (address, zmq_errno ()); return -1; } listener->get_address (last_endpoint); add_endpoint (last_endpoint.c_str (), (own_t *) listener, NULL); options.connected = true; return 0; } #endif zmq_assert (false); return -1; } int zmq::socket_base_t::connect (const char *addr_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Process pending commands, if any. int rc = process_commands (0, false); if (unlikely (rc != 0)) { return -1; } // Parse addr_ string. std::string protocol; std::string address; if (parse_uri (addr_, protocol, address) || check_protocol (protocol)) { return -1; } if (protocol == "inproc") { // TODO: inproc connect is specific with respect to creating pipes // as there's no 'reconnect' functionality implemented. Once that // is in place we should follow generic pipe creation algorithm. // Find the peer endpoint. endpoint_t peer = find_endpoint (addr_); // The total HWM for an inproc connection should be the sum of // the binder's HWM and the connector's HWM. int sndhwm = 0; if (peer.socket == NULL) sndhwm = options.sndhwm; else if (options.sndhwm != 0 && peer.options.rcvhwm != 0) sndhwm = options.sndhwm + peer.options.rcvhwm; int rcvhwm = 0; if (peer.socket == NULL) rcvhwm = options.rcvhwm; else if (options.rcvhwm != 0 && peer.options.sndhwm != 0) rcvhwm = options.rcvhwm + peer.options.sndhwm; // Create a bi-directional pipe to connect the peers. object_t *parents[2] = {this, peer.socket == NULL ? this : peer.socket}; pipe_t *new_pipes[2] = {NULL, NULL}; bool conflate = options.conflate && (options.type == ZMQ_DEALER || options.type == ZMQ_PULL || options.type == ZMQ_PUSH || options.type == ZMQ_PUB || options.type == ZMQ_SUB); int hwms[2] = {conflate ? -1 : sndhwm, conflate ? -1 : rcvhwm}; bool conflates[2] = {conflate, conflate}; rc = pipepair (parents, new_pipes, hwms, conflates); if (!conflate) { new_pipes[0]->set_hwms_boost (peer.options.sndhwm, peer.options.rcvhwm); new_pipes[1]->set_hwms_boost (options.sndhwm, options.rcvhwm); } errno_assert (rc == 0); if (!peer.socket) { // The peer doesn't exist yet so we don't know whether // to send the routing id message or not. To resolve this, // we always send our routing id and drop it later if // the peer doesn't expect it. msg_t id; rc = id.init_size (options.routing_id_size); errno_assert (rc == 0); memcpy (id.data (), options.routing_id, options.routing_id_size); id.set_flags (msg_t::routing_id); bool written = new_pipes[0]->write (&id); zmq_assert (written); new_pipes[0]->flush (); const endpoint_t endpoint = {this, options}; pend_connection (std::string (addr_), endpoint, new_pipes); } else { // If required, send the routing id of the local socket to the peer. if (peer.options.recv_routing_id) { msg_t id; rc = id.init_size (options.routing_id_size); errno_assert (rc == 0); memcpy (id.data (), options.routing_id, options.routing_id_size); id.set_flags (msg_t::routing_id); bool written = new_pipes[0]->write (&id); zmq_assert (written); new_pipes[0]->flush (); } // If required, send the routing id of the peer to the local socket. if (options.recv_routing_id) { msg_t id; rc = id.init_size (peer.options.routing_id_size); errno_assert (rc == 0); memcpy (id.data (), peer.options.routing_id, peer.options.routing_id_size); id.set_flags (msg_t::routing_id); bool written = new_pipes[1]->write (&id); zmq_assert (written); new_pipes[1]->flush (); } // Attach remote end of the pipe to the peer socket. Note that peer's // seqnum was incremented in find_endpoint function. We don't need it // increased here. send_bind (peer.socket, new_pipes[1], false); } // Attach local end of the pipe to this socket object. attach_pipe (new_pipes[0]); // Save last endpoint URI last_endpoint.assign (addr_); // remember inproc connections for disconnect inprocs.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, new_pipes[0]); options.connected = true; return 0; } bool is_single_connect = (options.type == ZMQ_DEALER || options.type == ZMQ_SUB || options.type == ZMQ_PUB || options.type == ZMQ_REQ); if (unlikely (is_single_connect)) { const endpoints_t::iterator it = endpoints.find (addr_); if (it != endpoints.end ()) { // There is no valid use for multiple connects for SUB-PUB nor // DEALER-ROUTER nor REQ-REP. Multiple connects produces // nonsensical results. return 0; } } // Choose the I/O thread to run the session in. io_thread_t *io_thread = choose_io_thread (options.affinity); if (!io_thread) { errno = EMTHREAD; return -1; } address_t *paddr = new (std::nothrow) address_t (protocol, address, this->get_ctx ()); alloc_assert (paddr); // Resolve address (if needed by the protocol) if (protocol == "tcp") { // Do some basic sanity checks on tcp:// address syntax // - hostname starts with digit or letter, with embedded '-' or '.' // - IPv6 address may contain hex chars and colons. // - IPv6 link local address may contain % followed by interface name / zone_id // (Reference: https://tools.ietf.org/html/rfc4007) // - IPv4 address may contain decimal digits and dots. // - Address must end in ":port" where port is *, or numeric // - Address may contain two parts separated by ':' // Following code is quick and dirty check to catch obvious errors, // without trying to be fully accurate. const char *check = address.c_str (); if (isalnum (*check) || isxdigit (*check) || *check == '[' || *check == ':') { check++; while (isalnum (*check) || isxdigit (*check) || *check == '.' || *check == '-' || *check == ':' || *check == '%' || *check == ';' || *check == '[' || *check == ']' || *check == '_' || *check == '*') { check++; } } // Assume the worst, now look for success rc = -1; // Did we reach the end of the address safely? if (*check == 0) { // Do we have a valid port string? (cannot be '*' in connect check = strrchr (address.c_str (), ':'); if (check) { check++; if (*check && (isdigit (*check))) rc = 0; // Valid } } if (rc == -1) { errno = EINVAL; LIBZMQ_DELETE (paddr); return -1; } // Defer resolution until a socket is opened paddr->resolved.tcp_addr = NULL; } #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS else if (protocol == "ipc") { paddr->resolved.ipc_addr = new (std::nothrow) ipc_address_t (); alloc_assert (paddr->resolved.ipc_addr); int rc = paddr->resolved.ipc_addr->resolve (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (paddr); return -1; } } #endif if (protocol == "udp") { if (options.type != ZMQ_RADIO) { errno = ENOCOMPATPROTO; LIBZMQ_DELETE (paddr); return -1; } paddr->resolved.udp_addr = new (std::nothrow) udp_address_t (); alloc_assert (paddr->resolved.udp_addr); rc = paddr->resolved.udp_addr->resolve (address.c_str (), false); if (rc != 0) { LIBZMQ_DELETE (paddr); return -1; } } // TBD - Should we check address for ZMQ_HAVE_NORM??? #ifdef ZMQ_HAVE_OPENPGM if (protocol == "pgm" || protocol == "epgm") { struct pgm_addrinfo_t *res = NULL; uint16_t port_number = 0; int rc = pgm_socket_t::init_address (address.c_str (), &res, &port_number); if (res != NULL) pgm_freeaddrinfo (res); if (rc != 0 || port_number == 0) { return -1; } } #endif #if defined ZMQ_HAVE_TIPC else if (protocol == "tipc") { paddr->resolved.tipc_addr = new (std::nothrow) tipc_address_t (); alloc_assert (paddr->resolved.tipc_addr); int rc = paddr->resolved.tipc_addr->resolve (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (paddr); return -1; } sockaddr_tipc *saddr = (sockaddr_tipc *) paddr->resolved.tipc_addr->addr (); // Cannot connect to random Port Identity if (saddr->addrtype == TIPC_ADDR_ID && paddr->resolved.tipc_addr->is_random ()) { LIBZMQ_DELETE (paddr); errno = EINVAL; return -1; } } #endif #if defined ZMQ_HAVE_VMCI else if (protocol == "vmci") { paddr->resolved.vmci_addr = new (std::nothrow) vmci_address_t (this->get_ctx ()); alloc_assert (paddr->resolved.vmci_addr); int rc = paddr->resolved.vmci_addr->resolve (address.c_str ()); if (rc != 0) { LIBZMQ_DELETE (paddr); return -1; } } #endif // Create session. session_base_t *session = session_base_t::create (io_thread, true, this, options, paddr); errno_assert (session); // PGM does not support subscription forwarding; ask for all data to be // sent to this pipe. (same for NORM, currently?) bool subscribe_to_all = protocol == "pgm" || protocol == "epgm" || protocol == "norm" || protocol == "udp"; pipe_t *newpipe = NULL; if (options.immediate != 1 || subscribe_to_all) { // Create a bi-directional pipe. object_t *parents[2] = {this, session}; pipe_t *new_pipes[2] = {NULL, NULL}; bool conflate = options.conflate && (options.type == ZMQ_DEALER || options.type == ZMQ_PULL || options.type == ZMQ_PUSH || options.type == ZMQ_PUB || options.type == ZMQ_SUB); int hwms[2] = {conflate ? -1 : options.sndhwm, conflate ? -1 : options.rcvhwm}; bool conflates[2] = {conflate, conflate}; rc = pipepair (parents, new_pipes, hwms, conflates); errno_assert (rc == 0); // Attach local end of the pipe to the socket object. attach_pipe (new_pipes[0], subscribe_to_all); newpipe = new_pipes[0]; // Attach remote end of the pipe to the session object later on. session->attach_pipe (new_pipes[1]); } // Save last endpoint URI paddr->to_string (last_endpoint); add_endpoint (addr_, (own_t *) session, newpipe); return 0; } void zmq::socket_base_t::add_endpoint (const char *addr_, own_t *endpoint_, pipe_t *pipe) { // Activate the session. Make it a child of this socket. launch_child (endpoint_); endpoints.ZMQ_MAP_INSERT_OR_EMPLACE (addr_, endpoint_pipe_t (endpoint_, pipe)); } int zmq::socket_base_t::term_endpoint (const char *addr_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); // Check whether the library haven't been shut down yet. if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Check whether endpoint address passed to the function is valid. if (unlikely (!addr_)) { errno = EINVAL; return -1; } // Process pending commands, if any, since there could be pending unprocessed process_own()'s // (from launch_child() for example) we're asked to terminate now. int rc = process_commands (0, false); if (unlikely (rc != 0)) { return -1; } // Parse addr_ string. std::string protocol; std::string address; if (parse_uri (addr_, protocol, address) || check_protocol (protocol)) { return -1; } const std::string addr_str = std::string (addr_); // Disconnect an inproc socket if (protocol == "inproc") { if (unregister_endpoint (addr_str, this) == 0) { return 0; } std::pair range = inprocs.equal_range (addr_str); if (range.first == range.second) { errno = ENOENT; return -1; } for (inprocs_t::iterator it = range.first; it != range.second; ++it) it->second->terminate (true); inprocs.erase (range.first, range.second); return 0; } std::string resolved_addr = addr_; // The resolved last_endpoint is used as a key in the endpoints map. // The address passed by the user might not match in the TCP case due to // IPv4-in-IPv6 mapping (EG: tcp://[::ffff:127.0.0.1]:9999), so try to // resolve before giving up. Given at this stage we don't know whether a // socket is connected or bound, try with both. if (protocol == "tcp") { if (endpoints.find (resolved_addr) == endpoints.end ()) { tcp_address_t *tcp_addr = new (std::nothrow) tcp_address_t (); alloc_assert (tcp_addr); rc = tcp_addr->resolve (address.c_str (), false, options.ipv6); if (rc == 0) { tcp_addr->to_string (resolved_addr); if (endpoints.find (resolved_addr) == endpoints.end ()) { rc = tcp_addr->resolve (address.c_str (), true, options.ipv6); if (rc == 0) { tcp_addr->to_string (resolved_addr); } } } LIBZMQ_DELETE (tcp_addr); } } // Find the endpoints range (if any) corresponding to the addr_ string. const std::pair range = endpoints.equal_range (resolved_addr); if (range.first == range.second) { errno = ENOENT; return -1; } for (endpoints_t::iterator it = range.first; it != range.second; ++it) { // If we have an associated pipe, terminate it. if (it->second.second != NULL) it->second.second->terminate (false); term_child (it->second.first); } endpoints.erase (range.first, range.second); return 0; } int zmq::socket_base_t::send (msg_t *msg_, int flags_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); // Check whether the library haven't been shut down yet. if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Check whether message passed to the function is valid. if (unlikely (!msg_ || !msg_->check ())) { errno = EFAULT; return -1; } // Process pending commands, if any. int rc = process_commands (0, true); if (unlikely (rc != 0)) { return -1; } // Clear any user-visible flags that are set on the message. msg_->reset_flags (msg_t::more); // At this point we impose the flags on the message. if (flags_ & ZMQ_SNDMORE) msg_->set_flags (msg_t::more); msg_->reset_metadata (); // Try to send the message using method in each socket class rc = xsend (msg_); if (rc == 0) { return 0; } if (unlikely (errno != EAGAIN)) { return -1; } // In case of non-blocking send we'll simply propagate // the error - including EAGAIN - up the stack. if ((flags_ & ZMQ_DONTWAIT) || options.sndtimeo == 0) { return -1; } // Compute the time when the timeout should occur. // If the timeout is infinite, don't care. int timeout = options.sndtimeo; uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout); // Oops, we couldn't send the message. Wait for the next // command, process it and try to send the message again. // If timeout is reached in the meantime, return EAGAIN. while (true) { if (unlikely (process_commands (timeout, false) != 0)) { return -1; } rc = xsend (msg_); if (rc == 0) break; if (unlikely (errno != EAGAIN)) { return -1; } if (timeout > 0) { timeout = (int) (end - clock.now_ms ()); if (timeout <= 0) { errno = EAGAIN; return -1; } } } return 0; } int zmq::socket_base_t::recv (msg_t *msg_, int flags_) { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); // Check whether the library haven't been shut down yet. if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Check whether message passed to the function is valid. if (unlikely (!msg_ || !msg_->check ())) { errno = EFAULT; return -1; } // Once every inbound_poll_rate messages check for signals and process // incoming commands. This happens only if we are not polling altogether // because there are messages available all the time. If poll occurs, // ticks is set to zero and thus we avoid this code. // // Note that 'recv' uses different command throttling algorithm (the one // described above) from the one used by 'send'. This is because counting // ticks is more efficient than doing RDTSC all the time. if (++ticks == inbound_poll_rate) { if (unlikely (process_commands (0, false) != 0)) { return -1; } ticks = 0; } // Get the message. int rc = xrecv (msg_); if (unlikely (rc != 0 && errno != EAGAIN)) { return -1; } // If we have the message, return immediately. if (rc == 0) { extract_flags (msg_); return 0; } // If the message cannot be fetched immediately, there are two scenarios. // For non-blocking recv, commands are processed in case there's an // activate_reader command already waiting in a command pipe. // If it's not, return EAGAIN. if ((flags_ & ZMQ_DONTWAIT) || options.rcvtimeo == 0) { if (unlikely (process_commands (0, false) != 0)) { return -1; } ticks = 0; rc = xrecv (msg_); if (rc < 0) { return rc; } extract_flags (msg_); return 0; } // Compute the time when the timeout should occur. // If the timeout is infinite, don't care. int timeout = options.rcvtimeo; uint64_t end = timeout < 0 ? 0 : (clock.now_ms () + timeout); // In blocking scenario, commands are processed over and over again until // we are able to fetch a message. bool block = (ticks != 0); while (true) { if (unlikely (process_commands (block ? timeout : 0, false) != 0)) { return -1; } rc = xrecv (msg_); if (rc == 0) { ticks = 0; break; } if (unlikely (errno != EAGAIN)) { return -1; } block = true; if (timeout > 0) { timeout = (int) (end - clock.now_ms ()); if (timeout <= 0) { errno = EAGAIN; return -1; } } } extract_flags (msg_); return 0; } int zmq::socket_base_t::close () { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); // Remove all existing signalers for thread safe sockets if (thread_safe) ((mailbox_safe_t *) mailbox)->clear_signalers (); // Mark the socket as dead tag = 0xdeadbeef; // Transfer the ownership of the socket from this application thread // to the reaper thread which will take care of the rest of shutdown // process. send_reap (this); return 0; } bool zmq::socket_base_t::has_in () { return xhas_in (); } bool zmq::socket_base_t::has_out () { return xhas_out (); } void zmq::socket_base_t::start_reaping (poller_t *poller_) { // Plug the socket to the reaper thread. poller = poller_; fd_t fd; if (!thread_safe) fd = ((mailbox_t *) mailbox)->get_fd (); else { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); reaper_signaler = new (std::nothrow) signaler_t (); zmq_assert (reaper_signaler); // Add signaler to the safe mailbox fd = reaper_signaler->get_fd (); ((mailbox_safe_t *) mailbox)->add_signaler (reaper_signaler); // Send a signal to make sure reaper handle existing commands reaper_signaler->send (); } handle = poller->add_fd (fd, this); poller->set_pollin (handle); // Initialise the termination and check whether it can be deallocated // immediately. terminate (); check_destroy (); } int zmq::socket_base_t::process_commands (int timeout_, bool throttle_) { int rc; command_t cmd; if (timeout_ != 0) { // If we are asked to wait, simply ask mailbox to wait. rc = mailbox->recv (&cmd, timeout_); } else { // If we are asked not to wait, check whether we haven't processed // commands recently, so that we can throttle the new commands. // Get the CPU's tick counter. If 0, the counter is not available. const uint64_t tsc = zmq::clock_t::rdtsc (); // Optimised version of command processing - it doesn't have to check // for incoming commands each time. It does so only if certain time // elapsed since last command processing. Command delay varies // depending on CPU speed: It's ~1ms on 3GHz CPU, ~2ms on 1.5GHz CPU // etc. The optimisation makes sense only on platforms where getting // a timestamp is a very cheap operation (tens of nanoseconds). if (tsc && throttle_) { // Check whether TSC haven't jumped backwards (in case of migration // between CPU cores) and whether certain time have elapsed since // last command processing. If it didn't do nothing. if (tsc >= last_tsc && tsc - last_tsc <= max_command_delay) return 0; last_tsc = tsc; } // Check whether there are any commands pending for this thread. rc = mailbox->recv (&cmd, 0); } // Process all available commands. while (rc == 0) { cmd.destination->process_command (cmd); rc = mailbox->recv (&cmd, 0); } if (errno == EINTR) return -1; zmq_assert (errno == EAGAIN); if (ctx_terminated) { errno = ETERM; return -1; } return 0; } void zmq::socket_base_t::process_stop () { // Here, someone have called zmq_ctx_term while the socket was still alive. // We'll remember the fact so that any blocking call is interrupted and any // further attempt to use the socket will return ETERM. The user is still // responsible for calling zmq_close on the socket though! scoped_lock_t lock (monitor_sync); stop_monitor (); ctx_terminated = true; } void zmq::socket_base_t::process_bind (pipe_t *pipe_) { attach_pipe (pipe_); } void zmq::socket_base_t::process_term (int linger_) { // Unregister all inproc endpoints associated with this socket. // Doing this we make sure that no new pipes from other sockets (inproc) // will be initiated. unregister_endpoints (this); // Ask all attached pipes to terminate. for (pipes_t::size_type i = 0; i != pipes.size (); ++i) pipes[i]->terminate (false); register_term_acks ((int) pipes.size ()); // Continue the termination process immediately. own_t::process_term (linger_); } void zmq::socket_base_t::process_term_endpoint (std::string *endpoint_) { term_endpoint (endpoint_->c_str ()); delete endpoint_; } void zmq::socket_base_t::update_pipe_options (int option_) { if (option_ == ZMQ_SNDHWM || option_ == ZMQ_RCVHWM) { for (pipes_t::size_type i = 0; i != pipes.size (); ++i) { pipes[i]->set_hwms (options.rcvhwm, options.sndhwm); pipes[i]->send_hwms_to_peer (options.sndhwm, options.rcvhwm); } } } void zmq::socket_base_t::process_destroy () { destroyed = true; } int zmq::socket_base_t::xsetsockopt (int, const void *, size_t) { errno = EINVAL; return -1; } bool zmq::socket_base_t::xhas_out () { return false; } int zmq::socket_base_t::xsend (msg_t *) { errno = ENOTSUP; return -1; } bool zmq::socket_base_t::xhas_in () { return false; } int zmq::socket_base_t::xjoin (const char *group_) { LIBZMQ_UNUSED (group_); errno = ENOTSUP; return -1; } int zmq::socket_base_t::xleave (const char *group_) { LIBZMQ_UNUSED (group_); errno = ENOTSUP; return -1; } int zmq::socket_base_t::xrecv (msg_t *) { errno = ENOTSUP; return -1; } static const zmq::blob_t empty_blob; const zmq::blob_t &zmq::socket_base_t::get_credential () const { return empty_blob; } void zmq::socket_base_t::xread_activated (pipe_t *) { zmq_assert (false); } void zmq::socket_base_t::xwrite_activated (pipe_t *) { zmq_assert (false); } void zmq::socket_base_t::xhiccuped (pipe_t *) { zmq_assert (false); } void zmq::socket_base_t::in_event () { // This function is invoked only once the socket is running in the context // of the reaper thread. Process any commands from other threads/sockets // that may be available at the moment. Ultimately, the socket will // be destroyed. { scoped_optional_lock_t sync_lock (thread_safe ? &sync : NULL); // If the socket is thread safe we need to unsignal the reaper signaler if (thread_safe) reaper_signaler->recv (); process_commands (0, false); } check_destroy (); } void zmq::socket_base_t::out_event () { zmq_assert (false); } void zmq::socket_base_t::timer_event (int) { zmq_assert (false); } void zmq::socket_base_t::check_destroy () { // If the object was already marked as destroyed, finish the deallocation. if (destroyed) { // Remove the socket from the reaper's poller. poller->rm_fd (handle); // Remove the socket from the context. destroy_socket (this); // Notify the reaper about the fact. send_reaped (); // Deallocate. own_t::process_destroy (); } } void zmq::socket_base_t::read_activated (pipe_t *pipe_) { xread_activated (pipe_); } void zmq::socket_base_t::write_activated (pipe_t *pipe_) { xwrite_activated (pipe_); } void zmq::socket_base_t::hiccuped (pipe_t *pipe_) { if (options.immediate == 1) pipe_->terminate (false); else // Notify derived sockets of the hiccup xhiccuped (pipe_); } void zmq::socket_base_t::pipe_terminated (pipe_t *pipe_) { // Notify the specific socket type about the pipe termination. xpipe_terminated (pipe_); // Remove pipe from inproc pipes for (inprocs_t::iterator it = inprocs.begin (); it != inprocs.end (); ++it) if (it->second == pipe_) { inprocs.erase (it); break; } // Remove the pipe from the list of attached pipes and confirm its // termination if we are already shutting down. pipes.erase (pipe_); if (is_terminating ()) unregister_term_ack (); } void zmq::socket_base_t::extract_flags (msg_t *msg_) { // Test whether routing_id flag is valid for this socket type. if (unlikely (msg_->flags () & msg_t::routing_id)) zmq_assert (options.recv_routing_id); // Remove MORE flag. rcvmore = msg_->flags () & msg_t::more ? true : false; } int zmq::socket_base_t::monitor (const char *addr_, int events_) { scoped_lock_t lock (monitor_sync); if (unlikely (ctx_terminated)) { errno = ETERM; return -1; } // Support deregistering monitoring endpoints as well if (addr_ == NULL) { stop_monitor (); return 0; } // Parse addr_ string. std::string protocol; std::string address; if (parse_uri (addr_, protocol, address) || check_protocol (protocol)) return -1; // Event notification only supported over inproc:// if (protocol != "inproc") { errno = EPROTONOSUPPORT; return -1; } // already monitoring. Stop previous monitor before starting new one. if (monitor_socket != NULL) { stop_monitor (true); } // Register events to monitor monitor_events = events_; monitor_socket = zmq_socket (get_ctx (), ZMQ_PAIR); if (monitor_socket == NULL) return -1; // Never block context termination on pending event messages int linger = 0; int rc = zmq_setsockopt (monitor_socket, ZMQ_LINGER, &linger, sizeof (linger)); if (rc == -1) stop_monitor (false); // Spawn the monitor socket endpoint rc = zmq_bind (monitor_socket, addr_); if (rc == -1) stop_monitor (false); return rc; } void zmq::socket_base_t::event_connected (const std::string &addr_, zmq::fd_t fd_) { event (addr_, fd_, ZMQ_EVENT_CONNECTED); } void zmq::socket_base_t::event_connect_delayed (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_CONNECT_DELAYED); } void zmq::socket_base_t::event_connect_retried (const std::string &addr_, int interval_) { event (addr_, interval_, ZMQ_EVENT_CONNECT_RETRIED); } void zmq::socket_base_t::event_listening (const std::string &addr_, zmq::fd_t fd_) { event (addr_, fd_, ZMQ_EVENT_LISTENING); } void zmq::socket_base_t::event_bind_failed (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_BIND_FAILED); } void zmq::socket_base_t::event_accepted (const std::string &addr_, zmq::fd_t fd_) { event (addr_, fd_, ZMQ_EVENT_ACCEPTED); } void zmq::socket_base_t::event_accept_failed (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_ACCEPT_FAILED); } void zmq::socket_base_t::event_closed (const std::string &addr_, zmq::fd_t fd_) { event (addr_, fd_, ZMQ_EVENT_CLOSED); } void zmq::socket_base_t::event_close_failed (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_CLOSE_FAILED); } void zmq::socket_base_t::event_disconnected (const std::string &addr_, zmq::fd_t fd_) { event (addr_, fd_, ZMQ_EVENT_DISCONNECTED); } void zmq::socket_base_t::event_handshake_failed_no_detail ( const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL); } void zmq::socket_base_t::event_handshake_failed_protocol ( const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL); } void zmq::socket_base_t::event_handshake_failed_auth (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_HANDSHAKE_FAILED_AUTH); } void zmq::socket_base_t::event_handshake_succeeded (const std::string &addr_, int err_) { event (addr_, err_, ZMQ_EVENT_HANDSHAKE_SUCCEEDED); } void zmq::socket_base_t::event (const std::string &addr_, intptr_t value_, int type_) { scoped_lock_t lock (monitor_sync); if (monitor_events & type_) { monitor_event (type_, value_, addr_); } } // Send a monitor event void zmq::socket_base_t::monitor_event (int event_, intptr_t value_, const std::string &addr_) { // this is a private method which is only called from // contexts where the mutex has been locked before if (monitor_socket) { // Send event in first frame zmq_msg_t msg; zmq_msg_init_size (&msg, 6); uint8_t *data = (uint8_t *) zmq_msg_data (&msg); // Avoid dereferencing uint32_t on unaligned address uint16_t event = (uint16_t) event_; uint32_t value = (uint32_t) value_; memcpy (data + 0, &event, sizeof (event)); memcpy (data + 2, &value, sizeof (value)); zmq_sendmsg (monitor_socket, &msg, ZMQ_SNDMORE); // Send address in second frame zmq_msg_init_size (&msg, addr_.size ()); memcpy (zmq_msg_data (&msg), addr_.c_str (), addr_.size ()); zmq_sendmsg (monitor_socket, &msg, 0); } } void zmq::socket_base_t::stop_monitor (bool send_monitor_stopped_event_) { // this is a private method which is only called from // contexts where the mutex has been locked before if (monitor_socket) { if ((monitor_events & ZMQ_EVENT_MONITOR_STOPPED) && send_monitor_stopped_event_) monitor_event (ZMQ_EVENT_MONITOR_STOPPED, 0, ""); zmq_close (monitor_socket); monitor_socket = NULL; monitor_events = 0; } } zeromq-4.2.5/src/zmq.cpp0000664000372000037200000012231513255253220016046 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ // "Tell them I was a writer. // A maker of software. // A humanist. A father. // And many things. // But above all, a writer. // Thank You. :)" // - Pieter Hintjens #include "precompiled.hpp" #define ZMQ_TYPE_UNSAFE #include "macros.hpp" #include "poller.hpp" // On AIX platform, poll.h has to be included first to get consistent // definition of pollfd structure (AIX uses 'reqevents' and 'retnevents' // instead of 'events' and 'revents' and defines macros to map from POSIX-y // names to AIX-specific names). #if defined ZMQ_POLL_BASED_ON_POLL && !defined ZMQ_HAVE_WINDOWS #include #endif // TODO: determine if this is an issue, since zmq.h is being loaded from pch. // zmq.h must be included *after* poll.h for AIX to build properly //#include "../include/zmq.h" #if !defined ZMQ_HAVE_WINDOWS #include #ifdef ZMQ_HAVE_VXWORKS #include #endif #endif // XSI vector I/O #if defined ZMQ_HAVE_UIO #include #else struct iovec { void *iov_base; size_t iov_len; }; #endif #include #include #include #include #include "proxy.hpp" #include "socket_base.hpp" #include "stdint.hpp" #include "config.hpp" #include "likely.hpp" #include "clock.hpp" #include "ctx.hpp" #include "err.hpp" #include "msg.hpp" #include "fd.hpp" #include "metadata.hpp" #include "signaler.hpp" #include "socket_poller.hpp" #include "timers.hpp" #include "ip.hpp" #if defined ZMQ_HAVE_OPENPGM #define __PGM_WININT_H__ #include #endif // Compile time check whether msg_t fits into zmq_msg_t. typedef char check_msg_t_size[sizeof (zmq::msg_t) == sizeof (zmq_msg_t) ? 1 : -1]; void zmq_version (int *major_, int *minor_, int *patch_) { *major_ = ZMQ_VERSION_MAJOR; *minor_ = ZMQ_VERSION_MINOR; *patch_ = ZMQ_VERSION_PATCH; } const char *zmq_strerror (int errnum_) { return zmq::errno_to_string (errnum_); } int zmq_errno (void) { return errno; } // New context API void *zmq_ctx_new (void) { // We do this before the ctx constructor since its embedded mailbox_t // object needs the network to be up and running (at least on Windows). if (!zmq::initialize_network ()) { return NULL; } // Create 0MQ context. zmq::ctx_t *ctx = new (std::nothrow) zmq::ctx_t; if (ctx) { if (!ctx->valid ()) { delete ctx; return NULL; } } return ctx; } int zmq_ctx_term (void *ctx_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } int rc = ((zmq::ctx_t *) ctx_)->terminate (); int en = errno; // Shut down only if termination was not interrupted by a signal. if (!rc || en != EINTR) { zmq::shutdown_network (); } errno = en; return rc; } int zmq_ctx_shutdown (void *ctx_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->shutdown (); } int zmq_ctx_set (void *ctx_, int option_, int optval_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->set (option_, optval_); } int zmq_ctx_get (void *ctx_, int option_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::ctx_t *) ctx_)->get (option_); } // Stable/legacy context API void *zmq_init (int io_threads_) { if (io_threads_ >= 0) { void *ctx = zmq_ctx_new (); zmq_ctx_set (ctx, ZMQ_IO_THREADS, io_threads_); return ctx; } errno = EINVAL; return NULL; } int zmq_term (void *ctx_) { return zmq_ctx_term (ctx_); } int zmq_ctx_destroy (void *ctx_) { return zmq_ctx_term (ctx_); } // Sockets static zmq::socket_base_t *as_socket_base_t (void *s_) { zmq::socket_base_t *s = static_cast (s_); if (!s_ || !s->check_tag ()) { errno = ENOTSOCK; return NULL; } return s; } void *zmq_socket (void *ctx_, int type_) { if (!ctx_ || !((zmq::ctx_t *) ctx_)->check_tag ()) { errno = EFAULT; return NULL; } zmq::ctx_t *ctx = (zmq::ctx_t *) ctx_; zmq::socket_base_t *s = ctx->create_socket (type_); return (void *) s; } int zmq_close (void *s_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; s->close (); return 0; } int zmq_setsockopt (void *s_, int option_, const void *optval_, size_t optvallen_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->setsockopt (option_, optval_, optvallen_); } int zmq_getsockopt (void *s_, int option_, void *optval_, size_t *optvallen_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->getsockopt (option_, optval_, optvallen_); } int zmq_socket_monitor (void *s_, const char *addr_, int events_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->monitor (addr_, events_); } int zmq_join (void *s_, const char *group_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->join (group_); } int zmq_leave (void *s_, const char *group_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->leave (group_); } int zmq_bind (void *s_, const char *addr_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->bind (addr_); } int zmq_connect (void *s_, const char *addr_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->connect (addr_); } int zmq_unbind (void *s_, const char *addr_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->term_endpoint (addr_); } int zmq_disconnect (void *s_, const char *addr_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->term_endpoint (addr_); } // Sending functions. static inline int s_sendmsg (zmq::socket_base_t *s_, zmq_msg_t *msg_, int flags_) { size_t sz = zmq_msg_size (msg_); int rc = s_->send ((zmq::msg_t *) msg_, flags_); if (unlikely (rc < 0)) return -1; // This is what I'd like to do, my C++ fu is too weak -- PH 2016/02/09 // int max_msgsz = s_->parent->get (ZMQ_MAX_MSGSZ); size_t max_msgsz = INT_MAX; // Truncate returned size to INT_MAX to avoid overflow to negative values return (int) (sz < max_msgsz ? sz : max_msgsz); } /* To be deprecated once zmq_msg_send() is stable */ int zmq_sendmsg (void *s_, zmq_msg_t *msg_, int flags_) { return zmq_msg_send (msg_, s_, flags_); } int zmq_send (void *s_, const void *buf_, size_t len_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; zmq_msg_t msg; if (zmq_msg_init_size (&msg, len_)) return -1; // We explicitly allow a send from NULL, size zero if (len_) { assert (buf_); memcpy (zmq_msg_data (&msg), buf_, len_); } int rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; return -1; } // Note the optimisation here. We don't close the msg object as it is // empty anyway. This may change when implementation of zmq_msg_t changes. return rc; } int zmq_send_const (void *s_, const void *buf_, size_t len_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; zmq_msg_t msg; int rc = zmq_msg_init_data (&msg, (void *) buf_, len_, NULL, NULL); if (rc != 0) return -1; rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; return -1; } // Note the optimisation here. We don't close the msg object as it is // empty anyway. This may change when implementation of zmq_msg_t changes. return rc; } // Send multiple messages. // TODO: this function has no man page // // If flag bit ZMQ_SNDMORE is set the vector is treated as // a single multi-part message, i.e. the last message has // ZMQ_SNDMORE bit switched off. // int zmq_sendiov (void *s_, iovec *a_, size_t count_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; if (unlikely (count_ <= 0 || !a_)) { errno = EINVAL; return -1; } int rc = 0; zmq_msg_t msg; for (size_t i = 0; i < count_; ++i) { rc = zmq_msg_init_size (&msg, a_[i].iov_len); if (rc != 0) { rc = -1; break; } memcpy (zmq_msg_data (&msg), a_[i].iov_base, a_[i].iov_len); if (i == count_ - 1) flags_ = flags_ & ~ZMQ_SNDMORE; rc = s_sendmsg (s, &msg, flags_); if (unlikely (rc < 0)) { int err = errno; int rc2 = zmq_msg_close (&msg); errno_assert (rc2 == 0); errno = err; rc = -1; break; } } return rc; } // Receiving functions. static int s_recvmsg (zmq::socket_base_t *s_, zmq_msg_t *msg_, int flags_) { int rc = s_->recv ((zmq::msg_t *) msg_, flags_); if (unlikely (rc < 0)) return -1; // Truncate returned size to INT_MAX to avoid overflow to negative values size_t sz = zmq_msg_size (msg_); return (int) (sz < INT_MAX ? sz : INT_MAX); } /* To be deprecated once zmq_msg_recv() is stable */ int zmq_recvmsg (void *s_, zmq_msg_t *msg_, int flags_) { return zmq_msg_recv (msg_, s_, flags_); } int zmq_recv (void *s_, void *buf_, size_t len_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; zmq_msg_t msg; int rc = zmq_msg_init (&msg); errno_assert (rc == 0); int nbytes = s_recvmsg (s, &msg, flags_); if (unlikely (nbytes < 0)) { int err = errno; rc = zmq_msg_close (&msg); errno_assert (rc == 0); errno = err; return -1; } // An oversized message is silently truncated. size_t to_copy = size_t (nbytes) < len_ ? size_t (nbytes) : len_; // We explicitly allow a null buffer argument if len is zero if (to_copy) { assert (buf_); memcpy (buf_, zmq_msg_data (&msg), to_copy); } rc = zmq_msg_close (&msg); errno_assert (rc == 0); return nbytes; } // Receive a multi-part message // // Receives up to *count_ parts of a multi-part message. // Sets *count_ to the actual number of parts read. // ZMQ_RCVMORE is set to indicate if a complete multi-part message was read. // Returns number of message parts read, or -1 on error. // // Note: even if -1 is returned, some parts of the message // may have been read. Therefore the client must consult // *count_ to retrieve message parts successfully read, // even if -1 is returned. // // The iov_base* buffers of each iovec *a_ filled in by this // function may be freed using free(). // TODO: this function has no man page // int zmq_recviov (void *s_, iovec *a_, size_t *count_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; if (unlikely (!count_ || *count_ <= 0 || !a_)) { errno = EINVAL; return -1; } size_t count = *count_; int nread = 0; bool recvmore = true; *count_ = 0; for (size_t i = 0; recvmore && i < count; ++i) { zmq_msg_t msg; int rc = zmq_msg_init (&msg); errno_assert (rc == 0); int nbytes = s_recvmsg (s, &msg, flags_); if (unlikely (nbytes < 0)) { int err = errno; rc = zmq_msg_close (&msg); errno_assert (rc == 0); errno = err; nread = -1; break; } a_[i].iov_len = zmq_msg_size (&msg); a_[i].iov_base = static_cast (malloc (a_[i].iov_len)); if (unlikely (!a_[i].iov_base)) { errno = ENOMEM; return -1; } memcpy (a_[i].iov_base, static_cast (zmq_msg_data (&msg)), a_[i].iov_len); // Assume zmq_socket ZMQ_RVCMORE is properly set. zmq::msg_t *p_msg = reinterpret_cast (&msg); recvmore = p_msg->flags () & zmq::msg_t::more; rc = zmq_msg_close (&msg); errno_assert (rc == 0); ++*count_; ++nread; } return nread; } // Message manipulators. int zmq_msg_init (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->init (); } int zmq_msg_init_size (zmq_msg_t *msg_, size_t size_) { return ((zmq::msg_t *) msg_)->init_size (size_); } int zmq_msg_init_data ( zmq_msg_t *msg_, void *data_, size_t size_, zmq_free_fn *ffn_, void *hint_) { return ((zmq::msg_t *) msg_)->init_data (data_, size_, ffn_, hint_); } int zmq_msg_send (zmq_msg_t *msg_, void *s_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s_sendmsg (s, msg_, flags_); } int zmq_msg_recv (zmq_msg_t *msg_, void *s_, int flags_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s_recvmsg (s, msg_, flags_); } int zmq_msg_close (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->close (); } int zmq_msg_move (zmq_msg_t *dest_, zmq_msg_t *src_) { return ((zmq::msg_t *) dest_)->move (*(zmq::msg_t *) src_); } int zmq_msg_copy (zmq_msg_t *dest_, zmq_msg_t *src_) { return ((zmq::msg_t *) dest_)->copy (*(zmq::msg_t *) src_); } void *zmq_msg_data (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->data (); } size_t zmq_msg_size (const zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->size (); } int zmq_msg_more (const zmq_msg_t *msg_) { return zmq_msg_get (msg_, ZMQ_MORE); } int zmq_msg_get (const zmq_msg_t *msg_, int property_) { const char *fd_string; switch (property_) { case ZMQ_MORE: return (((zmq::msg_t *) msg_)->flags () & zmq::msg_t::more) ? 1 : 0; case ZMQ_SRCFD: fd_string = zmq_msg_gets (msg_, "__fd"); if (fd_string == NULL) return (int) -1; return atoi (fd_string); case ZMQ_SHARED: return (((zmq::msg_t *) msg_)->is_cmsg ()) || (((zmq::msg_t *) msg_)->flags () & zmq::msg_t::shared) ? 1 : 0; default: errno = EINVAL; return -1; } } int zmq_msg_set (zmq_msg_t *, int, int) { // No properties supported at present errno = EINVAL; return -1; } int zmq_msg_set_routing_id (zmq_msg_t *msg_, uint32_t routing_id_) { return ((zmq::msg_t *) msg_)->set_routing_id (routing_id_); } uint32_t zmq_msg_routing_id (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->get_routing_id (); } int zmq_msg_set_group (zmq_msg_t *msg_, const char *group_) { return ((zmq::msg_t *) msg_)->set_group (group_); } const char *zmq_msg_group (zmq_msg_t *msg_) { return ((zmq::msg_t *) msg_)->group (); } // Get message metadata string const char *zmq_msg_gets (const zmq_msg_t *msg_, const char *property_) { zmq::metadata_t *metadata = ((zmq::msg_t *) msg_)->metadata (); const char *value = NULL; if (metadata) value = metadata->get (std::string (property_)); if (value) return value; else { errno = EINVAL; return NULL; } } // Polling. #if defined ZMQ_HAVE_POLLER inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) { // implement zmq_poll on top of zmq_poller int rc; zmq_poller_event_t *events; zmq::socket_poller_t poller; events = new (std::nothrow) zmq_poller_event_t[nitems_]; alloc_assert (events); bool repeat_items = false; // Register sockets with poller for (int i = 0; i < nitems_; i++) { items_[i].revents = 0; bool modify = false; short e = items_[i].events; if (items_[i].socket) { // Poll item is a 0MQ socket. for (int j = 0; j < i; ++j) { // Check for repeat entries if (items_[j].socket == items_[i].socket) { repeat_items = true; modify = true; e |= items_[j].events; } } if (modify) { rc = zmq_poller_modify (&poller, items_[i].socket, e); } else { rc = zmq_poller_add (&poller, items_[i].socket, NULL, e); } if (rc < 0) { delete[] events; return rc; } } else { // Poll item is a raw file descriptor. for (int j = 0; j < i; ++j) { // Check for repeat entries if (!items_[j].socket && items_[j].fd == items_[i].fd) { repeat_items = true; modify = true; e |= items_[j].events; } } if (modify) { rc = zmq_poller_modify_fd (&poller, items_[i].fd, e); } else { rc = zmq_poller_add_fd (&poller, items_[i].fd, NULL, e); } if (rc < 0) { delete[] events; return rc; } } } // Wait for events rc = zmq_poller_wait_all (&poller, events, nitems_, timeout_); if (rc < 0) { delete[] events; if (zmq_errno () == EAGAIN) { return 0; } return rc; } // Transform poller events into zmq_pollitem events. // items_ contains all items, while events only contains fired events. // If no sockets are repeated (likely), the two are still co-ordered, so step through the items // checking for matches only on the first event. // If there are repeat items, they cannot be assumed to be co-ordered, // so each pollitem must check fired events from the beginning. int j_start = 0, found_events = rc; for (int i = 0; i < nitems_; i++) { for (int j = j_start; j < found_events; ++j) { if ((items_[i].socket && items_[i].socket == events[j].socket) || (!(items_[i].socket || events[j].socket) && items_[i].fd == events[j].fd)) { items_[i].revents = events[j].events & items_[i].events; if (!repeat_items) { // no repeats, we can ignore events we've already seen j_start++; } break; } if (!repeat_items) { // no repeats, never have to look at j > j_start break; } } } // Cleanup delete[] events; return rc; } #endif // ZMQ_HAVE_POLLER int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_) { // TODO: the function implementation can just call zmq_pollfd_poll with // pollfd as NULL, however pollfd is not yet stable. #if defined ZMQ_HAVE_POLLER // if poller is present, use that. return zmq_poller_poll (items_, nitems_, timeout_); #else #if defined ZMQ_POLL_BASED_ON_POLL if (unlikely (nitems_ < 0)) { errno = EINVAL; return -1; } if (unlikely (nitems_ == 0)) { if (timeout_ == 0) return 0; #if defined ZMQ_HAVE_WINDOWS Sleep (timeout_ > 0 ? timeout_ : INFINITE); return 0; #elif defined ZMQ_HAVE_ANDROID usleep (timeout_ * 1000); return 0; #else return usleep (timeout_ * 1000); #endif } if (!items_) { errno = EFAULT; return -1; } zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; pollfd spollfds[ZMQ_POLLITEMS_DFLT]; pollfd *pollfds = spollfds; if (nitems_ > ZMQ_POLLITEMS_DFLT) { pollfds = (pollfd *) malloc (nitems_ * sizeof (pollfd)); alloc_assert (pollfds); } // Build pollset for poll () system call. for (int i = 0; i != nitems_; i++) { // If the poll item is a 0MQ socket, we poll on the file descriptor // retrieved by the ZMQ_FD socket option. if (items_[i].socket) { size_t zmq_fd_size = sizeof (zmq::fd_t); if (zmq_getsockopt (items_[i].socket, ZMQ_FD, &pollfds[i].fd, &zmq_fd_size) == -1) { if (pollfds != spollfds) free (pollfds); return -1; } pollfds[i].events = items_[i].events ? POLLIN : 0; } // Else, the poll item is a raw file descriptor. Just convert the // events to normal POLLIN/POLLOUT for poll (). else { pollfds[i].fd = items_[i].fd; pollfds[i].events = (items_[i].events & ZMQ_POLLIN ? POLLIN : 0) | (items_[i].events & ZMQ_POLLOUT ? POLLOUT : 0) | (items_[i].events & ZMQ_POLLPRI ? POLLPRI : 0); } } bool first_pass = true; int nevents = 0; while (true) { // Compute the timeout for the subsequent poll. int timeout; if (first_pass) timeout = 0; else if (timeout_ < 0) timeout = -1; else timeout = end - now; // Wait for events. { int rc = poll (pollfds, nitems_, timeout); if (rc == -1 && errno == EINTR) { if (pollfds != spollfds) free (pollfds); return -1; } errno_assert (rc >= 0); } // Check for the events. for (int i = 0; i != nitems_; i++) { items_[i].revents = 0; // The poll item is a 0MQ socket. Retrieve pending events // using the ZMQ_EVENTS socket option. if (items_[i].socket) { size_t zmq_events_size = sizeof (uint32_t); uint32_t zmq_events; if (zmq_getsockopt (items_[i].socket, ZMQ_EVENTS, &zmq_events, &zmq_events_size) == -1) { if (pollfds != spollfds) free (pollfds); return -1; } if ((items_[i].events & ZMQ_POLLOUT) && (zmq_events & ZMQ_POLLOUT)) items_[i].revents |= ZMQ_POLLOUT; if ((items_[i].events & ZMQ_POLLIN) && (zmq_events & ZMQ_POLLIN)) items_[i].revents |= ZMQ_POLLIN; } // Else, the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. else { if (pollfds[i].revents & POLLIN) items_[i].revents |= ZMQ_POLLIN; if (pollfds[i].revents & POLLOUT) items_[i].revents |= ZMQ_POLLOUT; if (pollfds[i].revents & POLLPRI) items_[i].revents |= ZMQ_POLLPRI; if (pollfds[i].revents & ~(POLLIN | POLLOUT | POLLPRI)) items_[i].revents |= ZMQ_POLLERR; } if (items_[i].revents) nevents++; } // If timeout is zero, exit immediately whether there are events or not. if (timeout_ == 0) break; // If there are events to return, we can exit immediately. if (nevents) break; // At this point we are meant to wait for events but there are none. // If timeout is infinite we can just loop until we get some events. if (timeout_ < 0) { if (first_pass) first_pass = false; continue; } // The timeout is finite and there are no events. In the first pass // we get a timestamp of when the polling have begun. (We assume that // first pass have taken negligible time). We also compute the time // when the polling should time out. if (first_pass) { now = clock.now_ms (); end = now + timeout_; if (now == end) break; first_pass = false; continue; } // Find out whether timeout have expired. now = clock.now_ms (); if (now >= end) break; } if (pollfds != spollfds) free (pollfds); return nevents; #elif defined ZMQ_POLL_BASED_ON_SELECT if (unlikely (nitems_ < 0)) { errno = EINVAL; return -1; } if (unlikely (nitems_ == 0)) { if (timeout_ == 0) return 0; #if defined ZMQ_HAVE_WINDOWS Sleep (timeout_ > 0 ? timeout_ : INFINITE); return 0; #elif defined ZMQ_HAVE_VXWORKS struct timespec ns_; ns_.tv_sec = timeout_ / 1000; ns_.tv_nsec = timeout_ % 1000 * 1000000; return nanosleep (&ns_, 0); #else return usleep (timeout_ * 1000); #endif } zmq::clock_t clock; uint64_t now = 0; uint64_t end = 0; // Ensure we do not attempt to select () on more than FD_SETSIZE // file descriptors. zmq_assert (nitems_ <= FD_SETSIZE); fd_set pollset_in; FD_ZERO (&pollset_in); fd_set pollset_out; FD_ZERO (&pollset_out); fd_set pollset_err; FD_ZERO (&pollset_err); zmq::fd_t maxfd = 0; // Build the fd_sets for passing to select (). for (int i = 0; i != nitems_; i++) { // If the poll item is a 0MQ socket we are interested in input on the // notification file descriptor retrieved by the ZMQ_FD socket option. if (items_[i].socket) { size_t zmq_fd_size = sizeof (zmq::fd_t); zmq::fd_t notify_fd; if (zmq_getsockopt (items_[i].socket, ZMQ_FD, ¬ify_fd, &zmq_fd_size) == -1) return -1; if (items_[i].events) { FD_SET (notify_fd, &pollset_in); if (maxfd < notify_fd) maxfd = notify_fd; } } // Else, the poll item is a raw file descriptor. Convert the poll item // events to the appropriate fd_sets. else { if (items_[i].events & ZMQ_POLLIN) FD_SET (items_[i].fd, &pollset_in); if (items_[i].events & ZMQ_POLLOUT) FD_SET (items_[i].fd, &pollset_out); if (items_[i].events & ZMQ_POLLERR) FD_SET (items_[i].fd, &pollset_err); if (maxfd < items_[i].fd) maxfd = items_[i].fd; } } bool first_pass = true; int nevents = 0; fd_set inset, outset, errset; while (true) { // Compute the timeout for the subsequent poll. timeval timeout; timeval *ptimeout; if (first_pass) { timeout.tv_sec = 0; timeout.tv_usec = 0; ptimeout = &timeout; } else if (timeout_ < 0) ptimeout = NULL; else { timeout.tv_sec = (long) ((end - now) / 1000); timeout.tv_usec = (long) ((end - now) % 1000 * 1000); ptimeout = &timeout; } // Wait for events. Ignore interrupts if there's infinite timeout. while (true) { #if defined ZMQ_HAVE_WINDOWS // On Windows we don't need to copy the whole fd_set. // SOCKETS are continuous from the beginning of fd_array in fd_set. // We just need to copy fd_count elements of fd_array. // We gain huge memcpy() improvement if number of used SOCKETs is much lower than FD_SETSIZE. memcpy (&inset, &pollset_in, (char *) (pollset_in.fd_array + pollset_in.fd_count) - (char *) &pollset_in); memcpy (&outset, &pollset_out, (char *) (pollset_out.fd_array + pollset_out.fd_count) - (char *) &pollset_out); memcpy (&errset, &pollset_err, (char *) (pollset_err.fd_array + pollset_err.fd_count) - (char *) &pollset_err); int rc = select (0, &inset, &outset, &errset, ptimeout); if (unlikely (rc == SOCKET_ERROR)) { errno = zmq::wsa_error_to_errno (WSAGetLastError ()); wsa_assert (errno == ENOTSOCK); return -1; } #else memcpy (&inset, &pollset_in, sizeof (fd_set)); memcpy (&outset, &pollset_out, sizeof (fd_set)); memcpy (&errset, &pollset_err, sizeof (fd_set)); int rc = select (maxfd + 1, &inset, &outset, &errset, ptimeout); if (unlikely (rc == -1)) { errno_assert (errno == EINTR || errno == EBADF); return -1; } #endif break; } // Check for the events. for (int i = 0; i != nitems_; i++) { items_[i].revents = 0; // The poll item is a 0MQ socket. Retrieve pending events // using the ZMQ_EVENTS socket option. if (items_[i].socket) { size_t zmq_events_size = sizeof (uint32_t); uint32_t zmq_events; if (zmq_getsockopt (items_[i].socket, ZMQ_EVENTS, &zmq_events, &zmq_events_size) == -1) return -1; if ((items_[i].events & ZMQ_POLLOUT) && (zmq_events & ZMQ_POLLOUT)) items_[i].revents |= ZMQ_POLLOUT; if ((items_[i].events & ZMQ_POLLIN) && (zmq_events & ZMQ_POLLIN)) items_[i].revents |= ZMQ_POLLIN; } // Else, the poll item is a raw file descriptor, simply convert // the events to zmq_pollitem_t-style format. else { if (FD_ISSET (items_[i].fd, &inset)) items_[i].revents |= ZMQ_POLLIN; if (FD_ISSET (items_[i].fd, &outset)) items_[i].revents |= ZMQ_POLLOUT; if (FD_ISSET (items_[i].fd, &errset)) items_[i].revents |= ZMQ_POLLERR; } if (items_[i].revents) nevents++; } // If timeout is zero, exit immediately whether there are events or not. if (timeout_ == 0) break; // If there are events to return, we can exit immediately. if (nevents) break; // At this point we are meant to wait for events but there are none. // If timeout is infinite we can just loop until we get some events. if (timeout_ < 0) { if (first_pass) first_pass = false; continue; } // The timeout is finite and there are no events. In the first pass // we get a timestamp of when the polling have begun. (We assume that // first pass have taken negligible time). We also compute the time // when the polling should time out. if (first_pass) { now = clock.now_ms (); end = now + timeout_; if (now == end) break; first_pass = false; continue; } // Find out whether timeout have expired. now = clock.now_ms (); if (now >= end) break; } return nevents; #else // Exotic platforms that support neither poll() nor select(). errno = ENOTSUP; return -1; #endif #endif // ZMQ_HAVE_POLLER } // The poller functionality void *zmq_poller_new (void) { zmq::socket_poller_t *poller = new (std::nothrow) zmq::socket_poller_t; alloc_assert (poller); return poller; } int zmq_poller_destroy (void **poller_p_) { void *poller; if (!poller_p_ || !(poller = *poller_p_) || !((zmq::socket_poller_t *) poller)->check_tag ()) { errno = EFAULT; return -1; } delete ((zmq::socket_poller_t *) poller); *poller_p_ = NULL; return 0; } int zmq_poller_add (void *poller_, void *s_, void *user_data_, short events_) { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t *) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t *) s_; return ((zmq::socket_poller_t *) poller_) ->add (socket, user_data_, events_); } #if defined _WIN32 int zmq_poller_add_fd (void *poller_, SOCKET fd_, void *user_data_, short events_) #else int zmq_poller_add_fd (void *poller_, int fd_, void *user_data_, short events_) #endif { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (fd_ == zmq::retired_fd) { errno = EBADF; return -1; } return ((zmq::socket_poller_t *) poller_) ->add_fd (fd_, user_data_, events_); } int zmq_poller_modify (void *poller_, void *s_, short events_) { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t *) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t *) s_; return ((zmq::socket_poller_t *) poller_)->modify (socket, events_); } #if defined _WIN32 int zmq_poller_modify_fd (void *poller_, SOCKET fd_, short events_) #else int zmq_poller_modify_fd (void *poller_, int fd_, short events_) #endif { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (fd_ == zmq::retired_fd) { errno = EBADF; return -1; } return ((zmq::socket_poller_t *) poller_)->modify_fd (fd_, events_); } int zmq_poller_remove (void *poller_, void *s_) { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!s_ || !((zmq::socket_base_t *) s_)->check_tag ()) { errno = ENOTSOCK; return -1; } zmq::socket_base_t *socket = (zmq::socket_base_t *) s_; return ((zmq::socket_poller_t *) poller_)->remove (socket); } #if defined _WIN32 int zmq_poller_remove_fd (void *poller_, SOCKET fd_) #else int zmq_poller_remove_fd (void *poller_, int fd_) #endif { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (fd_ == zmq::retired_fd) { errno = EBADF; return -1; } return ((zmq::socket_poller_t *) poller_)->remove_fd (fd_); } int zmq_poller_wait (void *poller_, zmq_poller_event_t *event_, long timeout_) { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!event_) { errno = EFAULT; return -1; } int rc = zmq_poller_wait_all (poller_, event_, 1, timeout_); if (rc < 0) { memset (event_, 0, sizeof (zmq_poller_event_t)); } // wait_all returns number of events, but we return 0 for any success return rc >= 0 ? 0 : rc; } int zmq_poller_wait_all (void *poller_, zmq_poller_event_t *events_, int n_events, long timeout_) { if (!poller_ || !((zmq::socket_poller_t *) poller_)->check_tag ()) { errno = EFAULT; return -1; } if (!events_) { errno = EFAULT; return -1; } if (n_events < 0) { errno = EINVAL; return -1; } int rc = ((zmq::socket_poller_t *) poller_) ->wait ((zmq::socket_poller_t::event_t *) events_, n_events, timeout_); return rc; } // Peer-specific state int zmq_socket_get_peer_state (void *s_, const void *routing_id_, size_t routing_id_size_) { zmq::socket_base_t *s = as_socket_base_t (s_); if (!s) return -1; return s->get_peer_state (routing_id_, routing_id_size_); } // Timers void *zmq_timers_new (void) { zmq::timers_t *timers = new (std::nothrow) zmq::timers_t; alloc_assert (timers); return timers; } int zmq_timers_destroy (void **timers_p_) { void *timers = *timers_p_; if (!timers || !((zmq::timers_t *) timers)->check_tag ()) { errno = EFAULT; return -1; } delete ((zmq::timers_t *) timers); *timers_p_ = NULL; return 0; } int zmq_timers_add (void *timers_, size_t interval_, zmq_timer_fn handler_, void *arg_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->add (interval_, handler_, arg_); } int zmq_timers_cancel (void *timers_, int timer_id_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->cancel (timer_id_); } int zmq_timers_set_interval (void *timers_, int timer_id_, size_t interval_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->set_interval (timer_id_, interval_); } int zmq_timers_reset (void *timers_, int timer_id_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->reset (timer_id_); } long zmq_timers_timeout (void *timers_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->timeout (); } int zmq_timers_execute (void *timers_) { if (!timers_ || !((zmq::timers_t *) timers_)->check_tag ()) { errno = EFAULT; return -1; } return ((zmq::timers_t *) timers_)->execute (); } // The proxy functionality int zmq_proxy (void *frontend_, void *backend_, void *capture_) { if (!frontend_ || !backend_) { errno = EFAULT; return -1; } return zmq::proxy ((zmq::socket_base_t *) frontend_, (zmq::socket_base_t *) backend_, (zmq::socket_base_t *) capture_); } int zmq_proxy_steerable (void *frontend_, void *backend_, void *capture_, void *control_) { if (!frontend_ || !backend_) { errno = EFAULT; return -1; } return zmq::proxy ( (zmq::socket_base_t *) frontend_, (zmq::socket_base_t *) backend_, (zmq::socket_base_t *) capture_, (zmq::socket_base_t *) control_); } // The deprecated device functionality int zmq_device (int /* type */, void *frontend_, void *backend_) { return zmq::proxy ((zmq::socket_base_t *) frontend_, (zmq::socket_base_t *) backend_, NULL); } // Probe library capabilities; for now, reports on transport and security int zmq_has (const char *capability) { #if !defined(ZMQ_HAVE_WINDOWS) && !defined(ZMQ_HAVE_OPENVMS) if (strcmp (capability, "ipc") == 0) return true; #endif #if defined(ZMQ_HAVE_OPENPGM) if (strcmp (capability, "pgm") == 0) return true; #endif #if defined(ZMQ_HAVE_TIPC) if (strcmp (capability, "tipc") == 0) return true; #endif #if defined(ZMQ_HAVE_NORM) if (strcmp (capability, "norm") == 0) return true; #endif #if defined(ZMQ_HAVE_CURVE) if (strcmp (capability, "curve") == 0) return true; #endif #if defined(HAVE_LIBGSSAPI_KRB5) if (strcmp (capability, "gssapi") == 0) return true; #endif #if defined(ZMQ_HAVE_VMCI) if (strcmp (capability, "vmci") == 0) return true; #endif #if defined(ZMQ_BUILD_DRAFT_API) if (strcmp (capability, "draft") == 0) return true; #endif // Whatever the application asked for, we don't have return false; } zeromq-4.2.5/src/condition_variable.hpp0000664000372000037200000002224413255253220021077 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CONDITON_VARIABLE_HPP_INCLUDED__ #define __ZMQ_CONDITON_VARIABLE_HPP_INCLUDED__ #include "clock.hpp" #include "err.hpp" #include "mutex.hpp" // Condition variable class encapsulates OS mutex in a platform-independent way. #ifdef ZMQ_HAVE_WINDOWS #include "windows.hpp" #if defined(_MSC_VER) #if _MSC_VER >= 1800 #define _SUPPORT_CONDITION_VARIABLE 1 #else #define _SUPPORT_CONDITION_VARIABLE 0 #endif #else #if _cplusplus >= 201103L #define _SUPPORT_CONDITION_VARIABLE 1 #else #define _SUPPORT_CONDITION_VARIABLE 0 #endif #endif // Condition variable is supported from Windows Vista only, to use condition variable define _WIN32_WINNT to 0x0600 #if _WIN32_WINNT < 0x0600 && !_SUPPORT_CONDITION_VARIABLE namespace zmq { class condition_variable_t { public: inline condition_variable_t () { zmq_assert (false); } inline ~condition_variable_t () {} inline int wait (mutex_t *mutex_, int timeout_) { zmq_assert (false); return -1; } inline void broadcast () { zmq_assert (false); } private: // Disable copy construction and assignment. condition_variable_t (const condition_variable_t &); void operator= (const condition_variable_t &); }; } #else #if _SUPPORT_CONDITION_VARIABLE || defined(ZMQ_HAVE_WINDOWS_TARGET_XP) #include #include #endif namespace zmq { #if !defined(ZMQ_HAVE_WINDOWS_TARGET_XP) && _WIN32_WINNT >= 0x0600 class condition_variable_t { public: inline condition_variable_t () { InitializeConditionVariable (&cv); } inline ~condition_variable_t () {} inline int wait (mutex_t *mutex_, int timeout_) { int rc = SleepConditionVariableCS (&cv, mutex_->get_cs (), timeout_); if (rc != 0) return 0; rc = GetLastError (); if (rc != ERROR_TIMEOUT) win_assert (rc); errno = EAGAIN; return -1; } inline void broadcast () { WakeAllConditionVariable (&cv); } private: CONDITION_VARIABLE cv; // Disable copy construction and assignment. condition_variable_t (const condition_variable_t &); void operator= (const condition_variable_t &); }; #else class condition_variable_t { public: inline condition_variable_t () {} inline ~condition_variable_t () {} inline int wait (mutex_t *mutex_, int timeout_) { std::unique_lock lck (mtx); // lock mtx mutex_->unlock (); // unlock mutex_ int res = 0; if (timeout_ == -1) { cv.wait ( lck); // unlock mtx and wait cv.notify_all(), lock mtx after cv.notify_all() } else if (cv.wait_for (lck, std::chrono::milliseconds (timeout_)) == std::cv_status::timeout) { // time expired errno = EAGAIN; res = -1; } lck.unlock (); // unlock mtx mutex_->lock (); // lock mutex_ return res; } inline void broadcast () { std::unique_lock lck (mtx); // lock mtx cv.notify_all (); } private: std::condition_variable cv; std::mutex mtx; // Disable copy construction and assignment. condition_variable_t (const condition_variable_t &); void operator= (const condition_variable_t &); }; #endif } #endif #elif defined ZMQ_HAVE_VXWORKS #include namespace zmq { class condition_variable_t { public: inline condition_variable_t () {} inline ~condition_variable_t () { scoped_lock_t l (m_listenersMutex); for (size_t i = 0; i < m_listeners.size (); i++) { semDelete (m_listeners[i]); } } inline int wait (mutex_t *mutex_, int timeout_) { //Atomically releases lock, blocks the current executing thread, //and adds it to the list of threads waiting on *this. The thread //will be unblocked when broadcast() is executed. //It may also be unblocked spuriously. When unblocked, regardless //of the reason, lock is reacquired and wait exits. SEM_ID sem = semBCreate (SEM_Q_PRIORITY, SEM_EMPTY); { scoped_lock_t l (m_listenersMutex); m_listeners.push_back (sem); } mutex_->unlock (); int rc; if (timeout_ < 0) rc = semTake (sem, WAIT_FOREVER); else { int ticksPerSec = sysClkRateGet (); int timeoutTicks = (timeout_ * ticksPerSec) / 1000 + 1; rc = semTake (sem, timeoutTicks); } { scoped_lock_t l (m_listenersMutex); // remove sem from listeners for (size_t i = 0; i < m_listeners.size (); i++) { if (m_listeners[i] == sem) { m_listeners.erase (m_listeners.begin () + i); break; } } semDelete (sem); } mutex_->lock (); if (rc == 0) return 0; if (rc == S_objLib_OBJ_TIMEOUT) { errno = EAGAIN; return -1; } return -1; } inline void broadcast () { scoped_lock_t l (m_listenersMutex); for (size_t i = 0; i < m_listeners.size (); i++) { semGive (m_listeners[i]); } } private: mutex_t m_listenersMutex; std::vector m_listeners; // Disable copy construction and assignment. condition_variable_t (const condition_variable_t &); const condition_variable_t &operator= (const condition_variable_t &); }; } #else #include #if defined(__ANDROID_API__) && __ANDROID_API__ < 21 #define ANDROID_LEGACY extern "C" int pthread_cond_timedwait_monotonic_np (pthread_cond_t *, pthread_mutex_t *, const struct timespec *); #endif namespace zmq { class condition_variable_t { public: inline condition_variable_t () { pthread_condattr_t attr; pthread_condattr_init (&attr); #if !defined(ZMQ_HAVE_OSX) && !defined(ANDROID_LEGACY) pthread_condattr_setclock (&attr, CLOCK_MONOTONIC); #endif int rc = pthread_cond_init (&cond, &attr); posix_assert (rc); } inline ~condition_variable_t () { int rc = pthread_cond_destroy (&cond); posix_assert (rc); } inline int wait (mutex_t *mutex_, int timeout_) { int rc; if (timeout_ != -1) { struct timespec timeout; #ifdef ZMQ_HAVE_OSX timeout.tv_sec = 0; timeout.tv_nsec = 0; #else clock_gettime (CLOCK_MONOTONIC, &timeout); #endif timeout.tv_sec += timeout_ / 1000; timeout.tv_nsec += (timeout_ % 1000) * 1000000; if (timeout.tv_nsec > 1000000000) { timeout.tv_sec++; timeout.tv_nsec -= 1000000000; } #ifdef ZMQ_HAVE_OSX rc = pthread_cond_timedwait_relative_np ( &cond, mutex_->get_mutex (), &timeout); #elif defined(ANDROID_LEGACY) rc = pthread_cond_timedwait_monotonic_np ( &cond, mutex_->get_mutex (), &timeout); #else rc = pthread_cond_timedwait (&cond, mutex_->get_mutex (), &timeout); #endif } else rc = pthread_cond_wait (&cond, mutex_->get_mutex ()); if (rc == 0) return 0; if (rc == ETIMEDOUT) { errno = EAGAIN; return -1; } posix_assert (rc); return -1; } inline void broadcast () { int rc = pthread_cond_broadcast (&cond); posix_assert (rc); } private: pthread_cond_t cond; // Disable copy construction and assignment. condition_variable_t (const condition_variable_t &); const condition_variable_t &operator= (const condition_variable_t &); }; } #endif #endif zeromq-4.2.5/src/generic_mtrie.hpp0000664000372000037200000000763213255253220020064 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GENERIC_MTRIE_HPP_INCLUDED__ #define __ZMQ_GENERIC_MTRIE_HPP_INCLUDED__ #include #include #include "stdint.hpp" namespace zmq { // Multi-trie (prefix tree). Each node in the trie is a set of pointers. template class generic_mtrie_t { public: typedef T value_t; typedef const unsigned char *prefix_t; enum rm_result { not_found, last_value_removed, values_remain }; generic_mtrie_t (); ~generic_mtrie_t (); // Add key to the trie. Returns true iff no entry with the same prefix_ // and size_ existed before. bool add (prefix_t prefix_, size_t size_, value_t *value_); // Remove all entries with a specific value from the trie. // The call_on_uniq_ flag controls if the callback is invoked // when there are no entries left on a prefix only (true) // or on every removal (false). The arg_ argument is passed // through to the callback function. template void rm (value_t *value_, void (*func_) (const unsigned char *data_, size_t size_, Arg arg_), Arg arg_, bool call_on_uniq_); // Removes a specific entry from the trie. // Returns the result of the operation. rm_result rm (prefix_t prefix_, size_t size_, value_t *value_); // Calls a callback function for all matching entries, i.e. any node // corresponding to data_ or a prefix of it. The arg_ argument // is passed through to the callback function. template void match (prefix_t data_, size_t size_, void (*func_) (value_t *value_, Arg arg_), Arg arg_); private: bool add_helper (prefix_t prefix_, size_t size_, value_t *value_); template void rm_helper (value_t *value_, unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void (*func_) (prefix_t data_, size_t size_, Arg arg_), Arg arg_, bool call_on_uniq_); rm_result rm_helper (prefix_t prefix_, size_t size_, value_t *value_); bool is_redundant () const; typedef std::set pipes_t; pipes_t *pipes; unsigned char min; unsigned short count; unsigned short live_nodes; union { class generic_mtrie_t *node; class generic_mtrie_t **table; } next; generic_mtrie_t (const generic_mtrie_t &); const generic_mtrie_t & operator= (const generic_mtrie_t &); }; } #endif zeromq-4.2.5/src/pgm_socket.cpp0000664000372000037200000005562013255253220017376 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #ifdef ZMQ_HAVE_OPENPGM #ifdef ZMQ_HAVE_LINUX #include #endif #include #include #include #include "options.hpp" #include "pgm_socket.hpp" #include "config.hpp" #include "err.hpp" #include "random.hpp" #include "stdint.hpp" #ifndef MSG_ERRQUEUE #define MSG_ERRQUEUE 0x2000 #endif zmq::pgm_socket_t::pgm_socket_t (bool receiver_, const options_t &options_) : sock (NULL), options (options_), receiver (receiver_), pgm_msgv (NULL), pgm_msgv_len (0), nbytes_rec (0), nbytes_processed (0), pgm_msgv_processed (0) { } // Resolve PGM socket address. // network_ of the form : // e.g. eth0;239.192.0.1:7500 // link-local;224.250.0.1,224.250.0.2;224.250.0.3:8000 // ;[fe80::1%en0]:7500 int zmq::pgm_socket_t::init_address (const char *network_, struct pgm_addrinfo_t **res, uint16_t *port_number) { // Parse port number, start from end for IPv6 const char *port_delim = strrchr (network_, ':'); if (!port_delim) { errno = EINVAL; return -1; } *port_number = atoi (port_delim + 1); char network[256]; if (port_delim - network_ >= (int) sizeof (network) - 1) { errno = EINVAL; return -1; } memset (network, '\0', sizeof (network)); memcpy (network, network_, port_delim - network_); pgm_error_t *pgm_error = NULL; struct pgm_addrinfo_t hints; memset (&hints, 0, sizeof (hints)); hints.ai_family = AF_UNSPEC; if (!pgm_getaddrinfo (network, NULL, res, &pgm_error)) { // Invalid parameters don't set pgm_error_t. zmq_assert (pgm_error != NULL); if (pgm_error->domain == PGM_ERROR_DOMAIN_IF && // NB: cannot catch EAI_BADFLAGS. (pgm_error->code != PGM_ERROR_SERVICE && pgm_error->code != PGM_ERROR_SOCKTNOSUPPORT)) { // User, host, or network configuration or transient error. pgm_error_free (pgm_error); errno = EINVAL; return -1; } // Fatal OpenPGM internal error. zmq_assert (false); } return 0; } // Create, bind and connect PGM socket. int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) { // Can not open transport before destroying old one. zmq_assert (sock == NULL); zmq_assert (options.rate > 0); // Zero counter used in msgrecv. nbytes_rec = 0; nbytes_processed = 0; pgm_msgv_processed = 0; uint16_t port_number; struct pgm_addrinfo_t *res = NULL; sa_family_t sa_family; pgm_error_t *pgm_error = NULL; if (init_address (network_, &res, &port_number) < 0) { goto err_abort; } zmq_assert (res != NULL); // Pick up detected IP family. sa_family = res->ai_send_addrs[0].gsr_group.ss_family; // Create IP/PGM or UDP/PGM socket. if (udp_encapsulation_) { if (!pgm_socket (&sock, sa_family, SOCK_SEQPACKET, IPPROTO_UDP, &pgm_error)) { // Invalid parameters don't set pgm_error_t. zmq_assert (pgm_error != NULL); if (pgm_error->domain == PGM_ERROR_DOMAIN_SOCKET && (pgm_error->code != PGM_ERROR_BADF && pgm_error->code != PGM_ERROR_FAULT && pgm_error->code != PGM_ERROR_NOPROTOOPT && pgm_error->code != PGM_ERROR_FAILED)) // User, host, or network configuration or transient error. goto err_abort; // Fatal OpenPGM internal error. zmq_assert (false); } // All options are of data type int const int encapsulation_port = port_number; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_UDP_ENCAP_UCAST_PORT, &encapsulation_port, sizeof (encapsulation_port))) goto err_abort; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_UDP_ENCAP_MCAST_PORT, &encapsulation_port, sizeof (encapsulation_port))) goto err_abort; } else { if (!pgm_socket (&sock, sa_family, SOCK_SEQPACKET, IPPROTO_PGM, &pgm_error)) { // Invalid parameters don't set pgm_error_t. zmq_assert (pgm_error != NULL); if (pgm_error->domain == PGM_ERROR_DOMAIN_SOCKET && (pgm_error->code != PGM_ERROR_BADF && pgm_error->code != PGM_ERROR_FAULT && pgm_error->code != PGM_ERROR_NOPROTOOPT && pgm_error->code != PGM_ERROR_FAILED)) // User, host, or network configuration or transient error. goto err_abort; // Fatal OpenPGM internal error. zmq_assert (false); } } { const int rcvbuf = (int) options.rcvbuf; if (rcvbuf >= 0) { if (!pgm_setsockopt (sock, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof (rcvbuf))) goto err_abort; } const int sndbuf = (int) options.sndbuf; if (sndbuf >= 0) { if (!pgm_setsockopt (sock, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof (sndbuf))) goto err_abort; } const int max_tpdu = (int) options.multicast_maxtpdu; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_MTU, &max_tpdu, sizeof (max_tpdu))) goto err_abort; } if (receiver) { const int recv_only = 1, rxw_max_tpdu = (int) options.multicast_maxtpdu, rxw_sqns = compute_sqns (rxw_max_tpdu), peer_expiry = pgm_secs (300), spmr_expiry = pgm_msecs (25), nak_bo_ivl = pgm_msecs (50), nak_rpt_ivl = pgm_msecs (200), nak_rdata_ivl = pgm_msecs (200), nak_data_retries = 50, nak_ncf_retries = 50; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_RECV_ONLY, &recv_only, sizeof (recv_only)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_RXW_SQNS, &rxw_sqns, sizeof (rxw_sqns)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_PEER_EXPIRY, &peer_expiry, sizeof (peer_expiry)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_SPMR_EXPIRY, &spmr_expiry, sizeof (spmr_expiry)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_BO_IVL, &nak_bo_ivl, sizeof (nak_bo_ivl)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_RPT_IVL, &nak_rpt_ivl, sizeof (nak_rpt_ivl)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_RDATA_IVL, &nak_rdata_ivl, sizeof (nak_rdata_ivl)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_DATA_RETRIES, &nak_data_retries, sizeof (nak_data_retries)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_NAK_NCF_RETRIES, &nak_ncf_retries, sizeof (nak_ncf_retries))) goto err_abort; } else { const int send_only = 1, max_rte = (int) ((options.rate * 1000) / 8), txw_max_tpdu = (int) options.multicast_maxtpdu, txw_sqns = compute_sqns (txw_max_tpdu), ambient_spm = pgm_secs (30), heartbeat_spm[] = { pgm_msecs (100), pgm_msecs (100), pgm_msecs (100), pgm_msecs (100), pgm_msecs (1300), pgm_secs (7), pgm_secs (16), pgm_secs (25), pgm_secs (30)}; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_SEND_ONLY, &send_only, sizeof (send_only)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_ODATA_MAX_RTE, &max_rte, sizeof (max_rte)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_TXW_SQNS, &txw_sqns, sizeof (txw_sqns)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_AMBIENT_SPM, &ambient_spm, sizeof (ambient_spm)) || !pgm_setsockopt (sock, IPPROTO_PGM, PGM_HEARTBEAT_SPM, &heartbeat_spm, sizeof (heartbeat_spm))) goto err_abort; } // PGM transport GSI. struct pgm_sockaddr_t addr; memset (&addr, 0, sizeof (addr)); addr.sa_port = port_number; addr.sa_addr.sport = DEFAULT_DATA_SOURCE_PORT; // Create random GSI. uint32_t buf[2]; buf[0] = generate_random (); buf[1] = generate_random (); if (!pgm_gsi_create_from_data (&addr.sa_addr.gsi, (uint8_t *) buf, 8)) goto err_abort; // Bind a transport to the specified network devices. struct pgm_interface_req_t if_req; memset (&if_req, 0, sizeof (if_req)); if_req.ir_interface = res->ai_recv_addrs[0].gsr_interface; if_req.ir_scope_id = 0; if (AF_INET6 == sa_family) { struct sockaddr_in6 sa6; memcpy (&sa6, &res->ai_recv_addrs[0].gsr_group, sizeof (sa6)); if_req.ir_scope_id = sa6.sin6_scope_id; } if (!pgm_bind3 (sock, &addr, sizeof (addr), &if_req, sizeof (if_req), &if_req, sizeof (if_req), &pgm_error)) { // Invalid parameters don't set pgm_error_t. zmq_assert (pgm_error != NULL); if ((pgm_error->domain == PGM_ERROR_DOMAIN_SOCKET || pgm_error->domain == PGM_ERROR_DOMAIN_IF) && (pgm_error->code != PGM_ERROR_INVAL && pgm_error->code != PGM_ERROR_BADF && pgm_error->code != PGM_ERROR_FAULT)) // User, host, or network configuration or transient error. goto err_abort; // Fatal OpenPGM internal error. zmq_assert (false); } // Join IP multicast groups. for (unsigned i = 0; i < res->ai_recv_addrs_len; i++) { if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_JOIN_GROUP, &res->ai_recv_addrs[i], sizeof (struct group_req))) goto err_abort; } if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_SEND_GROUP, &res->ai_send_addrs[0], sizeof (struct group_req))) goto err_abort; pgm_freeaddrinfo (res); res = NULL; // Set IP level parameters. { // Multicast loopback disabled by default const int multicast_loop = 0; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_MULTICAST_LOOP, &multicast_loop, sizeof (multicast_loop))) goto err_abort; const int multicast_hops = options.multicast_hops; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_MULTICAST_HOPS, &multicast_hops, sizeof (multicast_hops))) goto err_abort; // Expedited Forwarding PHB for network elements, no ECN. // Ignore return value due to varied runtime support. const int dscp = 0x2e << 2; if (AF_INET6 != sa_family) pgm_setsockopt (sock, IPPROTO_PGM, PGM_TOS, &dscp, sizeof (dscp)); const int nonblocking = 1; if (!pgm_setsockopt (sock, IPPROTO_PGM, PGM_NOBLOCK, &nonblocking, sizeof (nonblocking))) goto err_abort; } // Connect PGM transport to start state machine. if (!pgm_connect (sock, &pgm_error)) { // Invalid parameters don't set pgm_error_t. zmq_assert (pgm_error != NULL); goto err_abort; } // For receiver transport preallocate pgm_msgv array. if (receiver) { zmq_assert (in_batch_size > 0); size_t max_tsdu_size = get_max_tsdu_size (); pgm_msgv_len = (int) in_batch_size / max_tsdu_size; if ((int) in_batch_size % max_tsdu_size) pgm_msgv_len++; zmq_assert (pgm_msgv_len); pgm_msgv = (pgm_msgv_t *) malloc (sizeof (pgm_msgv_t) * pgm_msgv_len); alloc_assert (pgm_msgv); } return 0; err_abort: if (sock != NULL) { pgm_close (sock, FALSE); sock = NULL; } if (res != NULL) { pgm_freeaddrinfo (res); res = NULL; } if (pgm_error != NULL) { pgm_error_free (pgm_error); pgm_error = NULL; } errno = EINVAL; return -1; } zmq::pgm_socket_t::~pgm_socket_t () { if (pgm_msgv) free (pgm_msgv); if (sock) pgm_close (sock, TRUE); } // Get receiver fds. receive_fd_ is signaled for incoming packets, // waiting_pipe_fd_ is signaled for state driven events and data. void zmq::pgm_socket_t::get_receiver_fds (fd_t *receive_fd_, fd_t *waiting_pipe_fd_) { socklen_t socklen; bool rc; zmq_assert (receive_fd_); zmq_assert (waiting_pipe_fd_); socklen = sizeof (*receive_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_RECV_SOCK, receive_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*receive_fd_)); socklen = sizeof (*waiting_pipe_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_PENDING_SOCK, waiting_pipe_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*waiting_pipe_fd_)); } // Get fds and store them into user allocated memory. // send_fd is for non-blocking send wire notifications. // receive_fd_ is for incoming back-channel protocol packets. // rdata_notify_fd_ is raised for waiting repair transmissions. // pending_notify_fd_ is for state driven events. void zmq::pgm_socket_t::get_sender_fds (fd_t *send_fd_, fd_t *receive_fd_, fd_t *rdata_notify_fd_, fd_t *pending_notify_fd_) { socklen_t socklen; bool rc; zmq_assert (send_fd_); zmq_assert (receive_fd_); zmq_assert (rdata_notify_fd_); zmq_assert (pending_notify_fd_); socklen = sizeof (*send_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_SEND_SOCK, send_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*receive_fd_)); socklen = sizeof (*receive_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_RECV_SOCK, receive_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*receive_fd_)); socklen = sizeof (*rdata_notify_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_REPAIR_SOCK, rdata_notify_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*rdata_notify_fd_)); socklen = sizeof (*pending_notify_fd_); rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_PENDING_SOCK, pending_notify_fd_, &socklen); zmq_assert (rc); zmq_assert (socklen == sizeof (*pending_notify_fd_)); } // Send one APDU, transmit window owned memory. // data_len_ must be less than one TPDU. size_t zmq::pgm_socket_t::send (unsigned char *data_, size_t data_len_) { size_t nbytes = 0; const int status = pgm_send (sock, data_, data_len_, &nbytes); // We have to write all data as one packet. if (nbytes > 0) { zmq_assert (status == PGM_IO_STATUS_NORMAL); zmq_assert (nbytes == data_len_); } else { zmq_assert (status == PGM_IO_STATUS_RATE_LIMITED || status == PGM_IO_STATUS_WOULD_BLOCK); if (status == PGM_IO_STATUS_RATE_LIMITED) errno = ENOMEM; else errno = EBUSY; } // Save return value. last_tx_status = status; return nbytes; } long zmq::pgm_socket_t::get_rx_timeout () { if (last_rx_status != PGM_IO_STATUS_RATE_LIMITED && last_rx_status != PGM_IO_STATUS_TIMER_PENDING) return -1; struct timeval tv; socklen_t optlen = sizeof (tv); const bool rc = pgm_getsockopt (sock, IPPROTO_PGM, last_rx_status == PGM_IO_STATUS_RATE_LIMITED ? PGM_RATE_REMAIN : PGM_TIME_REMAIN, &tv, &optlen); zmq_assert (rc); const long timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); return timeout; } long zmq::pgm_socket_t::get_tx_timeout () { if (last_tx_status != PGM_IO_STATUS_RATE_LIMITED) return -1; struct timeval tv; socklen_t optlen = sizeof (tv); const bool rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_RATE_REMAIN, &tv, &optlen); zmq_assert (rc); const long timeout = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); return timeout; } // Return max TSDU size without fragmentation from current PGM transport. size_t zmq::pgm_socket_t::get_max_tsdu_size () { int max_tsdu = 0; socklen_t optlen = sizeof (max_tsdu); bool rc = pgm_getsockopt (sock, IPPROTO_PGM, PGM_MSS, &max_tsdu, &optlen); zmq_assert (rc); zmq_assert (optlen == sizeof (max_tsdu)); return (size_t) max_tsdu; } // pgm_recvmsgv is called to fill the pgm_msgv array up to pgm_msgv_len. // In subsequent calls data from pgm_msgv structure are returned. ssize_t zmq::pgm_socket_t::receive (void **raw_data_, const pgm_tsi_t **tsi_) { size_t raw_data_len = 0; // We just sent all data from pgm_transport_recvmsgv up // and have to return 0 that another engine in this thread is scheduled. if (nbytes_rec == nbytes_processed && nbytes_rec > 0) { // Reset all the counters. nbytes_rec = 0; nbytes_processed = 0; pgm_msgv_processed = 0; errno = EAGAIN; return 0; } // If we have are going first time or if we have processed all pgm_msgv_t // structure previously read from the pgm socket. if (nbytes_rec == nbytes_processed) { // Check program flow. zmq_assert (pgm_msgv_processed == 0); zmq_assert (nbytes_processed == 0); zmq_assert (nbytes_rec == 0); // Receive a vector of Application Protocol Domain Unit's (APDUs) // from the transport. pgm_error_t *pgm_error = NULL; const int status = pgm_recvmsgv (sock, pgm_msgv, pgm_msgv_len, MSG_ERRQUEUE, &nbytes_rec, &pgm_error); // Invalid parameters. zmq_assert (status != PGM_IO_STATUS_ERROR); last_rx_status = status; // In a case when no ODATA/RDATA fired POLLIN event (SPM...) // pgm_recvmsg returns PGM_IO_STATUS_TIMER_PENDING. if (status == PGM_IO_STATUS_TIMER_PENDING) { zmq_assert (nbytes_rec == 0); // In case if no RDATA/ODATA caused POLLIN 0 is // returned. nbytes_rec = 0; errno = EBUSY; return 0; } // Send SPMR, NAK, ACK is rate limited. if (status == PGM_IO_STATUS_RATE_LIMITED) { zmq_assert (nbytes_rec == 0); // In case if no RDATA/ODATA caused POLLIN 0 is returned. nbytes_rec = 0; errno = ENOMEM; return 0; } // No peers and hence no incoming packets. if (status == PGM_IO_STATUS_WOULD_BLOCK) { zmq_assert (nbytes_rec == 0); // In case if no RDATA/ODATA caused POLLIN 0 is returned. nbytes_rec = 0; errno = EAGAIN; return 0; } // Data loss. if (status == PGM_IO_STATUS_RESET) { struct pgm_sk_buff_t *skb = pgm_msgv[0].msgv_skb[0]; // Save lost data TSI. *tsi_ = &skb->tsi; nbytes_rec = 0; // In case of dala loss -1 is returned. errno = EINVAL; pgm_free_skb (skb); return -1; } zmq_assert (status == PGM_IO_STATUS_NORMAL); } else { zmq_assert (pgm_msgv_processed <= pgm_msgv_len); } // Zero byte payloads are valid in PGM, but not 0MQ protocol. zmq_assert (nbytes_rec > 0); // Only one APDU per pgm_msgv_t structure is allowed. zmq_assert (pgm_msgv[pgm_msgv_processed].msgv_len == 1); struct pgm_sk_buff_t *skb = pgm_msgv[pgm_msgv_processed].msgv_skb[0]; // Take pointers from pgm_msgv_t structure. *raw_data_ = skb->data; raw_data_len = skb->len; // Save current TSI. *tsi_ = &skb->tsi; // Move the the next pgm_msgv_t structure. pgm_msgv_processed++; zmq_assert (pgm_msgv_processed <= pgm_msgv_len); nbytes_processed += raw_data_len; return raw_data_len; } void zmq::pgm_socket_t::process_upstream () { pgm_msgv_t dummy_msg; size_t dummy_bytes = 0; pgm_error_t *pgm_error = NULL; const int status = pgm_recvmsgv (sock, &dummy_msg, 1, MSG_ERRQUEUE, &dummy_bytes, &pgm_error); // Invalid parameters. zmq_assert (status != PGM_IO_STATUS_ERROR); // No data should be returned. zmq_assert (dummy_bytes == 0 && (status == PGM_IO_STATUS_TIMER_PENDING || status == PGM_IO_STATUS_RATE_LIMITED || status == PGM_IO_STATUS_WOULD_BLOCK)); last_rx_status = status; if (status == PGM_IO_STATUS_TIMER_PENDING) errno = EBUSY; else if (status == PGM_IO_STATUS_RATE_LIMITED) errno = ENOMEM; else errno = EAGAIN; } int zmq::pgm_socket_t::compute_sqns (int tpdu_) { // Convert rate into B/ms. uint64_t rate = uint64_t (options.rate) / 8; // Compute the size of the buffer in bytes. uint64_t size = uint64_t (options.recovery_ivl) * rate; // Translate the size into number of packets. uint64_t sqns = size / tpdu_; // Buffer should be able to hold at least one packet. if (sqns == 0) sqns = 1; return (int) sqns; } #endif zeromq-4.2.5/src/v2_protocol.hpp0000664000372000037200000000331613255253220017513 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_V2_PROTOCOL_HPP_INCLUDED__ #define __ZMQ_V2_PROTOCOL_HPP_INCLUDED__ namespace zmq { // Definition of constants for ZMTP/2.0 transport protocol. class v2_protocol_t { public: // Message flags. enum { more_flag = 1, large_flag = 2, command_flag = 4 }; }; } #endif zeromq-4.2.5/src/v1_decoder.cpp0000664000372000037200000001147013255253220017251 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include #include "decoder.hpp" #include "v1_decoder.hpp" #include "likely.hpp" #include "wire.hpp" #include "err.hpp" zmq::v1_decoder_t::v1_decoder_t (size_t bufsize_, int64_t maxmsgsize_) : c_single_allocator (bufsize_), decoder_base_t (this), maxmsgsize (maxmsgsize_) { int rc = in_progress.init (); errno_assert (rc == 0); // At the beginning, read one byte and go to one_byte_size_ready state. next_step (tmpbuf, 1, &v1_decoder_t::one_byte_size_ready); } zmq::v1_decoder_t::~v1_decoder_t () { int rc = in_progress.close (); errno_assert (rc == 0); } int zmq::v1_decoder_t::one_byte_size_ready (unsigned char const *) { // First byte of size is read. If it is 0xff read 8-byte size. // Otherwise allocate the buffer for message data and read the // message data into it. if (*tmpbuf == 0xff) next_step (tmpbuf, 8, &v1_decoder_t::eight_byte_size_ready); else { // There has to be at least one byte (the flags) in the message). if (!*tmpbuf) { errno = EPROTO; return -1; } if (maxmsgsize >= 0 && (int64_t) (*tmpbuf - 1) > maxmsgsize) { errno = EMSGSIZE; return -1; } int rc = in_progress.close (); assert (rc == 0); rc = in_progress.init_size (*tmpbuf - 1); if (rc != 0) { errno_assert (errno == ENOMEM); rc = in_progress.init (); errno_assert (rc == 0); errno = ENOMEM; return -1; } next_step (tmpbuf, 1, &v1_decoder_t::flags_ready); } return 0; } int zmq::v1_decoder_t::eight_byte_size_ready (unsigned char const *) { // 8-byte payload length is read. Allocate the buffer // for message body and read the message data into it. const uint64_t payload_length = get_uint64 (tmpbuf); // There has to be at least one byte (the flags) in the message). if (payload_length == 0) { errno = EPROTO; return -1; } // Message size must not exceed the maximum allowed size. if (maxmsgsize >= 0 && payload_length - 1 > (uint64_t) maxmsgsize) { errno = EMSGSIZE; return -1; } // Message size must fit within range of size_t data type. if (payload_length - 1 > std::numeric_limits::max ()) { errno = EMSGSIZE; return -1; } const size_t msg_size = static_cast (payload_length - 1); int rc = in_progress.close (); assert (rc == 0); rc = in_progress.init_size (msg_size); if (rc != 0) { errno_assert (errno == ENOMEM); rc = in_progress.init (); errno_assert (rc == 0); errno = ENOMEM; return -1; } next_step (tmpbuf, 1, &v1_decoder_t::flags_ready); return 0; } int zmq::v1_decoder_t::flags_ready (unsigned char const *) { // Store the flags from the wire into the message structure. in_progress.set_flags (tmpbuf[0] & msg_t::more); next_step (in_progress.data (), in_progress.size (), &v1_decoder_t::message_ready); return 0; } int zmq::v1_decoder_t::message_ready (unsigned char const *) { // Message is completely read. Push it further and start reading // new message. (in_progress is a 0-byte message after this point.) next_step (tmpbuf, 1, &v1_decoder_t::one_byte_size_ready); return 1; } zeromq-4.2.5/src/random.cpp0000664000372000037200000001371113255253220016516 0ustar00travistravis00000000000000/* Copyright (c) 2007-2017 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #if !defined ZMQ_HAVE_WINDOWS #include #endif #include "random.hpp" #include "stdint.hpp" #include "clock.hpp" #include "mutex.hpp" #include "macros.hpp" #if defined(ZMQ_USE_TWEETNACL) #include "tweetnacl.h" #elif defined(ZMQ_USE_LIBSODIUM) #include "sodium.h" #endif void zmq::seed_random () { #if defined ZMQ_HAVE_WINDOWS int pid = (int) GetCurrentProcessId (); #else int pid = (int) getpid (); #endif srand ((unsigned int) (clock_t::now_us () + pid)); } uint32_t zmq::generate_random () { // Compensate for the fact that rand() returns signed integer. uint32_t low = (uint32_t) rand (); uint32_t high = (uint32_t) rand (); high <<= (sizeof (int) * 8 - 1); return high | low; } // When different threads have their own context the file descriptor // variable is shared and is subject to race conditions in tweetnacl, // that lead to file descriptors leaks. In long-running programs with // ephemeral threads this is a problem as it accumulates. // thread-local storage cannot be used to initialise the file descriptor // as it is perfectly legal to share a context among many threads, each // of which might call curve APIs. // Also libsodium documentation specifically states that sodium_init // must not be called concurrently from multiple threads, for the // same reason. Inspecting the code also reveals that the close API is // not thread safe. // The context class cannot be used with static variables as the curve // utility APIs like zmq_curve_keypair also call into the crypto // library. // The safest solution for all use cases therefore is to have a // static lock to serialize calls into an initialiser and a finaliser, // using refcounts to make sure that a thread does not close the library // while another is still using it. To avoid the static initialization // order fiasco, this is done using function-local statics, if the // compiler implementation supports thread-safe initialization of those. // Otherwise, we fall back to global statics. // HOWEVER, this initialisation code imposes ordering constraints, which // are not obvious to users of libzmq, and may lead to problems if atexit // or similar methods are used for cleanup. // In that case, a strict ordering is imposed whereas the contexts MUST // be initialised BEFORE registering the cleanup with atexit. CZMQ is an // example. Hence we make the choice to restrict this global transition // mechanism ONLY to Tweenacl + *NIX (when using /dev/urandom) as it is // the less risky option. // TODO if there is some other user of libsodium besides libzmq, this must // be synchronized by the application. This should probably also be // configurable via config.h // TODO this should probably be done via config.h #if __cplusplus >= 201103L \ || (defined(__cpp_threadsafe_static_init) \ && __cpp_threadsafe_static_init >= 200806) \ || (defined(_MSC_VER) && _MSC_VER >= 1900) #define ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT 1 // TODO this might probably also be set if a sufficiently recent gcc is used // without -fno-threadsafe-statics, but this cannot be determined at // compile-time, so it must be set via config.h #else #define ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT 0 #endif #if !ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT \ && (defined(ZMQ_USE_TWEETNACL) && !defined(ZMQ_HAVE_WINDOWS) \ && !defined(ZMQ_HAVE_GETRANDOM)) static unsigned int random_refcount = 0; static zmq::mutex_t random_sync; #endif static void manage_random (bool init) { #if defined(ZMQ_USE_TWEETNACL) && !defined(ZMQ_HAVE_WINDOWS) \ && !defined(ZMQ_HAVE_GETRANDOM) #if ZMQ_HAVE_THREADSAFE_STATIC_LOCAL_INIT static int random_refcount = 0; static zmq::mutex_t random_sync; #endif if (init) { zmq::scoped_lock_t locker (random_sync); if (random_refcount == 0) { int rc = sodium_init (); zmq_assert (rc != -1); } ++random_refcount; } else { zmq::scoped_lock_t locker (random_sync); --random_refcount; if (random_refcount == 0) { randombytes_close (); } } #elif defined(ZMQ_USE_LIBSODIUM) if (init) { int rc = sodium_init (); zmq_assert (rc != -1); } else { randombytes_close (); } #endif } void zmq::random_open (void) { manage_random (true); } void zmq::random_close (void) { manage_random (false); } zeromq-4.2.5/src/metadata.hpp0000664000372000037200000000423213255253220017021 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_METADATA_HPP_INCLUDED__ #define __ZMQ_METADATA_HPP_INCLUDED__ #include #include #include "atomic_counter.hpp" namespace zmq { class metadata_t { public: typedef std::map dict_t; metadata_t (const dict_t &dict); // Returns pointer to property value or NULL if // property is not found. const char *get (const std::string &property) const; void add_ref (); // Drop reference. Returns true iff the reference // counter drops to zero. bool drop_ref (); private: metadata_t (const metadata_t &); metadata_t &operator= (const metadata_t &); // Reference counter. atomic_counter_t ref_cnt; // Dictionary holding metadata. const dict_t dict; }; } #endif zeromq-4.2.5/src/dish.hpp0000664000372000037200000000701513255253220016172 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_DISH_HPP_INCLUDED__ #define __ZMQ_DISH_HPP_INCLUDED__ #include #include #include "socket_base.hpp" #include "session_base.hpp" #include "dist.hpp" #include "fq.hpp" #include "trie.hpp" namespace zmq { class ctx_t; class pipe_t; class io_thread_t; class dish_t : public socket_base_t { public: dish_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~dish_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); bool xhas_out (); int xrecv (zmq::msg_t *msg_); bool xhas_in (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xhiccuped (pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); int xjoin (const char *group_); int xleave (const char *group_); private: // Send subscriptions to a pipe void send_subscriptions (pipe_t *pipe_); // Fair queueing object for inbound pipes. fq_t fq; // Object for distributing the subscriptions upstream. dist_t dist; // The repository of subscriptions. typedef std::set subscriptions_t; subscriptions_t subscriptions; // If true, 'message' contains a matching message to return on the // next recv call. bool has_message; msg_t message; dish_t (const dish_t &); const dish_t &operator= (const dish_t &); }; class dish_session_t : public session_base_t { public: dish_session_t (zmq::io_thread_t *io_thread_, bool connect_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_); ~dish_session_t (); // Overrides of the functions from session_base_t. int push_msg (msg_t *msg_); int pull_msg (msg_t *msg_); void reset (); private: enum { group, body } state; msg_t group_msg; dish_session_t (const dish_session_t &); const dish_session_t &operator= (const dish_session_t &); }; } #endif zeromq-4.2.5/src/select.cpp0000664000372000037200000004767413255253220016534 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "select.hpp" #if defined ZMQ_USE_SELECT #if defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_HPUX #include #include #include #elif defined ZMQ_HAVE_OPENVMS #include #include #elif defined ZMQ_HAVE_VXWORKS #include #include #include #else #include #endif #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" #include #include #include zmq::select_t::select_t (const zmq::thread_ctx_t &ctx_) : worker_poller_base_t (ctx_), #if defined ZMQ_HAVE_WINDOWS // Fine as long as map is not cleared. current_family_entry_it (family_entries.end ()) #else maxfd (retired_fd) #endif { #if defined ZMQ_HAVE_WINDOWS for (size_t i = 0; i < fd_family_cache_size; ++i) fd_family_cache[i] = std::make_pair (retired_fd, 0); #endif } zmq::select_t::~select_t () { stop_worker (); } zmq::select_t::handle_t zmq::select_t::add_fd (fd_t fd_, i_poll_events *events_) { check_thread (); zmq_assert (fd_ != retired_fd); fd_entry_t fd_entry; fd_entry.fd = fd_; fd_entry.events = events_; #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (fd_); wsa_assert (family != AF_UNSPEC); family_entry_t &family_entry = family_entries[family]; #endif family_entry.fd_entries.push_back (fd_entry); FD_SET (fd_, &family_entry.fds_set.error); #if !defined ZMQ_HAVE_WINDOWS if (fd_ > maxfd) maxfd = fd_; #endif adjust_load (1); return fd_; } zmq::select_t::fd_entries_t::iterator zmq::select_t::find_fd_entry_by_handle (fd_entries_t &fd_entries, handle_t handle_) { fd_entries_t::iterator fd_entry_it; for (fd_entry_it = fd_entries.begin (); fd_entry_it != fd_entries.end (); ++fd_entry_it) if (fd_entry_it->fd == handle_) break; return fd_entry_it; } void zmq::select_t::trigger_events (const fd_entries_t &fd_entries_, const fds_set_t &local_fds_set_, int event_count_) { // Size is cached to avoid iteration through recently added descriptors. for (fd_entries_t::size_type i = 0, size = fd_entries_.size (); i < size && event_count_ > 0; ++i) { // fd_entries_[i] may not be stored, since calls to // in_event/out_event may reallocate the vector if (is_retired_fd (fd_entries_[i])) continue; if (FD_ISSET (fd_entries_[i].fd, &local_fds_set_.read)) { fd_entries_[i].events->in_event (); --event_count_; } // TODO: can the is_retired_fd be true at this point? if it // was retired before, we would already have continued, and I // don't see where it might have been modified // And if rc == 0, we can break instead of continuing if (is_retired_fd (fd_entries_[i]) || event_count_ == 0) continue; if (FD_ISSET (fd_entries_[i].fd, &local_fds_set_.write)) { fd_entries_[i].events->out_event (); --event_count_; } // TODO: same as above if (is_retired_fd (fd_entries_[i]) || event_count_ == 0) continue; if (FD_ISSET (fd_entries_[i].fd, &local_fds_set_.error)) { fd_entries_[i].events->in_event (); --event_count_; } } } #if defined ZMQ_HAVE_WINDOWS int zmq::select_t::try_retire_fd_entry ( family_entries_t::iterator family_entry_it, zmq::fd_t &handle_) { family_entry_t &family_entry = family_entry_it->second; fd_entries_t::iterator fd_entry_it = find_fd_entry_by_handle (family_entry.fd_entries, handle_); if (fd_entry_it == family_entry.fd_entries.end ()) return 0; fd_entry_t &fd_entry = *fd_entry_it; zmq_assert (fd_entry.fd != retired_fd); if (family_entry_it != current_family_entry_it) { // Family is not currently being iterated and can be safely // modified in-place. So later it can be skipped without // re-verifying its content. family_entry.fd_entries.erase (fd_entry_it); } else { // Otherwise mark removed entries as retired. It will be cleaned up // at the end of the iteration. See zmq::select_t::loop fd_entry.fd = retired_fd; family_entry.has_retired = true; } family_entry.fds_set.remove_fd (handle_); return 1; } #endif void zmq::select_t::rm_fd (handle_t handle_) { check_thread (); int retired = 0; #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (handle_); if (family != AF_UNSPEC) { family_entries_t::iterator family_entry_it = family_entries.find (family); retired += try_retire_fd_entry (family_entry_it, handle_); } else { // get_fd_family may fail and return AF_UNSPEC if the socket was not // successfully connected. In that case, we need to look for the // socket in all family_entries. family_entries_t::iterator end = family_entries.end (); for (family_entries_t::iterator family_entry_it = family_entries.begin (); family_entry_it != end; ++family_entry_it) { if (retired += try_retire_fd_entry (family_entry_it, handle_)) { break; } } } #else fd_entries_t::iterator fd_entry_it = find_fd_entry_by_handle (family_entry.fd_entries, handle_); assert (fd_entry_it != family_entry.fd_entries.end ()); zmq_assert (fd_entry_it->fd != retired_fd); fd_entry_it->fd = retired_fd; family_entry.fds_set.remove_fd (handle_); ++retired; if (handle_ == maxfd) { maxfd = retired_fd; for (fd_entry_it = family_entry.fd_entries.begin (); fd_entry_it != family_entry.fd_entries.end (); ++fd_entry_it) if (fd_entry_it->fd > maxfd) maxfd = fd_entry_it->fd; } family_entry.has_retired = true; #endif zmq_assert (retired == 1); adjust_load (-1); } void zmq::select_t::set_pollin (handle_t handle_) { check_thread (); #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (handle_); wsa_assert (family != AF_UNSPEC); family_entry_t &family_entry = family_entries[family]; #endif FD_SET (handle_, &family_entry.fds_set.read); } void zmq::select_t::reset_pollin (handle_t handle_) { check_thread (); #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (handle_); wsa_assert (family != AF_UNSPEC); family_entry_t &family_entry = family_entries[family]; #endif FD_CLR (handle_, &family_entry.fds_set.read); } void zmq::select_t::set_pollout (handle_t handle_) { check_thread (); #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (handle_); wsa_assert (family != AF_UNSPEC); family_entry_t &family_entry = family_entries[family]; #endif FD_SET (handle_, &family_entry.fds_set.write); } void zmq::select_t::reset_pollout (handle_t handle_) { check_thread (); #if defined ZMQ_HAVE_WINDOWS u_short family = get_fd_family (handle_); wsa_assert (family != AF_UNSPEC); family_entry_t &family_entry = family_entries[family]; #endif FD_CLR (handle_, &family_entry.fds_set.write); } void zmq::select_t::stop () { check_thread (); // no-op... thread is stopped when no more fds or timers are registered } int zmq::select_t::max_fds () { return FD_SETSIZE; } void zmq::select_t::loop () { while (true) { // Execute any due timers. int timeout = (int) execute_timers (); cleanup_retired (); #ifdef _WIN32 if (family_entries.empty ()) { #else if (family_entry.fd_entries.empty ()) { #endif zmq_assert (get_load () == 0); if (timeout == 0) break; // TODO sleep for timeout continue; } #if defined ZMQ_HAVE_OSX struct timeval tv = {(long) (timeout / 1000), timeout % 1000 * 1000}; #else struct timeval tv = {(long) (timeout / 1000), (long) (timeout % 1000 * 1000)}; #endif #if defined ZMQ_HAVE_WINDOWS /* On Windows select does not allow to mix descriptors from different service providers. It seems to work for AF_INET and AF_INET6, but fails for AF_INET and VMCI. The workaround is to use WSAEventSelect and WSAWaitForMultipleEvents to wait, then use select to find out what actually changed. WSAWaitForMultipleEvents cannot be used alone, because it does not support more than 64 events which is not enough. To reduce unnecessary overhead, WSA is only used when there are more than one family. Moreover, AF_INET and AF_INET6 are considered the same family because Windows seems to handle them properly. See get_fd_family for details. */ // If there is just one family, there is no reason to use WSA events. int rc = 0; const bool use_wsa_events = family_entries.size () > 1; if (use_wsa_events) { // TODO: I don't really understand why we are doing this. If any of // the events was signaled, we will call select for each fd_family // afterwards. The only benefit is if none of the events was // signaled, then we continue early. // IMHO, either WSAEventSelect/WSAWaitForMultipleEvents or select // should be used, but not both wsa_events_t wsa_events; for (family_entries_t::iterator family_entry_it = family_entries.begin (); family_entry_it != family_entries.end (); ++family_entry_it) { family_entry_t &family_entry = family_entry_it->second; for (fd_entries_t::iterator fd_entry_it = family_entry.fd_entries.begin (); fd_entry_it != family_entry.fd_entries.end (); ++fd_entry_it) { fd_t fd = fd_entry_it->fd; // http://stackoverflow.com/q/35043420/188530 if (FD_ISSET (fd, &family_entry.fds_set.read) && FD_ISSET (fd, &family_entry.fds_set.write)) rc = WSAEventSelect (fd, wsa_events.events[3], FD_READ | FD_ACCEPT | FD_CLOSE | FD_WRITE | FD_CONNECT | FD_OOB); else if (FD_ISSET (fd, &family_entry.fds_set.read)) rc = WSAEventSelect (fd, wsa_events.events[0], FD_READ | FD_ACCEPT | FD_CLOSE | FD_OOB); else if (FD_ISSET (fd, &family_entry.fds_set.write)) rc = WSAEventSelect (fd, wsa_events.events[1], FD_WRITE | FD_CONNECT | FD_OOB); else if (FD_ISSET (fd, &family_entry.fds_set.error)) rc = WSAEventSelect (fd, wsa_events.events[2], FD_OOB); else rc = 0; wsa_assert (rc != SOCKET_ERROR); } } rc = WSAWaitForMultipleEvents (4, wsa_events.events, FALSE, timeout ? timeout : INFINITE, FALSE); wsa_assert (rc != (int) WSA_WAIT_FAILED); zmq_assert (rc != WSA_WAIT_IO_COMPLETION); if (rc == WSA_WAIT_TIMEOUT) continue; } for (current_family_entry_it = family_entries.begin (); current_family_entry_it != family_entries.end (); ++current_family_entry_it) { family_entry_t &family_entry = current_family_entry_it->second; if (use_wsa_events) { // There is no reason to wait again after WSAWaitForMultipleEvents. // Simply collect what is ready. struct timeval tv_nodelay = {0, 0}; select_family_entry (family_entry, 0, true, tv_nodelay); } else { select_family_entry (family_entry, 0, timeout > 0, tv); } } #else select_family_entry (family_entry, maxfd + 1, timeout > 0, tv); #endif } } void zmq::select_t::select_family_entry (family_entry_t &family_entry_, const int max_fd_, const bool use_timeout_, struct timeval &tv_) { // select will fail when run with empty sets. fd_entries_t &fd_entries = family_entry_.fd_entries; if (fd_entries.empty ()) return; fds_set_t local_fds_set = family_entry_.fds_set; int rc = select (max_fd_, &local_fds_set.read, &local_fds_set.write, &local_fds_set.error, use_timeout_ ? &tv_ : NULL); #if defined ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else if (rc == -1) { errno_assert (errno == EINTR); return; } #endif trigger_events (fd_entries, local_fds_set, rc); cleanup_retired (family_entry_); } zmq::select_t::fds_set_t::fds_set_t () { FD_ZERO (&read); FD_ZERO (&write); FD_ZERO (&error); } zmq::select_t::fds_set_t::fds_set_t (const fds_set_t &other_) { #if defined ZMQ_HAVE_WINDOWS // On Windows we don't need to copy the whole fd_set. // SOCKETS are continuous from the beginning of fd_array in fd_set. // We just need to copy fd_count elements of fd_array. // We gain huge memcpy() improvement if number of used SOCKETs is much lower than FD_SETSIZE. memcpy (&read, &other_.read, (char *) (other_.read.fd_array + other_.read.fd_count) - (char *) &other_.read); memcpy (&write, &other_.write, (char *) (other_.write.fd_array + other_.write.fd_count) - (char *) &other_.write); memcpy (&error, &other_.error, (char *) (other_.error.fd_array + other_.error.fd_count) - (char *) &other_.error); #else memcpy (&read, &other_.read, sizeof other_.read); memcpy (&write, &other_.write, sizeof other_.write); memcpy (&error, &other_.error, sizeof other_.error); #endif } zmq::select_t::fds_set_t &zmq::select_t::fds_set_t:: operator= (const fds_set_t &other_) { #if defined ZMQ_HAVE_WINDOWS // On Windows we don't need to copy the whole fd_set. // SOCKETS are continuous from the beginning of fd_array in fd_set. // We just need to copy fd_count elements of fd_array. // We gain huge memcpy() improvement if number of used SOCKETs is much lower than FD_SETSIZE. memcpy (&read, &other_.read, (char *) (other_.read.fd_array + other_.read.fd_count) - (char *) &other_.read); memcpy (&write, &other_.write, (char *) (other_.write.fd_array + other_.write.fd_count) - (char *) &other_.write); memcpy (&error, &other_.error, (char *) (other_.error.fd_array + other_.error.fd_count) - (char *) &other_.error); #else memcpy (&read, &other_.read, sizeof other_.read); memcpy (&write, &other_.write, sizeof other_.write); memcpy (&error, &other_.error, sizeof other_.error); #endif return *this; } void zmq::select_t::fds_set_t::remove_fd (const fd_t &fd_) { FD_CLR (fd_, &read); FD_CLR (fd_, &write); FD_CLR (fd_, &error); } bool zmq::select_t::cleanup_retired (family_entry_t &family_entry_) { if (family_entry_.has_retired) { family_entry_.has_retired = false; family_entry_.fd_entries.erase ( std::remove_if (family_entry_.fd_entries.begin (), family_entry_.fd_entries.end (), is_retired_fd), family_entry_.fd_entries.end ()); } return family_entry_.fd_entries.empty (); } void zmq::select_t::cleanup_retired () { #ifdef _WIN32 for (family_entries_t::iterator it = family_entries.begin (); it != family_entries.end ();) { if (cleanup_retired (it->second)) it = family_entries.erase (it); else ++it; } #else cleanup_retired (family_entry); #endif } bool zmq::select_t::is_retired_fd (const fd_entry_t &entry) { return (entry.fd == retired_fd); } zmq::select_t::family_entry_t::family_entry_t () : has_retired (false) { } #if defined ZMQ_HAVE_WINDOWS u_short zmq::select_t::get_fd_family (fd_t fd_) { // cache the results of determine_fd_family, as this is frequently called // for the same sockets, and determine_fd_family is expensive size_t i; for (i = 0; i < fd_family_cache_size; ++i) { const std::pair &entry = fd_family_cache[i]; if (entry.first == fd_) { return entry.second; } if (entry.first == retired_fd) break; } std::pair res = std::make_pair (fd_, determine_fd_family (fd_)); if (i < fd_family_cache_size) { fd_family_cache[i] = res; } else { // just overwrite a random entry // could be optimized by some LRU strategy fd_family_cache[rand () % fd_family_cache_size] = res; } return res.second; } u_short zmq::select_t::determine_fd_family (fd_t fd_) { // Use sockaddr_storage instead of sockaddr to accommodate different structure sizes sockaddr_storage addr = {0}; int addr_size = sizeof addr; int type; int type_length = sizeof (int); int rc = getsockopt (fd_, SOL_SOCKET, SO_TYPE, (char *) &type, &type_length); if (rc == 0) { if (type == SOCK_DGRAM) return AF_INET; else { rc = getsockname (fd_, (sockaddr *) &addr, &addr_size); // AF_INET and AF_INET6 can be mixed in select // TODO: If proven otherwise, should simply return addr.sa_family if (rc != SOCKET_ERROR) return addr.ss_family == AF_INET6 ? AF_INET : addr.ss_family; } } return AF_UNSPEC; } zmq::select_t::wsa_events_t::wsa_events_t () { events[0] = WSACreateEvent (); wsa_assert (events[0] != WSA_INVALID_EVENT); events[1] = WSACreateEvent (); wsa_assert (events[1] != WSA_INVALID_EVENT); events[2] = WSACreateEvent (); wsa_assert (events[2] != WSA_INVALID_EVENT); events[3] = WSACreateEvent (); wsa_assert (events[3] != WSA_INVALID_EVENT); } zmq::select_t::wsa_events_t::~wsa_events_t () { wsa_assert (WSACloseEvent (events[0])); wsa_assert (WSACloseEvent (events[1])); wsa_assert (WSACloseEvent (events[2])); wsa_assert (WSACloseEvent (events[3])); } #endif #endif zeromq-4.2.5/src/req.hpp0000664000372000037200000000716313255253220016036 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_REQ_HPP_INCLUDED__ #define __ZMQ_REQ_HPP_INCLUDED__ #include "dealer.hpp" #include "stdint.hpp" namespace zmq { class ctx_t; class msg_t; class io_thread_t; class socket_base_t; class req_t : public dealer_t { public: req_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~req_t (); // Overrides of functions from socket_base_t. int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); void xpipe_terminated (zmq::pipe_t *pipe_); protected: // Receive only from the pipe the request was sent to, discarding // frames from other pipes. int recv_reply_pipe (zmq::msg_t *msg_); private: // If true, request was already sent and reply wasn't received yet or // was received partially. bool receiving_reply; // If true, we are starting to send/recv a message. The first part // of the message must be empty message part (backtrace stack bottom). bool message_begins; // The pipe the request was sent to and where the reply is expected. zmq::pipe_t *reply_pipe; // Whether request id frames shall be sent and expected. bool request_id_frames_enabled; // The current request id. It is incremented every time before a new // request is sent. uint32_t request_id; // If false, send() will reset its internal state and terminate the // reply_pipe's connection instead of failing if a previous request is // still pending. bool strict; req_t (const req_t &); const req_t &operator= (const req_t &); }; class req_session_t : public session_base_t { public: req_session_t (zmq::io_thread_t *io_thread_, bool connect_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_); ~req_session_t (); // Overrides of the functions from session_base_t. int push_msg (msg_t *msg_); void reset (); private: enum { bottom, request_id, body } state; req_session_t (const req_session_t &); const req_session_t &operator= (const req_session_t &); }; } #endif zeromq-4.2.5/src/xsub.hpp0000664000372000037200000000606113255253220016224 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_XSUB_HPP_INCLUDED__ #define __ZMQ_XSUB_HPP_INCLUDED__ #include "socket_base.hpp" #include "session_base.hpp" #include "dist.hpp" #include "fq.hpp" #include "trie.hpp" namespace zmq { class ctx_t; class pipe_t; class io_thread_t; class xsub_t : public socket_base_t { public: xsub_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~xsub_t (); protected: // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); bool xhas_out (); int xrecv (zmq::msg_t *msg_); bool xhas_in (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xhiccuped (pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // Check whether the message matches at least one subscription. bool match (zmq::msg_t *msg_); // Function to be applied to the trie to send all the subsciptions // upstream. static void send_subscription (unsigned char *data_, size_t size_, void *arg_); // Fair queueing object for inbound pipes. fq_t fq; // Object for distributing the subscriptions upstream. dist_t dist; // The repository of subscriptions. trie_t subscriptions; // If true, 'message' contains a matching message to return on the // next recv call. bool has_message; msg_t message; // If true, part of a multipart message was already received, but // there are following parts still waiting. bool more; xsub_t (const xsub_t &); const xsub_t &operator= (const xsub_t &); }; } #endif zeromq-4.2.5/src/udp_engine.cpp0000664000372000037200000002673013255253220017360 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #if !defined ZMQ_HAVE_WINDOWS #include #include #include #include #include #ifdef ZMQ_HAVE_VXWORKS #include #endif #endif #include "udp_engine.hpp" #include "session_base.hpp" #include "v2_protocol.hpp" #include "err.hpp" #include "ip.hpp" zmq::udp_engine_t::udp_engine_t (const options_t &options_) : plugged (false), fd (-1), session (NULL), handle ((handle_t) NULL), address (NULL), options (options_), send_enabled (false), recv_enabled (false) { } zmq::udp_engine_t::~udp_engine_t () { zmq_assert (!plugged); if (fd != retired_fd) { #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (fd); wsa_assert (rc != SOCKET_ERROR); #else int rc = close (fd); errno_assert (rc == 0); #endif fd = retired_fd; } } int zmq::udp_engine_t::init (address_t *address_, bool send_, bool recv_) { zmq_assert (address_); zmq_assert (send_ || recv_); send_enabled = send_; recv_enabled = recv_; address = address_; fd = open_socket (address->resolved.udp_addr->family (), SOCK_DGRAM, IPPROTO_UDP); if (fd == retired_fd) return -1; unblock_socket (fd); return 0; } void zmq::udp_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_) { zmq_assert (!plugged); plugged = true; zmq_assert (!session); zmq_assert (session_); session = session_; // Connect to I/O threads poller object. io_object_t::plug (io_thread_); handle = add_fd (fd); // Bind the socket to a device if applicable if (!options.bound_device.empty ()) bind_to_device (fd, options.bound_device); if (send_enabled) { if (!options.raw_socket) { out_address = address->resolved.udp_addr->dest_addr (); out_addrlen = address->resolved.udp_addr->dest_addrlen (); } else { out_address = (sockaddr *) &raw_address; out_addrlen = sizeof (sockaddr_in); } set_pollout (handle); } if (recv_enabled) { int on = 1; int rc = setsockopt (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &on, sizeof (on)); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif #ifdef ZMQ_HAVE_VXWORKS rc = bind (fd, (sockaddr *) address->resolved.udp_addr->bind_addr (), address->resolved.udp_addr->bind_addrlen ()); #else rc = bind (fd, address->resolved.udp_addr->bind_addr (), address->resolved.udp_addr->bind_addrlen ()); #endif #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif if (address->resolved.udp_addr->is_mcast ()) { struct ip_mreq mreq; mreq.imr_multiaddr = address->resolved.udp_addr->multicast_ip (); mreq.imr_interface = address->resolved.udp_addr->interface_ip (); rc = setsockopt (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof (mreq)); #ifdef ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif } set_pollin (handle); // Call restart output to drop all join/leave commands restart_output (); } } void zmq::udp_engine_t::terminate () { zmq_assert (plugged); plugged = false; rm_fd (handle); // Disconnect from I/O threads poller object. io_object_t::unplug (); delete this; } void zmq::udp_engine_t::sockaddr_to_msg (zmq::msg_t *msg, sockaddr_in *addr) { char *name = inet_ntoa (addr->sin_addr); char port[6]; sprintf (port, "%d", (int) ntohs (addr->sin_port)); int size = (int) strlen (name) + (int) strlen (port) + 1 + 1; // Colon + NULL int rc = msg->init_size (size); errno_assert (rc == 0); msg->set_flags (msg_t::more); char *address = (char *) msg->data (); strcpy (address, name); strcat (address, ":"); strcat (address, port); } int zmq::udp_engine_t::resolve_raw_address (char *name_, size_t length_) { memset (&raw_address, 0, sizeof raw_address); const char *delimiter = NULL; // Find delimiter, cannot use memrchr as it is not supported on windows if (length_ != 0) { int chars_left = (int) length_; char *current_char = name_ + length_; do { if (*(--current_char) == ':') { delimiter = current_char; break; } } while (--chars_left != 0); } if (!delimiter) { errno = EINVAL; return -1; } std::string addr_str (name_, delimiter - name_); std::string port_str (delimiter + 1, name_ + length_ - delimiter - 1); // Parse the port number (0 is not a valid port). uint16_t port = (uint16_t) atoi (port_str.c_str ()); if (port == 0) { errno = EINVAL; return -1; } raw_address.sin_family = AF_INET; raw_address.sin_port = htons (port); raw_address.sin_addr.s_addr = inet_addr (addr_str.c_str ()); if (raw_address.sin_addr.s_addr == INADDR_NONE) { errno = EINVAL; return -1; } return 0; } void zmq::udp_engine_t::out_event () { msg_t group_msg; int rc = session->pull_msg (&group_msg); errno_assert (rc == 0 || (rc == -1 && errno == EAGAIN)); if (rc == 0) { msg_t body_msg; rc = session->pull_msg (&body_msg); size_t group_size = group_msg.size (); size_t body_size = body_msg.size (); size_t size; if (options.raw_socket) { rc = resolve_raw_address ((char *) group_msg.data (), group_size); // We discard the message if address is not valid if (rc != 0) { rc = group_msg.close (); errno_assert (rc == 0); body_msg.close (); errno_assert (rc == 0); return; } size = body_size; memcpy (out_buffer, body_msg.data (), body_size); } else { size = group_size + body_size + 1; // TODO: check if larger than maximum size out_buffer[0] = (unsigned char) group_size; memcpy (out_buffer + 1, group_msg.data (), group_size); memcpy (out_buffer + 1 + group_size, body_msg.data (), body_size); } rc = group_msg.close (); errno_assert (rc == 0); body_msg.close (); errno_assert (rc == 0); #ifdef ZMQ_HAVE_WINDOWS rc = sendto (fd, (const char *) out_buffer, (int) size, 0, out_address, (int) out_addrlen); wsa_assert (rc != SOCKET_ERROR); #elif defined ZMQ_HAVE_VXWORKS rc = sendto (fd, (caddr_t) out_buffer, size, 0, (sockaddr *) out_address, (int) out_addrlen); errno_assert (rc != -1); #else rc = sendto (fd, out_buffer, size, 0, out_address, out_addrlen); errno_assert (rc != -1); #endif } else reset_pollout (handle); } const char *zmq::udp_engine_t::get_endpoint () const { return ""; } void zmq::udp_engine_t::restart_output () { // If we don't support send we just drop all messages if (!send_enabled) { msg_t msg; while (session->pull_msg (&msg) == 0) msg.close (); } else { set_pollout (handle); out_event (); } } void zmq::udp_engine_t::in_event () { struct sockaddr_in in_address; socklen_t in_addrlen = sizeof (sockaddr_in); #ifdef ZMQ_HAVE_WINDOWS int nbytes = recvfrom (fd, (char *) in_buffer, MAX_UDP_MSG, 0, (sockaddr *) &in_address, &in_addrlen); const int last_error = WSAGetLastError (); if (nbytes == SOCKET_ERROR) { wsa_assert (last_error == WSAENETDOWN || last_error == WSAENETRESET || last_error == WSAEWOULDBLOCK); return; } #elif defined ZMQ_HAVE_VXWORKS int nbytes = recvfrom (fd, (char *) in_buffer, MAX_UDP_MSG, 0, (sockaddr *) &in_address, (int *) &in_addrlen); if (nbytes == -1) { errno_assert (errno != EBADF && errno != EFAULT && errno != ENOMEM && errno != ENOTSOCK); return; } #else int nbytes = recvfrom (fd, in_buffer, MAX_UDP_MSG, 0, (sockaddr *) &in_address, &in_addrlen); if (nbytes == -1) { errno_assert (errno != EBADF && errno != EFAULT && errno != ENOMEM && errno != ENOTSOCK); return; } #endif int rc; int body_size; int body_offset; msg_t msg; if (options.raw_socket) { sockaddr_to_msg (&msg, &in_address); body_size = nbytes; body_offset = 0; } else { char *group_buffer = (char *) in_buffer + 1; int group_size = in_buffer[0]; rc = msg.init_size (group_size); errno_assert (rc == 0); msg.set_flags (msg_t::more); memcpy (msg.data (), group_buffer, group_size); // This doesn't fit, just ingore if (nbytes - 1 < group_size) return; body_size = nbytes - 1 - group_size; body_offset = 1 + group_size; } // Push group description to session rc = session->push_msg (&msg); errno_assert (rc == 0 || (rc == -1 && errno == EAGAIN)); // Group description message doesn't fit in the pipe, drop if (rc != 0) { rc = msg.close (); errno_assert (rc == 0); reset_pollin (handle); return; } rc = msg.close (); errno_assert (rc == 0); rc = msg.init_size (body_size); errno_assert (rc == 0); memcpy (msg.data (), in_buffer + body_offset, body_size); // Push message body to session rc = session->push_msg (&msg); // Message body doesn't fit in the pipe, drop and reset session state if (rc != 0) { rc = msg.close (); errno_assert (rc == 0); session->reset (); reset_pollin (handle); return; } rc = msg.close (); errno_assert (rc == 0); session->flush (); } void zmq::udp_engine_t::restart_input () { if (!recv_enabled) return; set_pollin (handle); in_event (); } zeromq-4.2.5/src/encoder.hpp0000664000372000037200000001365713255253220016673 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ENCODER_HPP_INCLUDED__ #define __ZMQ_ENCODER_HPP_INCLUDED__ #if defined(_MSC_VER) #ifndef NOMINMAX #define NOMINMAX #endif #endif #include #include #include #include #include "err.hpp" #include "msg.hpp" #include "i_encoder.hpp" namespace zmq { // Helper base class for encoders. It implements the state machine that // fills the outgoing buffer. Derived classes should implement individual // state machine actions. template class encoder_base_t : public i_encoder { public: inline encoder_base_t (size_t bufsize_) : write_pos (0), to_write (0), next (NULL), new_msg_flag (false), bufsize (bufsize_), buf ((unsigned char *) malloc (bufsize_)), in_progress (NULL) { alloc_assert (buf); } // The destructor doesn't have to be virtual. It is made virtual // just to keep ICC and code checking tools from complaining. inline virtual ~encoder_base_t () { free (buf); } // The function returns a batch of binary data. The data // are filled to a supplied buffer. If no buffer is supplied (data_ // points to NULL) decoder object will provide buffer of its own. inline size_t encode (unsigned char **data_, size_t size_) { unsigned char *buffer = !*data_ ? buf : *data_; size_t buffersize = !*data_ ? bufsize : size_; if (in_progress == NULL) return 0; size_t pos = 0; while (pos < buffersize) { // If there are no more data to return, run the state machine. // If there are still no data, return what we already have // in the buffer. if (!to_write) { if (new_msg_flag) { int rc = in_progress->close (); errno_assert (rc == 0); rc = in_progress->init (); errno_assert (rc == 0); in_progress = NULL; break; } (static_cast (this)->*next) (); } // If there are no data in the buffer yet and we are able to // fill whole buffer in a single go, let's use zero-copy. // There's no disadvantage to it as we cannot stuck multiple // messages into the buffer anyway. Note that subsequent // write(s) are non-blocking, thus each single write writes // at most SO_SNDBUF bytes at once not depending on how large // is the chunk returned from here. // As a consequence, large messages being sent won't block // other engines running in the same I/O thread for excessive // amounts of time. if (!pos && !*data_ && to_write >= buffersize) { *data_ = write_pos; pos = to_write; write_pos = NULL; to_write = 0; return pos; } // Copy data to the buffer. If the buffer is full, return. size_t to_copy = std::min (to_write, buffersize - pos); memcpy (buffer + pos, write_pos, to_copy); pos += to_copy; write_pos += to_copy; to_write -= to_copy; } *data_ = buffer; return pos; } void load_msg (msg_t *msg_) { zmq_assert (in_progress == NULL); in_progress = msg_; (static_cast (this)->*next) (); } protected: // Prototype of state machine action. typedef void (T::*step_t) (); // This function should be called from derived class to write the data // to the buffer and schedule next state machine action. inline void next_step (void *write_pos_, size_t to_write_, step_t next_, bool new_msg_flag_) { write_pos = (unsigned char *) write_pos_; to_write = to_write_; next = next_; new_msg_flag = new_msg_flag_; } private: // Where to get the data to write from. unsigned char *write_pos; // How much data to write before next step should be executed. size_t to_write; // Next step. If set to NULL, it means that associated data stream // is dead. step_t next; bool new_msg_flag; // The buffer for encoded data. const size_t bufsize; unsigned char *const buf; encoder_base_t (const encoder_base_t &); void operator= (const encoder_base_t &); protected: msg_t *in_progress; }; } #endif zeromq-4.2.5/src/radio.hpp0000664000372000037200000000671413255253220016346 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_RADIO_HPP_INCLUDED__ #define __ZMQ_RADIO_HPP_INCLUDED__ #include #include #include #include "socket_base.hpp" #include "session_base.hpp" #include "mtrie.hpp" #include "array.hpp" #include "dist.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class radio_t : public socket_base_t { public: radio_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~radio_t (); // Implementations of virtual functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false); int xsend (zmq::msg_t *msg_); bool xhas_out (); int xrecv (zmq::msg_t *msg_); bool xhas_in (); void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); void xpipe_terminated (zmq::pipe_t *pipe_); private: // List of all subscriptions mapped to corresponding pipes. typedef std::multimap subscriptions_t; subscriptions_t subscriptions; // List of udp pipes typedef std::vector udp_pipes_t; udp_pipes_t udp_pipes; // Distributor of messages holding the list of outbound pipes. dist_t dist; // Drop messages if HWM reached, otherwise return with EAGAIN bool lossy; radio_t (const radio_t &); const radio_t &operator= (const radio_t &); }; class radio_session_t : public session_base_t { public: radio_session_t (zmq::io_thread_t *io_thread_, bool connect_, zmq::socket_base_t *socket_, const options_t &options_, address_t *addr_); ~radio_session_t (); // Overrides of the functions from session_base_t. int push_msg (msg_t *msg_); int pull_msg (msg_t *msg_); void reset (); private: enum { group, body } state; msg_t pending_msg; radio_session_t (const radio_session_t &); const radio_session_t &operator= (const radio_session_t &); }; } #endif zeromq-4.2.5/src/dgram.cpp0000664000372000037200000001101613255253220016324 0ustar00travistravis00000000000000/* Copyright (c) 2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "dgram.hpp" #include "pipe.hpp" #include "wire.hpp" #include "random.hpp" #include "likely.hpp" #include "err.hpp" zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), pipe (NULL), last_in (NULL), more_out (false) { options.type = ZMQ_DGRAM; options.raw_socket = true; } zmq::dgram_t::~dgram_t () { zmq_assert (!pipe); } void zmq::dgram_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); // ZMQ_DGRAM socket can only be connected to a single peer. // The socket rejects any further connection requests. if (pipe == NULL) pipe = pipe_; else pipe_->terminate (false); } void zmq::dgram_t::xpipe_terminated (pipe_t *pipe_) { if (pipe_ == pipe) { if (last_in == pipe) { saved_credential.set_deep_copy (last_in->get_credential ()); last_in = NULL; } pipe = NULL; } } void zmq::dgram_t::xread_activated (pipe_t *) { // There's just one pipe. No lists of active and inactive pipes. // There's nothing to do here. } void zmq::dgram_t::xwrite_activated (pipe_t *) { // There's just one pipe. No lists of active and inactive pipes. // There's nothing to do here. } int zmq::dgram_t::xsend (msg_t *msg_) { // If there's no out pipe, just drop it. if (!pipe) { int rc = msg_->close (); errno_assert (rc == 0); return -1; } // If this is the first part of the message it's the ID of the // peer to send the message to. if (!more_out) { if (!(msg_->flags () & msg_t::more)) { errno = EINVAL; return -1; } // Expect one more message frame. more_out = true; } else { // dgram messages are two part only, reject part if more is set if (msg_->flags () & msg_t::more) { errno = EINVAL; return -1; } // This is the last part of the message. more_out = false; } // Push the message into the pipe. if (!pipe->write (msg_)) { errno = EAGAIN; return -1; } if (!(msg_->flags () & msg_t::more)) pipe->flush (); // Detach the message from the data buffer. int rc = msg_->init (); errno_assert (rc == 0); return 0; } int zmq::dgram_t::xrecv (msg_t *msg_) { // Deallocate old content of the message. int rc = msg_->close (); errno_assert (rc == 0); if (!pipe || !pipe->read (msg_)) { // Initialise the output parameter to be a 0-byte message. rc = msg_->init (); errno_assert (rc == 0); errno = EAGAIN; return -1; } last_in = pipe; return 0; } bool zmq::dgram_t::xhas_in () { if (!pipe) return false; return pipe->check_read (); } bool zmq::dgram_t::xhas_out () { if (!pipe) return false; return pipe->check_write (); } const zmq::blob_t &zmq::dgram_t::get_credential () const { return last_in ? last_in->get_credential () : saved_credential; } zeromq-4.2.5/src/curve_mechanism_base.cpp0000664000372000037200000001362413255253220021403 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "curve_mechanism_base.hpp" #include "msg.hpp" #include "wire.hpp" #include "session_base.hpp" #ifdef ZMQ_HAVE_CURVE zmq::curve_mechanism_base_t::curve_mechanism_base_t ( session_base_t *session_, const options_t &options_, const char *encode_nonce_prefix_, const char *decode_nonce_prefix_) : mechanism_base_t (session_, options_), encode_nonce_prefix (encode_nonce_prefix_), decode_nonce_prefix (decode_nonce_prefix_), cn_nonce (1), cn_peer_nonce (1) { } int zmq::curve_mechanism_base_t::encode (msg_t *msg_) { const size_t mlen = crypto_box_ZEROBYTES + 1 + msg_->size (); uint8_t message_nonce[crypto_box_NONCEBYTES]; memcpy (message_nonce, encode_nonce_prefix, 16); put_uint64 (message_nonce + 16, cn_nonce); uint8_t flags = 0; if (msg_->flags () & msg_t::more) flags |= 0x01; if (msg_->flags () & msg_t::command) flags |= 0x02; uint8_t *message_plaintext = static_cast (malloc (mlen)); alloc_assert (message_plaintext); memset (message_plaintext, 0, crypto_box_ZEROBYTES); message_plaintext[crypto_box_ZEROBYTES] = flags; memcpy (message_plaintext + crypto_box_ZEROBYTES + 1, msg_->data (), msg_->size ()); uint8_t *message_box = static_cast (malloc (mlen)); alloc_assert (message_box); int rc = crypto_box_afternm (message_box, message_plaintext, mlen, message_nonce, cn_precom); zmq_assert (rc == 0); rc = msg_->close (); zmq_assert (rc == 0); rc = msg_->init_size (16 + mlen - crypto_box_BOXZEROBYTES); zmq_assert (rc == 0); uint8_t *message = static_cast (msg_->data ()); memcpy (message, "\x07MESSAGE", 8); memcpy (message + 8, message_nonce + 16, 8); memcpy (message + 16, message_box + crypto_box_BOXZEROBYTES, mlen - crypto_box_BOXZEROBYTES); free (message_plaintext); free (message_box); cn_nonce++; return 0; } int zmq::curve_mechanism_base_t::decode (msg_t *msg_) { int rc = check_basic_command_structure (msg_); if (rc == -1) return -1; const size_t size = msg_->size (); const uint8_t *message = static_cast (msg_->data ()); if (size < 8 || memcmp (message, "\x07MESSAGE", 8)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND); errno = EPROTO; return -1; } if (size < 33) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE); errno = EPROTO; return -1; } uint8_t message_nonce[crypto_box_NONCEBYTES]; memcpy (message_nonce, decode_nonce_prefix, 16); memcpy (message_nonce + 16, message + 8, 8); uint64_t nonce = get_uint64 (message + 8); if (nonce <= cn_peer_nonce) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE); errno = EPROTO; return -1; } cn_peer_nonce = nonce; const size_t clen = crypto_box_BOXZEROBYTES + msg_->size () - 16; uint8_t *message_plaintext = static_cast (malloc (clen)); alloc_assert (message_plaintext); uint8_t *message_box = static_cast (malloc (clen)); alloc_assert (message_box); memset (message_box, 0, crypto_box_BOXZEROBYTES); memcpy (message_box + crypto_box_BOXZEROBYTES, message + 16, msg_->size () - 16); rc = crypto_box_open_afternm (message_plaintext, message_box, clen, message_nonce, cn_precom); if (rc == 0) { rc = msg_->close (); zmq_assert (rc == 0); rc = msg_->init_size (clen - 1 - crypto_box_ZEROBYTES); zmq_assert (rc == 0); const uint8_t flags = message_plaintext[crypto_box_ZEROBYTES]; if (flags & 0x01) msg_->set_flags (msg_t::more); if (flags & 0x02) msg_->set_flags (msg_t::command); memcpy (msg_->data (), message_plaintext + crypto_box_ZEROBYTES + 1, msg_->size ()); } else { // CURVE I : connection key used for MESSAGE is wrong session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC); errno = EPROTO; } free (message_plaintext); free (message_box); return rc; } #endif zeromq-4.2.5/src/tipc_connecter.hpp0000664000372000037200000001021613255253220020237 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __TIPC_CONNECTER_HPP_INCLUDED__ #define __TIPC_CONNECTER_HPP_INCLUDED__ #include "platform.hpp" #if defined ZMQ_HAVE_TIPC #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class session_base_t; struct address_t; class tipc_connecter_t : public own_t, public io_object_t { public: // If 'delayed_start' is true connecter first waits for a while, // then starts connection process. tipc_connecter_t (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_); ~tipc_connecter_t (); private: // ID of the timer used to delay the reconnection. enum { reconnect_timer_id = 1 }; // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); void out_event (); void timer_event (int id_); // Internal function to start the actual connection establishment. void start_connecting (); // Internal function to add a reconnect timer void add_reconnect_timer (); // Close the connecting socket. void close (); // Get the file descriptor of newly created connection. Returns // retired_fd if the connection was unsuccessful. fd_t connect (); // Address to connect to. Owned by session_base_t. const address_t *addr; // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // If true file descriptor is registered with the poller and 'handle' // contains valid value. bool handle_valid; // If true, connecter is waiting a while before trying to connect. const bool delayed_start; // True iff a timer has been started. bool timer_started; // Reference to the session we belong to. zmq::session_base_t *session; // Current reconnect ivl, updated for backoff strategy int current_reconnect_ivl; // String representation of endpoint to connect to std::string endpoint; // Socket zmq::socket_base_t *socket; // Internal function to return a reconnect backoff delay. // Will modify the current_reconnect_ivl used for next call // Returns the currently used interval int get_new_reconnect_ivl (); // Open IPC connecting socket. Returns -1 in case of error, // 0 if connect was successful immediately. Returns -1 with // EAGAIN errno if async connect was launched. int open (); tipc_connecter_t (const tipc_connecter_t &); const tipc_connecter_t &operator= (const tipc_connecter_t &); }; } #endif #endif zeromq-4.2.5/src/push.cpp0000664000372000037200000000437513255253220016223 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "push.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::push_t::push_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_) { options.type = ZMQ_PUSH; } zmq::push_t::~push_t () { } void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); // Don't delay pipe termination as there is no one // to receive the delimiter. pipe_->set_nodelay (); zmq_assert (pipe_); lb.attach (pipe_); } void zmq::push_t::xwrite_activated (pipe_t *pipe_) { lb.activated (pipe_); } void zmq::push_t::xpipe_terminated (pipe_t *pipe_) { lb.pipe_terminated (pipe_); } int zmq::push_t::xsend (msg_t *msg_) { return lb.send (msg_); } bool zmq::push_t::xhas_out () { return lb.has_out (); } zeromq-4.2.5/src/vmci_address.hpp0000664000372000037200000000433113255253220017704 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__ #define __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__ #include #include "platform.hpp" #include "ctx.hpp" #if defined(ZMQ_HAVE_VMCI) #include namespace zmq { class vmci_address_t { public: vmci_address_t (ctx_t *parent_); vmci_address_t (const sockaddr *sa, socklen_t sa_len, ctx_t *parent_); ~vmci_address_t (); // This function sets up the address for VMCI transport. int resolve (const char *path_); // The opposite to resolve() int to_string (std::string &addr_); const sockaddr *addr () const; socklen_t addrlen () const; private: struct sockaddr_vm address; ctx_t *parent; vmci_address_t (); vmci_address_t (const vmci_address_t &); const vmci_address_t &operator= (const vmci_address_t &); }; } #endif #endif zeromq-4.2.5/src/kqueue.hpp0000664000372000037200000000613213255253220016541 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_KQUEUE_HPP_INCLUDED__ #define __ZMQ_KQUEUE_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_KQUEUE #include #include #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" namespace zmq { struct i_poll_events; // Implements socket polling mechanism using the BSD-specific // kqueue interface. class kqueue_t : public worker_poller_base_t { public: typedef void *handle_t; kqueue_t (const thread_ctx_t &ctx_); ~kqueue_t (); // "poller" concept. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void stop (); static int max_fds (); private: // Main event loop. void loop (); // File descriptor referring to the kernel event queue. fd_t kqueue_fd; // Adds the event to the kqueue. void kevent_add (fd_t fd_, short filter_, void *udata_); // Deletes the event from the kqueue. void kevent_delete (fd_t fd_, short filter_); struct poll_entry_t { fd_t fd; bool flag_pollin; bool flag_pollout; zmq::i_poll_events *reactor; }; // List of retired event sources. typedef std::vector retired_t; retired_t retired; kqueue_t (const kqueue_t &); const kqueue_t &operator= (const kqueue_t &); #ifdef HAVE_FORK // the process that created this context. Used to detect forking. pid_t pid; #endif }; typedef kqueue_t poller_t; } #endif #endif zeromq-4.2.5/src/trie.hpp0000664000372000037200000000545513255253220016214 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TRIE_HPP_INCLUDED__ #define __ZMQ_TRIE_HPP_INCLUDED__ #include #include "stdint.hpp" namespace zmq { class trie_t { public: trie_t (); ~trie_t (); // Add key to the trie. Returns true if this is a new item in the trie // rather than a duplicate. bool add (unsigned char *prefix_, size_t size_); // Remove key from the trie. Returns true if the item is actually // removed from the trie. bool rm (unsigned char *prefix_, size_t size_); // Check whether particular key is in the trie. bool check (unsigned char *data_, size_t size_); // Apply the function supplied to each subscription in the trie. void apply (void (*func_) (unsigned char *data_, size_t size_, void *arg_), void *arg_); private: void apply_helper (unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void (*func_) (unsigned char *data_, size_t size_, void *arg_), void *arg_); bool is_redundant () const; uint32_t refcnt; unsigned char min; unsigned short count; unsigned short live_nodes; union { class trie_t *node; class trie_t **table; } next; trie_t (const trie_t &); const trie_t &operator= (const trie_t &); }; } #endif zeromq-4.2.5/src/rep.hpp0000664000372000037200000000431113255253220016025 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_REP_HPP_INCLUDED__ #define __ZMQ_REP_HPP_INCLUDED__ #include "router.hpp" namespace zmq { class ctx_t; class msg_t; class io_thread_t; class socket_base_t; class rep_t : public router_t { public: rep_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~rep_t (); // Overrides of functions from socket_base_t. int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); private: // If true, we are in process of sending the reply. If false we are // in process of receiving a request. bool sending_reply; // If true, we are starting to receive a request. The beginning // of the request is the backtrace stack. bool request_begins; rep_t (const rep_t &); const rep_t &operator= (const rep_t &); }; } #endif zeromq-4.2.5/src/mechanism_base.hpp0000664000372000037200000000365313255253220020205 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MECHANISM_BASE_HPP_INCLUDED__ #define __ZMQ_MECHANISM_BASE_HPP_INCLUDED__ #include "mechanism.hpp" namespace zmq { class mechanism_base_t : public mechanism_t { protected: mechanism_base_t (session_base_t *const session_, const options_t &options_); session_base_t *const session; int check_basic_command_structure (msg_t *msg_); void handle_error_reason (const char *error_reason, size_t error_reason_len); bool zap_required () const; }; } #endif zeromq-4.2.5/src/poller.hpp0000664000372000037200000000432613255253220016542 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_POLLER_HPP_INCLUDED__ #define __ZMQ_POLLER_HPP_INCLUDED__ #if defined ZMQ_USE_KQUEUE + defined ZMQ_USE_EPOLL + defined ZMQ_USE_DEVPOLL \ + defined ZMQ_USE_POLLSET + defined ZMQ_USE_POLL + defined ZMQ_USE_SELECT \ > 1 #error More than one of the ZMQ_USE_* macros defined #endif #if defined ZMQ_USE_KQUEUE #include "kqueue.hpp" #elif defined ZMQ_USE_EPOLL #include "epoll.hpp" #elif defined ZMQ_USE_DEVPOLL #include "devpoll.hpp" #elif defined ZMQ_USE_POLLSET #include "pollset.hpp" #elif defined ZMQ_USE_POLL #include "poll.hpp" #elif defined ZMQ_USE_SELECT #include "select.hpp" #elif defined ZMQ_HAVE_GNU #define ZMQ_USE_POLL #include "poll.hpp" #else #error None of the ZMQ_USE_* macros defined #endif #if defined ZMQ_USE_SELECT #define ZMQ_POLL_BASED_ON_SELECT #else #define ZMQ_POLL_BASED_ON_POLL #endif #endif zeromq-4.2.5/src/stream.cpp0000664000372000037200000002274313255253220016536 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "stream.hpp" #include "pipe.hpp" #include "wire.hpp" #include "random.hpp" #include "likely.hpp" #include "err.hpp" zmq::stream_t::stream_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_), prefetched (false), routing_id_sent (false), current_out (NULL), more_out (false), next_integral_routing_id (generate_random ()) { options.type = ZMQ_STREAM; options.raw_socket = true; prefetched_routing_id.init (); prefetched_msg.init (); } zmq::stream_t::~stream_t () { zmq_assert (outpipes.empty ()); prefetched_routing_id.close (); prefetched_msg.close (); } void zmq::stream_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); identify_peer (pipe_); fq.attach (pipe_); } void zmq::stream_t::xpipe_terminated (pipe_t *pipe_) { outpipes_t::iterator it = outpipes.find (pipe_->get_routing_id ()); zmq_assert (it != outpipes.end ()); outpipes.erase (it); fq.pipe_terminated (pipe_); if (pipe_ == current_out) current_out = NULL; } void zmq::stream_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::stream_t::xwrite_activated (pipe_t *pipe_) { outpipes_t::iterator it; for (it = outpipes.begin (); it != outpipes.end (); ++it) if (it->second.pipe == pipe_) break; zmq_assert (it != outpipes.end ()); zmq_assert (!it->second.active); it->second.active = true; } int zmq::stream_t::xsend (msg_t *msg_) { // If this is the first part of the message it's the ID of the // peer to send the message to. if (!more_out) { zmq_assert (!current_out); // If we have malformed message (prefix with no subsequent message) // then just silently ignore it. // TODO: The connections should be killed instead. if (msg_->flags () & msg_t::more) { // Find the pipe associated with the routing id stored in the prefix. // If there's no such pipe return an error blob_t routing_id ((unsigned char *) msg_->data (), msg_->size ()); outpipes_t::iterator it = outpipes.find (routing_id); if (it != outpipes.end ()) { current_out = it->second.pipe; if (!current_out->check_write ()) { it->second.active = false; current_out = NULL; errno = EAGAIN; return -1; } } else { errno = EHOSTUNREACH; return -1; } } // Expect one more message frame. more_out = true; int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); return 0; } // Ignore the MORE flag msg_->reset_flags (msg_t::more); // This is the last part of the message. more_out = false; // Push the message into the pipe. If there's no out pipe, just drop it. if (current_out) { // Close the remote connection if user has asked to do so // by sending zero length message. // Pending messages in the pipe will be dropped (on receiving term- ack) if (msg_->size () == 0) { current_out->terminate (false); int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); current_out = NULL; return 0; } bool ok = current_out->write (msg_); if (likely (ok)) current_out->flush (); current_out = NULL; } else { int rc = msg_->close (); errno_assert (rc == 0); } // Detach the message from the data buffer. int rc = msg_->init (); errno_assert (rc == 0); return 0; } int zmq::stream_t::xsetsockopt (int option_, const void *optval_, size_t optvallen_) { switch (option_) { case ZMQ_CONNECT_ROUTING_ID: // TODO why isn't it possible to set an empty connect_routing_id // (which is the default value) if (optval_ && optvallen_) { connect_routing_id.assign ((char *) optval_, optvallen_); return 0; } break; case ZMQ_STREAM_NOTIFY: return do_setsockopt_int_as_bool_strict (optval_, optvallen_, &options.raw_notify); break; default: break; } errno = EINVAL; return -1; } int zmq::stream_t::xrecv (msg_t *msg_) { if (prefetched) { if (!routing_id_sent) { int rc = msg_->move (prefetched_routing_id); errno_assert (rc == 0); routing_id_sent = true; } else { int rc = msg_->move (prefetched_msg); errno_assert (rc == 0); prefetched = false; } return 0; } pipe_t *pipe = NULL; int rc = fq.recvpipe (&prefetched_msg, &pipe); if (rc != 0) return -1; zmq_assert (pipe != NULL); zmq_assert ((prefetched_msg.flags () & msg_t::more) == 0); // We have received a frame with TCP data. // Rather than sending this frame, we keep it in prefetched // buffer and send a frame with peer's ID. const blob_t &routing_id = pipe->get_routing_id (); rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init_size (routing_id.size ()); errno_assert (rc == 0); // forward metadata (if any) metadata_t *metadata = prefetched_msg.metadata (); if (metadata) msg_->set_metadata (metadata); memcpy (msg_->data (), routing_id.data (), routing_id.size ()); msg_->set_flags (msg_t::more); prefetched = true; routing_id_sent = true; return 0; } bool zmq::stream_t::xhas_in () { // We may already have a message pre-fetched. if (prefetched) return true; // Try to read the next message. // The message, if read, is kept in the pre-fetch buffer. pipe_t *pipe = NULL; int rc = fq.recvpipe (&prefetched_msg, &pipe); if (rc != 0) return false; zmq_assert (pipe != NULL); zmq_assert ((prefetched_msg.flags () & msg_t::more) == 0); const blob_t &routing_id = pipe->get_routing_id (); rc = prefetched_routing_id.init_size (routing_id.size ()); errno_assert (rc == 0); // forward metadata (if any) metadata_t *metadata = prefetched_msg.metadata (); if (metadata) prefetched_routing_id.set_metadata (metadata); memcpy (prefetched_routing_id.data (), routing_id.data (), routing_id.size ()); prefetched_routing_id.set_flags (msg_t::more); prefetched = true; routing_id_sent = false; return true; } bool zmq::stream_t::xhas_out () { // In theory, STREAM socket is always ready for writing. Whether actual // attempt to write succeeds depends on which pipe the message is going // to be routed to. return true; } void zmq::stream_t::identify_peer (pipe_t *pipe_) { // Always assign routing id for raw-socket unsigned char buffer[5]; buffer[0] = 0; blob_t routing_id; if (connect_routing_id.length ()) { routing_id.set ((unsigned char *) connect_routing_id.c_str (), connect_routing_id.length ()); connect_routing_id.clear (); outpipes_t::iterator it = outpipes.find (routing_id); zmq_assert (it == outpipes.end ()); } else { put_uint32 (buffer + 1, next_integral_routing_id++); routing_id.set (buffer, sizeof buffer); memcpy (options.routing_id, routing_id.data (), routing_id.size ()); options.routing_id_size = (unsigned char) routing_id.size (); } pipe_->set_router_socket_routing_id (routing_id); // Add the record into output pipes lookup table outpipe_t outpipe = {pipe_, true}; const bool ok = outpipes.ZMQ_MAP_INSERT_OR_EMPLACE (ZMQ_MOVE (routing_id), outpipe) .second; zmq_assert (ok); } zeromq-4.2.5/src/i_mailbox.hpp0000664000372000037200000000375213255253220017212 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_I_MAILBOX_HPP_INCLUDED__ #define __ZMQ_I_MAILBOX_HPP_INCLUDED__ #include "stdint.hpp" namespace zmq { // Interface to be implemented by mailbox. class i_mailbox { public: virtual ~i_mailbox () {} virtual void send (const command_t &cmd_) = 0; virtual int recv (command_t *cmd_, int timeout_) = 0; #ifdef HAVE_FORK // close the file descriptors in the signaller. This is used in a forked // child process to close the file descriptors so that they do not interfere // with the context in the parent process. virtual void forked () = 0; #endif }; } #endif zeromq-4.2.5/src/ipc_connecter.cpp0000664000372000037200000001730613255253220020055 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "ipc_connecter.hpp" #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_OPENVMS \ && !defined ZMQ_HAVE_VXWORKS #include #include #include "stream_engine.hpp" #include "io_thread.hpp" #include "random.hpp" #include "err.hpp" #include "ip.hpp" #include "address.hpp" #include "ipc_address.hpp" #include "session_base.hpp" #include #include #include #include zmq::ipc_connecter_t::ipc_connecter_t (class io_thread_t *io_thread_, class session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_) : own_t (io_thread_, options_), io_object_t (io_thread_), addr (addr_), s (retired_fd), handle_valid (false), delayed_start (delayed_start_), timer_started (false), session (session_), current_reconnect_ivl (options.reconnect_ivl) { zmq_assert (addr); zmq_assert (addr->protocol == "ipc"); addr->to_string (endpoint); socket = session->get_socket (); } zmq::ipc_connecter_t::~ipc_connecter_t () { zmq_assert (!timer_started); zmq_assert (!handle_valid); zmq_assert (s == retired_fd); } void zmq::ipc_connecter_t::process_plug () { if (delayed_start) add_reconnect_timer (); else start_connecting (); } void zmq::ipc_connecter_t::process_term (int linger_) { if (timer_started) { cancel_timer (reconnect_timer_id); timer_started = false; } if (handle_valid) { rm_fd (handle); handle_valid = false; } if (s != retired_fd) close (); own_t::process_term (linger_); } void zmq::ipc_connecter_t::in_event () { // We are not polling for incoming data, so we are actually called // because of error here. However, we can get error on out event as well // on some platforms, so we'll simply handle both events in the same way. out_event (); } void zmq::ipc_connecter_t::out_event () { fd_t fd = connect (); rm_fd (handle); handle_valid = false; // Handle the error condition by attempt to reconnect. if (fd == retired_fd) { close (); add_reconnect_timer (); return; } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Attach the engine to the corresponding session object. send_attach (session, engine); // Shut the connecter down. terminate (); socket->event_connected (endpoint, fd); } void zmq::ipc_connecter_t::timer_event (int id_) { zmq_assert (id_ == reconnect_timer_id); timer_started = false; start_connecting (); } void zmq::ipc_connecter_t::start_connecting () { // Open the connecting socket. int rc = open (); // Connect may succeed in synchronous manner. if (rc == 0) { handle = add_fd (s); handle_valid = true; out_event (); } // Connection establishment may be delayed. Poll for its completion. else if (rc == -1 && errno == EINPROGRESS) { handle = add_fd (s); handle_valid = true; set_pollout (handle); socket->event_connect_delayed (endpoint, zmq_errno ()); } // Handle any other error condition by eventual reconnect. else { if (s != retired_fd) close (); add_reconnect_timer (); } } void zmq::ipc_connecter_t::add_reconnect_timer () { int rc_ivl = get_new_reconnect_ivl (); add_timer (rc_ivl, reconnect_timer_id); socket->event_connect_retried (endpoint, rc_ivl); timer_started = true; } int zmq::ipc_connecter_t::get_new_reconnect_ivl () { // The new interval is the current interval + random value. int this_interval = current_reconnect_ivl + (generate_random () % options.reconnect_ivl); // Only change the current reconnect interval if the maximum reconnect // interval was set and if it's larger than the reconnect interval. if (options.reconnect_ivl_max > 0 && options.reconnect_ivl_max > options.reconnect_ivl) { // Calculate the next interval current_reconnect_ivl = current_reconnect_ivl * 2; if (current_reconnect_ivl >= options.reconnect_ivl_max) { current_reconnect_ivl = options.reconnect_ivl_max; } } return this_interval; } int zmq::ipc_connecter_t::open () { zmq_assert (s == retired_fd); // Create the socket. s = open_socket (AF_UNIX, SOCK_STREAM, 0); if (s == -1) return -1; // Set the non-blocking flag. unblock_socket (s); // Connect to the remote peer. int rc = ::connect (s, addr->resolved.ipc_addr->addr (), addr->resolved.ipc_addr->addrlen ()); // Connect was successful immediately. if (rc == 0) return 0; // Translate other error codes indicating asynchronous connect has been // launched to a uniform EINPROGRESS. if (rc == -1 && errno == EINTR) { errno = EINPROGRESS; return -1; } // Forward the error. return -1; } int zmq::ipc_connecter_t::close () { zmq_assert (s != retired_fd); int rc = ::close (s); errno_assert (rc == 0); socket->event_closed (endpoint, s); s = retired_fd; return 0; } zmq::fd_t zmq::ipc_connecter_t::connect () { // Following code should handle both Berkeley-derived socket // implementations and Solaris. int err = 0; #if defined ZMQ_HAVE_HPUX int len = sizeof (err); #else socklen_t len = sizeof (err); #endif int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &err, &len); if (rc == -1) { if (errno == ENOPROTOOPT) errno = 0; err = errno; } if (err != 0) { // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. errno = err; errno_assert (errno == ECONNREFUSED || errno == ECONNRESET || errno == ETIMEDOUT || errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN); return retired_fd; } fd_t result = s; s = retired_fd; return result; } #endif zeromq-4.2.5/src/plain_server.hpp0000664000372000037200000000451013255253220017731 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PLAIN_SERVER_HPP_INCLUDED__ #define __ZMQ_PLAIN_SERVER_HPP_INCLUDED__ #include "mechanism.hpp" #include "options.hpp" #include "zap_client.hpp" namespace zmq { class msg_t; class session_base_t; class plain_server_t : public zap_client_common_handshake_t { public: plain_server_t (session_base_t *session_, const std::string &peer_address_, const options_t &options_); virtual ~plain_server_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); private: int produce_welcome (msg_t *msg_) const; int produce_ready (msg_t *msg_) const; int produce_error (msg_t *msg_) const; int process_hello (msg_t *msg_); int process_initiate (msg_t *msg_); void send_zap_request (const std::string &username, const std::string &password); }; } #endif zeromq-4.2.5/src/v2_decoder.cpp0000664000372000037200000001344713255253220017260 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include #include "v2_protocol.hpp" #include "v2_decoder.hpp" #include "likely.hpp" #include "wire.hpp" #include "err.hpp" zmq::v2_decoder_t::v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_, bool zero_copy_) : shared_message_memory_allocator (bufsize_), decoder_base_t (this), msg_flags (0), zero_copy (zero_copy_), maxmsgsize (maxmsgsize_) { int rc = in_progress.init (); errno_assert (rc == 0); // At the beginning, read one byte and go to flags_ready state. next_step (tmpbuf, 1, &v2_decoder_t::flags_ready); } zmq::v2_decoder_t::~v2_decoder_t () { int rc = in_progress.close (); errno_assert (rc == 0); } int zmq::v2_decoder_t::flags_ready (unsigned char const *) { msg_flags = 0; if (tmpbuf[0] & v2_protocol_t::more_flag) msg_flags |= msg_t::more; if (tmpbuf[0] & v2_protocol_t::command_flag) msg_flags |= msg_t::command; // The payload length is either one or eight bytes, // depending on whether the 'large' bit is set. if (tmpbuf[0] & v2_protocol_t::large_flag) next_step (tmpbuf, 8, &v2_decoder_t::eight_byte_size_ready); else next_step (tmpbuf, 1, &v2_decoder_t::one_byte_size_ready); return 0; } int zmq::v2_decoder_t::one_byte_size_ready (unsigned char const *read_from) { return size_ready (tmpbuf[0], read_from); } int zmq::v2_decoder_t::eight_byte_size_ready (unsigned char const *read_from) { // The payload size is encoded as 64-bit unsigned integer. // The most significant byte comes first. const uint64_t msg_size = get_uint64 (tmpbuf); return size_ready (msg_size, read_from); } int zmq::v2_decoder_t::size_ready (uint64_t msg_size, unsigned char const *read_pos) { // Message size must not exceed the maximum allowed size. if (maxmsgsize >= 0) if (unlikely (msg_size > static_cast (maxmsgsize))) { errno = EMSGSIZE; return -1; } // Message size must fit into size_t data type. if (unlikely (msg_size != static_cast (msg_size))) { errno = EMSGSIZE; return -1; } int rc = in_progress.close (); assert (rc == 0); // the current message can exceed the current buffer. We have to copy the buffer // data into a new message and complete it in the next receive. if (unlikely ( !zero_copy || ((unsigned char *) read_pos + msg_size > (data () + size ())))) { // a new message has started, but the size would exceed the pre-allocated arena // this happens every time when a message does not fit completely into the buffer rc = in_progress.init_size (static_cast (msg_size)); } else { // construct message using n bytes from the buffer as storage // increase buffer ref count // if the message will be a large message, pass a valid refcnt memory location as well rc = in_progress.init ((unsigned char *) read_pos, static_cast (msg_size), shared_message_memory_allocator::call_dec_ref, buffer (), provide_content ()); // For small messages, data has been copied and refcount does not have to be increased if (in_progress.is_zcmsg ()) { advance_content (); inc_ref (); } } if (unlikely (rc)) { errno_assert (errno == ENOMEM); rc = in_progress.init (); errno_assert (rc == 0); errno = ENOMEM; return -1; } in_progress.set_flags (msg_flags); // this sets read_pos to // the message data address if the data needs to be copied // for small message / messages exceeding the current buffer // or // to the current start address in the buffer because the message // was constructed to use n bytes from the address passed as argument next_step (in_progress.data (), in_progress.size (), &v2_decoder_t::message_ready); return 0; } int zmq::v2_decoder_t::message_ready (unsigned char const *) { // Message is completely read. Signal this to the caller // and prepare to decode next message. next_step (tmpbuf, 1, &v2_decoder_t::flags_ready); return 1; } zeromq-4.2.5/src/ypipe_base.hpp0000664000372000037200000000373613255253220017371 0ustar00travistravis00000000000000 /* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_YPIPE_BASE_HPP_INCLUDED__ #define __ZMQ_YPIPE_BASE_HPP_INCLUDED__ namespace zmq { // ypipe_base abstracts ypipe and ypipe_conflate specific // classes, one is selected according to a the conflate // socket option template class ypipe_base_t { public: virtual ~ypipe_base_t () {} virtual void write (const T &value_, bool incomplete_) = 0; virtual bool unwrite (T *value_) = 0; virtual bool flush () = 0; virtual bool check_read () = 0; virtual bool read (T *value_) = 0; virtual bool probe (bool (*fn) (const T &)) = 0; }; } #endif zeromq-4.2.5/src/ip.hpp0000664000372000037200000000554013255253220015654 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_IP_HPP_INCLUDED__ #define __ZMQ_IP_HPP_INCLUDED__ #include #include "fd.hpp" namespace zmq { // Same as socket(2), but allows for transparent tweaking the options. fd_t open_socket (int domain_, int type_, int protocol_); // Sets the socket into non-blocking mode. void unblock_socket (fd_t s_); // Enable IPv4-mapping of addresses in case it is disabled by default. void enable_ipv4_mapping (fd_t s_); // Returns string representation of peer's address. // Socket sockfd_ must be connected. Returns true iff successful. int get_peer_ip_address (fd_t sockfd_, std::string &ip_addr_); // Sets the IP Type-Of-Service for the underlying socket void set_ip_type_of_service (fd_t s_, int iptos); // Sets the SO_NOSIGPIPE option for the underlying socket. // Return 0 on success, -1 if the connection has been closed by the peer int set_nosigpipe (fd_t s_); // Binds the underlying socket to the given device, eg. VRF or interface void bind_to_device (fd_t s_, std::string &bound_device_); // Initialize network subsystem. May be called multiple times. Each call must be matched by a call to shutdown_network. bool initialize_network (); // Shutdown network subsystem. Must be called once for each call to initialize_network before terminating. void shutdown_network (); // Creates a pair of sockets (using signaler_port on OS using TCP sockets). // Returns -1 if we could not make the socket pair successfully int make_fdpair (fd_t *r_, fd_t *w_); } #endif zeromq-4.2.5/src/thread.hpp0000664000372000037200000001015613255253220016512 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_THREAD_HPP_INCLUDED__ #define __ZMQ_THREAD_HPP_INCLUDED__ #if defined ZMQ_HAVE_VXWORKS #include #include #elif !defined ZMQ_HAVE_WINDOWS #include #endif #include namespace zmq { typedef void(thread_fn) (void *); // Class encapsulating OS thread. Thread initiation/termination is done // using special functions rather than in constructor/destructor so that // thread isn't created during object construction by accident, causing // newly created thread to access half-initialised object. Same applies // to the destruction process: Thread should be terminated before object // destruction begins, otherwise it can access half-destructed object. class thread_t { public: inline thread_t () : tfn (NULL), arg (NULL), started (false), thread_priority (ZMQ_THREAD_PRIORITY_DFLT), thread_sched_policy (ZMQ_THREAD_SCHED_POLICY_DFLT) { } #ifdef ZMQ_HAVE_VXWORKS ~thread_t () { if (descriptor != NULL || descriptor > 0) { taskDelete (descriptor); } } #endif // Creates OS thread. 'tfn' is main thread function. It'll be passed // 'arg' as an argument. void start (thread_fn *tfn_, void *arg_); // Returns whether the thread was started, i.e. start was called. bool get_started () const; // Returns whether the executing thread is the thread represented by the // thread object. bool is_current_thread () const; // Waits for thread termination. void stop (); // Sets the thread scheduling parameters. Only implemented for // pthread. Has no effect on other platforms. void setSchedulingParameters (int priority_, int schedulingPolicy_, const std::set &affinity_cpus_); // Sets the thread name, 16 characters max including terminating NUL. // Only implemented for pthread. Has no effect on other platforms. void setThreadName (const char *name_); // These are internal members. They should be private, however then // they would not be accessible from the main C routine of the thread. void applySchedulingParameters (); thread_fn *tfn; void *arg; private: bool started; #ifdef ZMQ_HAVE_WINDOWS HANDLE descriptor; #elif defined ZMQ_HAVE_VXWORKS int descriptor; enum { DEFAULT_PRIORITY = 100, DEFAULT_OPTIONS = 0, DEFAULT_STACK_SIZE = 4000 }; #else pthread_t descriptor; #endif // Thread scheduling parameters. int thread_priority; int thread_sched_policy; std::set thread_affinity_cpus; thread_t (const thread_t &); const thread_t &operator= (const thread_t &); }; } #endif zeromq-4.2.5/src/vmci_listener.hpp0000664000372000037200000000566713255253220020121 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_VMCI_LISTENER_HPP_INCLUDED__ #define __ZMQ_VMCI_LISTENER_HPP_INCLUDED__ #include "platform.hpp" #if defined ZMQ_HAVE_VMCI #include #include "fd.hpp" #include "own.hpp" #include "stdint.hpp" #include "io_object.hpp" namespace zmq { class io_thread_t; class socket_base_t; class vmci_listener_t : public own_t, public io_object_t { public: vmci_listener_t (zmq::io_thread_t *io_thread_, zmq::socket_base_t *socket_, const options_t &options_); ~vmci_listener_t (); // Set address to listen on. int set_address (const char *addr_); // Get the bound address for use with wildcards int get_address (std::string &addr_); private: // Handlers for incoming commands. void process_plug (); void process_term (int linger_); // Handlers for I/O events. void in_event (); // Close the listening socket. void close (); // Accept the new connection. Returns the file descriptor of the // newly created connection. The function may return retired_fd // if the connection was dropped while waiting in the listen backlog. fd_t accept (); // Underlying socket. fd_t s; // Handle corresponding to the listening socket. handle_t handle; // Socket the listerner belongs to. zmq::socket_base_t *socket; // String representation of endpoint to bind to std::string endpoint; vmci_listener_t (const vmci_listener_t &); const vmci_listener_t &operator= (const vmci_listener_t &); }; } #endif #endif zeromq-4.2.5/src/zap_client.cpp0000664000372000037200000002363013255253220017367 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "zap_client.hpp" #include "msg.hpp" #include "session_base.hpp" namespace zmq { zap_client_t::zap_client_t (session_base_t *const session_, const std::string &peer_address_, const options_t &options_) : mechanism_base_t (session_, options_), peer_address (peer_address_) { } void zap_client_t::send_zap_request (const char *mechanism, size_t mechanism_length, const uint8_t *credentials, size_t credentials_size) { send_zap_request (mechanism, mechanism_length, &credentials, &credentials_size, 1); } void zap_client_t::send_zap_request (const char *mechanism, size_t mechanism_length, const uint8_t **credentials, size_t *credentials_sizes, size_t credentials_count) { // write_zap_msg cannot fail. It could only fail if the HWM was exceeded, // but on the ZAP socket, the HWM is disabled. int rc; msg_t msg; // Address delimiter frame rc = msg.init (); errno_assert (rc == 0); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Version frame rc = msg.init_size (3); errno_assert (rc == 0); memcpy (msg.data (), "1.0", 3); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Request ID frame rc = msg.init_size (1); errno_assert (rc == 0); memcpy (msg.data (), "1", 1); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Domain frame rc = msg.init_size (options.zap_domain.length ()); errno_assert (rc == 0); memcpy (msg.data (), options.zap_domain.c_str (), options.zap_domain.length ()); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Address frame rc = msg.init_size (peer_address.length ()); errno_assert (rc == 0); memcpy (msg.data (), peer_address.c_str (), peer_address.length ()); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Routing id frame rc = msg.init_size (options.routing_id_size); errno_assert (rc == 0); memcpy (msg.data (), options.routing_id, options.routing_id_size); msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Mechanism frame rc = msg.init_size (mechanism_length); errno_assert (rc == 0); memcpy (msg.data (), mechanism, mechanism_length); if (credentials_count) msg.set_flags (msg_t::more); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); // Credentials frames for (size_t i = 0; i < credentials_count; ++i) { rc = msg.init_size (credentials_sizes[i]); errno_assert (rc == 0); if (i < credentials_count - 1) msg.set_flags (msg_t::more); memcpy (msg.data (), credentials[i], credentials_sizes[i]); rc = session->write_zap_msg (&msg); errno_assert (rc == 0); } } int zap_client_t::receive_and_process_zap_reply () { int rc = 0; msg_t msg[7]; // ZAP reply consists of 7 frames // Initialize all reply frames for (int i = 0; i < 7; i++) { rc = msg[i].init (); errno_assert (rc == 0); } for (int i = 0; i < 7; i++) { rc = session->read_zap_msg (&msg[i]); if (rc == -1) { if (errno == EAGAIN) { return 1; } return close_and_return (msg, -1); } if ((msg[i].flags () & msg_t::more) == (i < 6 ? 0 : msg_t::more)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY); errno = EPROTO; return close_and_return (msg, -1); } } // Address delimiter frame if (msg[0].size () > 0) { // TODO can a ZAP handler produce such a message at all? session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED); errno = EPROTO; return close_and_return (msg, -1); } // Version frame if (msg[1].size () != 3 || memcmp (msg[1].data (), "1.0", 3)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION); errno = EPROTO; return close_and_return (msg, -1); } // Request id frame if (msg[2].size () != 1 || memcmp (msg[2].data (), "1", 1)) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID); errno = EPROTO; return close_and_return (msg, -1); } // Status code frame, only 200, 300, 400 and 500 are valid status codes char *status_code_data = static_cast (msg[3].data ()); if (msg[3].size () != 3 || status_code_data[0] < '2' || status_code_data[0] > '5' || status_code_data[1] != '0' || status_code_data[2] != '0') { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE); errno = EPROTO; return close_and_return (msg, -1); } // Save status code status_code.assign (static_cast (msg[3].data ()), 3); // Save user id set_user_id (msg[5].data (), msg[5].size ()); // Process metadata frame rc = parse_metadata (static_cast (msg[6].data ()), msg[6].size (), true); if (rc != 0) { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA); errno = EPROTO; return close_and_return (msg, -1); } // Close all reply frames for (int i = 0; i < 7; i++) { const int rc2 = msg[i].close (); errno_assert (rc2 == 0); } handle_zap_status_code (); return 0; } void zap_client_t::handle_zap_status_code () { // we can assume here that status_code is a valid ZAP status code, // i.e. 200, 300, 400 or 500 int status_code_numeric = 0; switch (status_code[0]) { case '2': return; case '3': status_code_numeric = 300; break; case '4': status_code_numeric = 400; break; case '5': status_code_numeric = 500; break; } session->get_socket ()->event_handshake_failed_auth ( session->get_endpoint (), status_code_numeric); } zap_client_common_handshake_t::zap_client_common_handshake_t ( session_base_t *const session_, const std::string &peer_address_, const options_t &options_, state_t zap_reply_ok_state_) : mechanism_base_t (session_, options_), zap_client_t (session_, peer_address_, options_), state (waiting_for_hello), zap_reply_ok_state (zap_reply_ok_state_) { } zmq::mechanism_t::status_t zap_client_common_handshake_t::status () const { if (state == ready) return mechanism_t::ready; else if (state == error_sent) return mechanism_t::error; else return mechanism_t::handshaking; } int zap_client_common_handshake_t::zap_msg_available () { zmq_assert (state == waiting_for_zap_reply); return receive_and_process_zap_reply () == -1 ? -1 : 0; } void zap_client_common_handshake_t::handle_zap_status_code () { zap_client_t::handle_zap_status_code (); // we can assume here that status_code is a valid ZAP status code, // i.e. 200, 300, 400 or 500 switch (status_code[0]) { case '2': state = zap_reply_ok_state; break; case '3': // a 300 error code (temporary failure) // should NOT result in an ERROR message, but instead the // client should be silently disconnected (see CURVEZMQ RFC) // therefore, go immediately to state error_sent state = error_sent; break; default: state = sending_error; } } int zap_client_common_handshake_t::receive_and_process_zap_reply () { zmq_assert (state == waiting_for_zap_reply); return zap_client_t::receive_and_process_zap_reply (); } } zeromq-4.2.5/src/generic_mtrie_impl.hpp0000664000372000037200000003554313255253220021107 0ustar00travistravis00000000000000/* Copyright (c) 2018 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_GENERIC_MTRIE_IMPL_HPP_INCLUDED__ #define __ZMQ_GENERIC_MTRIE_IMPL_HPP_INCLUDED__ #include #include #include #include "err.hpp" #include "pipe.hpp" #include "macros.hpp" #include "generic_mtrie.hpp" template zmq::generic_mtrie_t::generic_mtrie_t () : pipes (0), min (0), count (0), live_nodes (0) { } template zmq::generic_mtrie_t::~generic_mtrie_t () { LIBZMQ_DELETE (pipes); if (count == 1) { zmq_assert (next.node); LIBZMQ_DELETE (next.node); } else if (count > 1) { for (unsigned short i = 0; i != count; ++i) { LIBZMQ_DELETE (next.table[i]); } free (next.table); } } template bool zmq::generic_mtrie_t::add (prefix_t prefix_, size_t size_, value_t *pipe_) { return add_helper (prefix_, size_, pipe_); } template bool zmq::generic_mtrie_t::add_helper (prefix_t prefix_, size_t size_, value_t *pipe_) { // We are at the node corresponding to the prefix. We are done. if (!size_) { bool result = !pipes; if (!pipes) { pipes = new (std::nothrow) pipes_t; alloc_assert (pipes); } pipes->insert (pipe_); return result; } unsigned char c = *prefix_; if (c < min || c >= min + count) { // The character is out of range of currently handled // characters. We have to extend the table. if (!count) { min = c; count = 1; next.node = NULL; } else if (count == 1) { unsigned char oldc = min; generic_mtrie_t *oldp = next.node; count = (min < c ? c - min : min - c) + 1; next.table = (generic_mtrie_t **) malloc (sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); for (unsigned short i = 0; i != count; ++i) next.table[i] = 0; min = std::min (min, c); next.table[oldc - min] = oldp; } else if (min < c) { // The new character is above the current character range. unsigned short old_count = count; count = c - min + 1; next.table = (generic_mtrie_t **) realloc ( next.table, sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); for (unsigned short i = old_count; i != count; i++) next.table[i] = NULL; } else { // The new character is below the current character range. unsigned short old_count = count; count = (min + old_count) - c; next.table = (generic_mtrie_t **) realloc ( next.table, sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); memmove (next.table + min - c, next.table, old_count * sizeof (generic_mtrie_t *)); for (unsigned short i = 0; i != min - c; i++) next.table[i] = NULL; min = c; } } // If next node does not exist, create one. if (count == 1) { if (!next.node) { next.node = new (std::nothrow) generic_mtrie_t; alloc_assert (next.node); ++live_nodes; } return next.node->add_helper (prefix_ + 1, size_ - 1, pipe_); } else { if (!next.table[c - min]) { next.table[c - min] = new (std::nothrow) generic_mtrie_t; alloc_assert (next.table[c - min]); ++live_nodes; } return next.table[c - min]->add_helper (prefix_ + 1, size_ - 1, pipe_); } } template template void zmq::generic_mtrie_t::rm (value_t *pipe_, void (*func_) (prefix_t data_, size_t size_, Arg arg_), Arg arg_, bool call_on_uniq_) { unsigned char *buff = NULL; rm_helper (pipe_, &buff, 0, 0, func_, arg_, call_on_uniq_); free (buff); } template template void zmq::generic_mtrie_t::rm_helper (value_t *pipe_, unsigned char **buff_, size_t buffsize_, size_t maxbuffsize_, void (*func_) (prefix_t data_, size_t size_, Arg arg_), Arg arg_, bool call_on_uniq_) { // Remove the subscription from this node. if (pipes && pipes->erase (pipe_)) { if (!call_on_uniq_ || pipes->empty ()) { func_ (*buff_, buffsize_, arg_); } if (pipes->empty ()) { LIBZMQ_DELETE (pipes); } } // Adjust the buffer. if (buffsize_ >= maxbuffsize_) { maxbuffsize_ = buffsize_ + 256; *buff_ = (unsigned char *) realloc (*buff_, maxbuffsize_); alloc_assert (*buff_); } // If there are no subnodes in the trie, return. if (count == 0) return; // If there's one subnode (optimisation). if (count == 1) { (*buff_)[buffsize_] = min; buffsize_++; next.node->rm_helper (pipe_, buff_, buffsize_, maxbuffsize_, func_, arg_, call_on_uniq_); // Prune the node if it was made redundant by the removal if (next.node->is_redundant ()) { LIBZMQ_DELETE (next.node); count = 0; --live_nodes; zmq_assert (live_nodes == 0); } return; } // If there are multiple subnodes. // // New min non-null character in the node table after the removal unsigned char new_min = min + count - 1; // New max non-null character in the node table after the removal unsigned char new_max = min; for (unsigned short c = 0; c != count; c++) { (*buff_)[buffsize_] = min + c; if (next.table[c]) { next.table[c]->rm_helper (pipe_, buff_, buffsize_ + 1, maxbuffsize_, func_, arg_, call_on_uniq_); // Prune redundant nodes from the mtrie if (next.table[c]->is_redundant ()) { LIBZMQ_DELETE (next.table[c]); zmq_assert (live_nodes > 0); --live_nodes; } else { // The node is not redundant, so it's a candidate for being // the new min/max node. // // We loop through the node array from left to right, so the // first non-null, non-redundant node encountered is the new // minimum index. Conversely, the last non-redundant, non-null // node encountered is the new maximum index. if (c + min < new_min) new_min = c + min; if (c + min > new_max) new_max = c + min; } } } zmq_assert (count > 1); // Free the node table if it's no longer used. if (live_nodes == 0) { free (next.table); next.table = NULL; count = 0; } // Compact the node table if possible else if (live_nodes == 1) { // If there's only one live node in the table we can // switch to using the more compact single-node // representation zmq_assert (new_min == new_max); zmq_assert (new_min >= min && new_min < min + count); generic_mtrie_t *node = next.table[new_min - min]; zmq_assert (node); free (next.table); next.node = node; count = 1; min = new_min; } else if (new_min > min || new_max < min + count - 1) { zmq_assert (new_max - new_min + 1 > 1); generic_mtrie_t **old_table = next.table; zmq_assert (new_min > min || new_max < min + count - 1); zmq_assert (new_min >= min); zmq_assert (new_max <= min + count - 1); zmq_assert (new_max - new_min + 1 < count); count = new_max - new_min + 1; next.table = (generic_mtrie_t **) malloc (sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); memmove (next.table, old_table + (new_min - min), sizeof (generic_mtrie_t *) * count); free (old_table); min = new_min; } } template typename zmq::generic_mtrie_t::rm_result zmq::generic_mtrie_t::rm (prefix_t prefix_, size_t size_, value_t *pipe_) { return rm_helper (prefix_, size_, pipe_); } template typename zmq::generic_mtrie_t::rm_result zmq::generic_mtrie_t::rm_helper ( prefix_t prefix_, size_t size_, value_t *pipe_) { if (!size_) { if (!pipes) return not_found; typename pipes_t::size_type erased = pipes->erase (pipe_); if (pipes->empty ()) { zmq_assert (erased == 1); LIBZMQ_DELETE (pipes); return last_value_removed; } return (erased == 1) ? values_remain : not_found; } unsigned char c = *prefix_; if (!count || c < min || c >= min + count) return not_found; generic_mtrie_t *next_node = count == 1 ? next.node : next.table[c - min]; if (!next_node) return not_found; rm_result ret = next_node->rm_helper (prefix_ + 1, size_ - 1, pipe_); if (next_node->is_redundant ()) { LIBZMQ_DELETE (next_node); zmq_assert (count > 0); if (count == 1) { next.node = 0; count = 0; --live_nodes; zmq_assert (live_nodes == 0); } else { next.table[c - min] = 0; zmq_assert (live_nodes > 1); --live_nodes; // Compact the table if possible if (live_nodes == 1) { // If there's only one live node in the table we can // switch to using the more compact single-node // representation unsigned short i; for (i = 0; i < count; ++i) if (next.table[i]) break; zmq_assert (i < count); min += i; count = 1; generic_mtrie_t *oldp = next.table[i]; free (next.table); next.node = oldp; } else if (c == min) { // We can compact the table "from the left" unsigned short i; for (i = 1; i < count; ++i) if (next.table[i]) break; zmq_assert (i < count); min += i; count -= i; generic_mtrie_t **old_table = next.table; next.table = (generic_mtrie_t **) malloc ( sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); memmove (next.table, old_table + i, sizeof (generic_mtrie_t *) * count); free (old_table); } else if (c == min + count - 1) { // We can compact the table "from the right" unsigned short i; for (i = 1; i < count; ++i) if (next.table[count - 1 - i]) break; zmq_assert (i < count); count -= i; generic_mtrie_t **old_table = next.table; next.table = (generic_mtrie_t **) malloc ( sizeof (generic_mtrie_t *) * count); alloc_assert (next.table); memmove (next.table, old_table, sizeof (generic_mtrie_t *) * count); free (old_table); } } } return ret; } template template void zmq::generic_mtrie_t::match (prefix_t data_, size_t size_, void (*func_) (value_t *pipe_, Arg arg_), Arg arg_) { generic_mtrie_t *current = this; while (true) { // Signal the pipes attached to this node. if (current->pipes) { for (typename pipes_t::iterator it = current->pipes->begin (); it != current->pipes->end (); ++it) func_ (*it, arg_); } // If we are at the end of the message, there's nothing more to match. if (!size_) break; // If there are no subnodes in the trie, return. if (current->count == 0) break; // If there's one subnode (optimisation). if (current->count == 1) { if (data_[0] != current->min) break; current = current->next.node; data_++; size_--; continue; } // If there are multiple subnodes. if (data_[0] < current->min || data_[0] >= current->min + current->count) break; if (!current->next.table[data_[0] - current->min]) break; current = current->next.table[data_[0] - current->min]; data_++; size_--; } } template bool zmq::generic_mtrie_t::is_redundant () const { return !pipes && live_nodes == 0; } #endif zeromq-4.2.5/src/vmci_connecter.cpp0000664000372000037200000002067313255253220020241 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "vmci_connecter.hpp" #if defined ZMQ_HAVE_VMCI #include #include "stream_engine.hpp" #include "io_thread.hpp" #include "platform.hpp" #include "random.hpp" #include "err.hpp" #include "ip.hpp" #include "address.hpp" #include "session_base.hpp" #include "vmci_address.hpp" #include "vmci.hpp" zmq::vmci_connecter_t::vmci_connecter_t (class io_thread_t *io_thread_, class session_base_t *session_, const options_t &options_, const address_t *addr_, bool delayed_start_) : own_t (io_thread_, options_), io_object_t (io_thread_), addr (addr_), s (retired_fd), handle_valid (false), delayed_start (delayed_start_), timer_started (false), session (session_), current_reconnect_ivl (options.reconnect_ivl) { zmq_assert (addr); zmq_assert (addr->protocol == "vmci"); addr->to_string (endpoint); socket = session->get_socket (); } zmq::vmci_connecter_t::~vmci_connecter_t () { zmq_assert (!timer_started); zmq_assert (!handle_valid); zmq_assert (s == retired_fd); } void zmq::vmci_connecter_t::process_plug () { if (delayed_start) add_reconnect_timer (); else start_connecting (); } void zmq::vmci_connecter_t::process_term (int linger_) { if (timer_started) { cancel_timer (reconnect_timer_id); timer_started = false; } if (handle_valid) { rm_fd (handle); handle_valid = false; } if (s != retired_fd) close (); own_t::process_term (linger_); } void zmq::vmci_connecter_t::in_event () { // We are not polling for incoming data, so we are actually called // because of error here. However, we can get error on out event as well // on some platforms, so we'll simply handle both events in the same way. out_event (); } void zmq::vmci_connecter_t::out_event () { fd_t fd = connect (); rm_fd (handle); handle_valid = false; // Handle the error condition by attempt to reconnect. if (fd == retired_fd) { close (); add_reconnect_timer (); return; } tune_vmci_buffer_size (this->get_ctx (), fd, options.vmci_buffer_size, options.vmci_buffer_min_size, options.vmci_buffer_max_size); if (options.vmci_connect_timeout > 0) { #if defined ZMQ_HAVE_WINDOWS tune_vmci_connect_timeout (this->get_ctx (), fd, options.vmci_connect_timeout); #else struct timeval timeout = {0, options.vmci_connect_timeout * 1000}; tune_vmci_connect_timeout (this->get_ctx (), fd, timeout); #endif } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Attach the engine to the corresponding session object. send_attach (session, engine); // Shut the connecter down. terminate (); socket->event_connected (endpoint, fd); } void zmq::vmci_connecter_t::timer_event (int id_) { zmq_assert (id_ == reconnect_timer_id); timer_started = false; start_connecting (); } void zmq::vmci_connecter_t::start_connecting () { // Open the connecting socket. int rc = open (); // Connect may succeed in synchronous manner. if (rc == 0) { handle = add_fd (s); handle_valid = true; out_event (); } // Handle any other error condition by eventual reconnect. else { if (s != retired_fd) close (); add_reconnect_timer (); } } void zmq::vmci_connecter_t::add_reconnect_timer () { int rc_ivl = get_new_reconnect_ivl (); add_timer (rc_ivl, reconnect_timer_id); socket->event_connect_retried (endpoint, rc_ivl); timer_started = true; } int zmq::vmci_connecter_t::get_new_reconnect_ivl () { // The new interval is the current interval + random value. int this_interval = current_reconnect_ivl + (generate_random () % options.reconnect_ivl); // Only change the current reconnect interval if the maximum reconnect // interval was set and if it's larger than the reconnect interval. if (options.reconnect_ivl_max > 0 && options.reconnect_ivl_max > options.reconnect_ivl) { // Calculate the next interval current_reconnect_ivl = current_reconnect_ivl * 2; if (current_reconnect_ivl >= options.reconnect_ivl_max) { current_reconnect_ivl = options.reconnect_ivl_max; } } return this_interval; } int zmq::vmci_connecter_t::open () { zmq_assert (s == retired_fd); int family = this->get_ctx ()->get_vmci_socket_family (); if (family == -1) return -1; // Create the socket. s = open_socket (family, SOCK_STREAM, 0); #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) { errno = wsa_error_to_errno (WSAGetLastError ()); return -1; } #else if (s == -1) return -1; #endif // Connect to the remote peer. int rc = ::connect (s, addr->resolved.vmci_addr->addr (), addr->resolved.vmci_addr->addrlen ()); // Connect was successful immediately. if (rc == 0) return 0; // Forward the error. return -1; } void zmq::vmci_connecter_t::close () { zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_WINDOWS const int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else const int rc = ::close (s); errno_assert (rc == 0); #endif socket->event_closed (endpoint, s); s = retired_fd; } zmq::fd_t zmq::vmci_connecter_t::connect () { // Following code should handle both Berkeley-derived socket // implementations and Solaris. int err = 0; #if defined ZMQ_HAVE_HPUX int len = sizeof (err); #else socklen_t len = sizeof (err); #endif int rc = getsockopt (s, SOL_SOCKET, SO_ERROR, (char *) &err, &len); // Assert if the error was caused by 0MQ bug. // Networking problems are OK. No need to assert. #ifdef ZMQ_HAVE_WINDOWS zmq_assert (rc == 0); if (err != 0) { if (err != WSAECONNREFUSED && err != WSAETIMEDOUT && err != WSAECONNABORTED && err != WSAEHOSTUNREACH && err != WSAENETUNREACH && err != WSAENETDOWN && err != WSAEACCES && err != WSAEINVAL && err != WSAEADDRINUSE && err != WSAECONNRESET) { wsa_assert_no (err); } return retired_fd; } #else // Following code should handle both Berkeley-derived socket // implementations and Solaris. if (rc == -1) err = errno; if (err != 0) { errno = err; errno_assert (errno == ECONNREFUSED || errno == ECONNRESET || errno == ETIMEDOUT || errno == EHOSTUNREACH || errno == ENETUNREACH || errno == ENETDOWN || errno == EINVAL); return retired_fd; } #endif fd_t result = s; s = retired_fd; return result; } #endif zeromq-4.2.5/src/norm_engine.cpp0000664000372000037200000006347513255253220017552 0ustar00travistravis00000000000000 #include "precompiled.hpp" #include "platform.hpp" #if defined ZMQ_HAVE_NORM #include "norm_engine.hpp" #include "session_base.hpp" #include "v2_protocol.hpp" zmq::norm_engine_t::norm_engine_t (io_thread_t *parent_, const options_t &options_) : io_object_t (parent_), zmq_session (NULL), options (options_), norm_instance (NORM_INSTANCE_INVALID), norm_session (NORM_SESSION_INVALID), is_sender (false), is_receiver (false), zmq_encoder (0), norm_tx_stream (NORM_OBJECT_INVALID), tx_first_msg (true), tx_more_bit (false), zmq_output_ready (false), norm_tx_ready (false), tx_index (0), tx_len (0), zmq_input_ready (false) { int rc = tx_msg.init (); errno_assert (0 == rc); } zmq::norm_engine_t::~norm_engine_t () { shutdown (); // in case it was not already called } int zmq::norm_engine_t::init (const char *network_, bool send, bool recv) { // Parse the "network_" address int "iface", "addr", and "port" // norm endpoint format: [id,][;]: // First, look for optional local NormNodeId // (default NORM_NODE_ANY causes NORM to use host IP addr for NormNodeId) NormNodeId localId = NORM_NODE_ANY; const char *ifacePtr = strchr (network_, ','); if (NULL != ifacePtr) { size_t idLen = ifacePtr - network_; if (idLen > 31) idLen = 31; char idText[32]; strncpy (idText, network_, idLen); idText[idLen] = '\0'; localId = (NormNodeId) atoi (idText); ifacePtr++; } else { ifacePtr = network_; } // Second, look for optional multicast ifaceName char ifaceName[256]; const char *addrPtr = strchr (ifacePtr, ';'); if (NULL != addrPtr) { size_t ifaceLen = addrPtr - ifacePtr; if (ifaceLen > 255) ifaceLen = 255; // return error instead? strncpy (ifaceName, ifacePtr, ifaceLen); ifaceName[ifaceLen] = '\0'; ifacePtr = ifaceName; addrPtr++; } else { addrPtr = ifacePtr; ifacePtr = NULL; } // Finally, parse IP address and port number const char *portPtr = strrchr (addrPtr, ':'); if (NULL == portPtr) { errno = EINVAL; return -1; } char addr[256]; size_t addrLen = portPtr - addrPtr; if (addrLen > 255) addrLen = 255; strncpy (addr, addrPtr, addrLen); addr[addrLen] = '\0'; portPtr++; unsigned short portNumber = atoi (portPtr); if (NORM_INSTANCE_INVALID == norm_instance) { if (NORM_INSTANCE_INVALID == (norm_instance = NormCreateInstance ())) { // errno set by whatever caused NormCreateInstance() to fail return -1; } } // TBD - What do we use for our local NormNodeId? // (for now we use automatic, IP addr based assignment or passed in 'id') // a) Use ZMQ Identity somehow? // b) Add function to use iface addr // c) Randomize and implement a NORM session layer // conflict detection/resolution protocol norm_session = NormCreateSession (norm_instance, addr, portNumber, localId); if (NORM_SESSION_INVALID == norm_session) { int savedErrno = errno; NormDestroyInstance (norm_instance); norm_instance = NORM_INSTANCE_INVALID; errno = savedErrno; return -1; } // There's many other useful NORM options that could be applied here if (NormIsUnicastAddress (addr)) { NormSetDefaultUnicastNack (norm_session, true); } else { // These only apply for multicast sessions //NormSetTTL(norm_session, options.multicast_hops); // ZMQ default is 1 NormSetTTL ( norm_session, 255); // since the ZMQ_MULTICAST_HOPS socket option isn't well-supported NormSetRxPortReuse ( norm_session, true); // port reuse doesn't work for non-connected unicast NormSetLoopback (norm_session, true); // needed when multicast users on same machine if (NULL != ifacePtr) { // Note a bad interface may not be caught until sender or receiver start // (Since sender/receiver is not yet started, this always succeeds here) NormSetMulticastInterface (norm_session, ifacePtr); } } if (recv) { // The alternative NORM_SYNC_CURRENT here would provide "instant" // receiver sync to the sender's _current_ message transmission. // NORM_SYNC_STREAM tries to get everything the sender has cached/buffered NormSetDefaultSyncPolicy (norm_session, NORM_SYNC_STREAM); if (!NormStartReceiver (norm_session, 2 * 1024 * 1024)) { // errno set by whatever failed int savedErrno = errno; NormDestroyInstance (norm_instance); // session gets closed, too norm_session = NORM_SESSION_INVALID; norm_instance = NORM_INSTANCE_INVALID; errno = savedErrno; return -1; } is_receiver = true; } if (send) { // Pick a random sender instance id (aka norm sender session id) NormSessionId instanceId = NormGetRandomSessionId (); // TBD - provide "options" for some NORM sender parameters if (!NormStartSender (norm_session, instanceId, 2 * 1024 * 1024, 1400, 16, 4)) { // errno set by whatever failed int savedErrno = errno; NormDestroyInstance (norm_instance); // session gets closed, too norm_session = NORM_SESSION_INVALID; norm_instance = NORM_INSTANCE_INVALID; errno = savedErrno; return -1; } NormSetCongestionControl (norm_session, true); norm_tx_ready = true; is_sender = true; if (NORM_OBJECT_INVALID == (norm_tx_stream = NormStreamOpen (norm_session, 2 * 1024 * 1024))) { // errno set by whatever failed int savedErrno = errno; NormDestroyInstance (norm_instance); // session gets closed, too norm_session = NORM_SESSION_INVALID; norm_instance = NORM_INSTANCE_INVALID; errno = savedErrno; return -1; } } //NormSetMessageTrace(norm_session, true); //NormSetDebugLevel(3); //NormOpenDebugLog(norm_instance, "normLog.txt"); return 0; // no error } // end zmq::norm_engine_t::init() void zmq::norm_engine_t::shutdown () { // TBD - implement a more graceful shutdown option if (is_receiver) { NormStopReceiver (norm_session); // delete any active NormRxStreamState rx_pending_list.Destroy (); rx_ready_list.Destroy (); msg_ready_list.Destroy (); is_receiver = false; } if (is_sender) { NormStopSender (norm_session); is_sender = false; } if (NORM_SESSION_INVALID != norm_session) { NormDestroySession (norm_session); norm_session = NORM_SESSION_INVALID; } if (NORM_INSTANCE_INVALID != norm_instance) { NormStopInstance (norm_instance); NormDestroyInstance (norm_instance); norm_instance = NORM_INSTANCE_INVALID; } } // end zmq::norm_engine_t::shutdown() void zmq::norm_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_) { // TBD - we may assign the NORM engine to an io_thread in the future??? zmq_session = session_; if (is_sender) zmq_output_ready = true; if (is_receiver) zmq_input_ready = true; fd_t normDescriptor = NormGetDescriptor (norm_instance); norm_descriptor_handle = add_fd (normDescriptor); // Set POLLIN for notification of pending NormEvents set_pollin (norm_descriptor_handle); if (is_sender) send_data (); } // end zmq::norm_engine_t::init() void zmq::norm_engine_t::unplug () { rm_fd (norm_descriptor_handle); zmq_session = NULL; } // end zmq::norm_engine_t::unplug() void zmq::norm_engine_t::terminate () { unplug (); shutdown (); delete this; } void zmq::norm_engine_t::restart_output () { // There's new message data available from the session zmq_output_ready = true; if (norm_tx_ready) send_data (); } // end zmq::norm_engine_t::restart_output() void zmq::norm_engine_t::send_data () { // Here we write as much as is available or we can while (zmq_output_ready && norm_tx_ready) { if (0 == tx_len) { // Our tx_buffer needs data to send // Get more data from encoder size_t space = BUFFER_SIZE; unsigned char *bufPtr = (unsigned char *) tx_buffer; tx_len = zmq_encoder.encode (&bufPtr, space); if (0 == tx_len) { if (tx_first_msg) { // We don't need to mark eom/flush until a message is sent tx_first_msg = false; } else { // A prior message was completely written to stream, so // mark end-of-message and possibly flush (to force packet transmission, // even if it's not a full segment so message gets delivered quickly) // NormStreamMarkEom(norm_tx_stream); // the flush below marks eom // Note NORM_FLUSH_ACTIVE makes NORM fairly chatty for low duty cycle messaging // but makes sure content is delivered quickly. Positive acknowledgements // with flush override would make NORM more succinct here NormStreamFlush (norm_tx_stream, true, NORM_FLUSH_ACTIVE); } // Need to pull and load a new message to send if (-1 == zmq_session->pull_msg (&tx_msg)) { // We need to wait for "restart_output()" to be called by ZMQ zmq_output_ready = false; break; } zmq_encoder.load_msg (&tx_msg); // Should we write message size header for NORM to use? Or expect NORM // receiver to decode ZMQ message framing format(s)? // OK - we need to use a byte to denote when the ZMQ frame is the _first_ // frame of a message so it can be decoded properly when a receiver // 'syncs' mid-stream. We key off the the state of the 'more_flag' // I.e.,If more_flag _was_ false previously, this is the first // frame of a ZMQ message. if (tx_more_bit) tx_buffer[0] = (char) 0xff; // this is not first frame of message else tx_buffer[0] = 0x00; // this is first frame of message tx_more_bit = (0 != (tx_msg.flags () & msg_t::more)); // Go ahead an get a first chunk of the message bufPtr++; space--; tx_len = 1 + zmq_encoder.encode (&bufPtr, space); tx_index = 0; } } // Do we have data in our tx_buffer pending if (tx_index < tx_len) { // We have data in our tx_buffer to send, so write it to the stream tx_index += NormStreamWrite (norm_tx_stream, tx_buffer + tx_index, tx_len - tx_index); if (tx_index < tx_len) { // NORM stream buffer full, wait for NORM_TX_QUEUE_VACANCY norm_tx_ready = false; break; } tx_len = 0; // all buffered data was written } } // end while (zmq_output_ready && norm_tx_ready) } // end zmq::norm_engine_t::send_data() void zmq::norm_engine_t::in_event () { // This means a NormEvent is pending, so call NormGetNextEvent() and handle NormEvent event; if (!NormGetNextEvent (norm_instance, &event)) { // NORM has died before we unplugged?! zmq_assert (false); return; } switch (event.type) { case NORM_TX_QUEUE_VACANCY: case NORM_TX_QUEUE_EMPTY: if (!norm_tx_ready) { norm_tx_ready = true; send_data (); } break; case NORM_RX_OBJECT_NEW: //break; case NORM_RX_OBJECT_UPDATED: recv_data (event.object); break; case NORM_RX_OBJECT_ABORTED: { NormRxStreamState *rxState = (NormRxStreamState *) NormObjectGetUserData (event.object); if (NULL != rxState) { // Remove the state from the list it's in // This is now unnecessary since deletion takes care of list removal // but in the interest of being clear ... NormRxStreamState::List *list = rxState->AccessList (); if (NULL != list) list->Remove (*rxState); } delete rxState; break; } case NORM_REMOTE_SENDER_INACTIVE: // Here we free resources used for this formerly active sender. // Note w/ NORM_SYNC_STREAM, if sender reactivates, we may // get some messages delivered twice. NORM_SYNC_CURRENT would // mitigate that but might miss data at startup. Always tradeoffs. // Instead of immediately deleting, we could instead initiate a // user configurable timeout here to wait some amount of time // after this event to declare the remote sender truly dead // and delete its state??? NormNodeDelete (event.sender); break; default: // We ignore some NORM events break; } } // zmq::norm_engine_t::in_event() void zmq::norm_engine_t::restart_input () { // TBD - should we check/assert that zmq_input_ready was false??? zmq_input_ready = true; // Process any pending received messages if (!msg_ready_list.IsEmpty ()) recv_data (NORM_OBJECT_INVALID); } // end zmq::norm_engine_t::restart_input() void zmq::norm_engine_t::recv_data (NormObjectHandle object) { if (NORM_OBJECT_INVALID != object) { // Call result of NORM_RX_OBJECT_UPDATED notification // This is a rx_ready indication for a new or existing rx stream // First, determine if this is a stream we already know zmq_assert (NORM_OBJECT_STREAM == NormObjectGetType (object)); // Since there can be multiple senders (publishers), we keep // state for each separate rx stream. NormRxStreamState *rxState = (NormRxStreamState *) NormObjectGetUserData (object); if (NULL == rxState) { // This is a new stream, so create rxState with zmq decoder, etc rxState = new (std::nothrow) NormRxStreamState (object, options.maxmsgsize, options.zero_copy); errno_assert (rxState); if (!rxState->Init ()) { errno_assert (false); delete rxState; return; } NormObjectSetUserData (object, rxState); } else if (!rxState->IsRxReady ()) { // Existing non-ready stream, so remove from pending // list to be promoted to rx_ready_list ... rx_pending_list.Remove (*rxState); } if (!rxState->IsRxReady ()) { // TBD - prepend up front for immediate service? rxState->SetRxReady (true); rx_ready_list.Append (*rxState); } } // This loop repeats until we've read all data available from "rx ready" inbound streams // and pushed any accumulated messages we can up to the zmq session. while (!rx_ready_list.IsEmpty () || (zmq_input_ready && !msg_ready_list.IsEmpty ())) { // Iterate through our rx_ready streams, reading data into the decoder // (This services incoming "rx ready" streams in a round-robin fashion) NormRxStreamState::List::Iterator iterator (rx_ready_list); NormRxStreamState *rxState; while (NULL != (rxState = iterator.GetNextItem ())) { switch (rxState->Decode ()) { case 1: // msg completed // Complete message decoded, move this stream to msg_ready_list // to push the message up to the session below. Note the stream // will be returned to the "rx_ready_list" after that's done rx_ready_list.Remove (*rxState); msg_ready_list.Append (*rxState); continue; case -1: // decoding error (shouldn't happen w/ NORM, but ...) // We need to re-sync this stream (decoder buffer was reset) rxState->SetSync (false); break; default: // 0 - need more data break; } // Get more data from this stream NormObjectHandle stream = rxState->GetStreamHandle (); // First, make sure we're in sync ... while (!rxState->InSync ()) { // seek NORM message start if (!NormStreamSeekMsgStart (stream)) { // Need to wait for more data break; } // read message 'flag' byte to see if this it's a 'final' frame char syncFlag; unsigned int numBytes = 1; if (!NormStreamRead (stream, &syncFlag, &numBytes)) { // broken stream (shouldn't happen after seek msg start?) zmq_assert (false); continue; } if (0 == numBytes) { // This probably shouldn't happen either since we found msg start // Need to wait for more data break; } if (0 == syncFlag) rxState->SetSync (true); // else keep seeking ... } // end while(!rxState->InSync()) if (!rxState->InSync ()) { // Need more data for this stream, so remove from "rx ready" // list and iterate to next "rx ready" stream rxState->SetRxReady (false); // Move from rx_ready_list to rx_pending_list rx_ready_list.Remove (*rxState); rx_pending_list.Append (*rxState); continue; } // Now we're actually ready to read data from the NORM stream to the zmq_decoder // the underlying zmq_decoder->get_buffer() call sets how much is needed. unsigned int numBytes = rxState->GetBytesNeeded (); if (!NormStreamRead (stream, rxState->AccessBuffer (), &numBytes)) { // broken NORM stream, so re-sync rxState->Init (); // TBD - check result // This will retry syncing, and getting data from this stream // since we don't increment the "it" iterator continue; } rxState->IncrementBufferCount (numBytes); if (0 == numBytes) { // All the data available has been read // Need to wait for NORM_RX_OBJECT_UPDATED for this stream rxState->SetRxReady (false); // Move from rx_ready_list to rx_pending_list rx_ready_list.Remove (*rxState); rx_pending_list.Append (*rxState); } } // end while(NULL != (rxState = iterator.GetNextItem())) if (zmq_input_ready) { // At this point, we've made a pass through the "rx_ready" stream list // Now make a pass through the "msg_pending" list (if the zmq session // ready for more input). This may possibly return streams back to // the "rx ready" stream list after their pending message is handled NormRxStreamState::List::Iterator iterator (msg_ready_list); NormRxStreamState *rxState; while (NULL != (rxState = iterator.GetNextItem ())) { msg_t *msg = rxState->AccessMsg (); int rc = zmq_session->push_msg (msg); if (-1 == rc) { if (EAGAIN == errno) { // need to wait until session calls "restart_input()" zmq_input_ready = false; break; } else { // session rejected message? // TBD - handle this better zmq_assert (false); } } // else message was accepted. msg_ready_list.Remove (*rxState); if ( rxState ->IsRxReady ()) // Move back to "rx_ready" list to read more data rx_ready_list.Append (*rxState); else // Move back to "rx_pending" list until NORM_RX_OBJECT_UPDATED msg_ready_list.Append (*rxState); } // end while(NULL != (rxState = iterator.GetNextItem())) } // end if (zmq_input_ready) } // end while ((!rx_ready_list.empty() || (zmq_input_ready && !msg_ready_list.empty())) // Alert zmq of the messages we have pushed up zmq_session->flush (); } // end zmq::norm_engine_t::recv_data() zmq::norm_engine_t::NormRxStreamState::NormRxStreamState ( NormObjectHandle normStream, int64_t maxMsgSize, bool zeroCopy) : norm_stream (normStream), max_msg_size (maxMsgSize), zero_copy (zeroCopy), in_sync (false), rx_ready (false), zmq_decoder (NULL), skip_norm_sync (false), buffer_ptr (NULL), buffer_size (0), buffer_count (0), prev (NULL), next (NULL), list (NULL) { } zmq::norm_engine_t::NormRxStreamState::~NormRxStreamState () { if (NULL != zmq_decoder) { delete zmq_decoder; zmq_decoder = NULL; } if (NULL != list) { list->Remove (*this); list = NULL; } } bool zmq::norm_engine_t::NormRxStreamState::Init () { in_sync = false; skip_norm_sync = false; if (NULL != zmq_decoder) delete zmq_decoder; // Note "in_batch_size" comes from config.h zmq_decoder = new (std::nothrow) v2_decoder_t (in_batch_size, max_msg_size, zero_copy); alloc_assert (zmq_decoder); if (NULL != zmq_decoder) { buffer_count = 0; buffer_size = 0; zmq_decoder->get_buffer (&buffer_ptr, &buffer_size); return true; } else { return false; } } // end zmq::norm_engine_t::NormRxStreamState::Init() // This decodes any pending data sitting in our stream decoder buffer // It returns 1 upon message completion, -1 on error, 1 on msg completion int zmq::norm_engine_t::NormRxStreamState::Decode () { // If we have pending bytes to decode, process those first while (buffer_count > 0) { // There's pending data for the decoder to decode size_t processed = 0; // This a bit of a kludgy approach used to weed // out the NORM ZMQ message transport "syncFlag" byte // from the ZMQ message stream being decoded (but it works!) if (skip_norm_sync) { buffer_ptr++; buffer_count--; skip_norm_sync = false; } int rc = zmq_decoder->decode (buffer_ptr, buffer_count, processed); buffer_ptr += processed; buffer_count -= processed; switch (rc) { case 1: // msg completed if (0 == buffer_count) { buffer_size = 0; zmq_decoder->get_buffer (&buffer_ptr, &buffer_size); } skip_norm_sync = true; return 1; case -1: // decoder error (reset decoder and state variables) in_sync = false; skip_norm_sync = false; // will get consumed by norm sync check Init (); break; case 0: // need more data, keep decoding until buffer exhausted break; } } // Reset buffer pointer/count for next read buffer_count = 0; buffer_size = 0; zmq_decoder->get_buffer (&buffer_ptr, &buffer_size); return 0; // need more data } // end zmq::norm_engine_t::NormRxStreamState::Decode() zmq::norm_engine_t::NormRxStreamState::List::List () : head (NULL), tail (NULL) { } zmq::norm_engine_t::NormRxStreamState::List::~List () { Destroy (); } void zmq::norm_engine_t::NormRxStreamState::List::Destroy () { NormRxStreamState *item = head; while (NULL != item) { Remove (*item); delete item; item = head; } } // end zmq::norm_engine_t::NormRxStreamState::List::Destroy() void zmq::norm_engine_t::NormRxStreamState::List::Append ( NormRxStreamState &item) { item.prev = tail; if (NULL != tail) tail->next = &item; else head = &item; item.next = NULL; tail = &item; item.list = this; } // end zmq::norm_engine_t::NormRxStreamState::List::Append() void zmq::norm_engine_t::NormRxStreamState::List::Remove ( NormRxStreamState &item) { if (NULL != item.prev) item.prev->next = item.next; else head = item.next; if (NULL != item.next) item.next->prev = item.prev; else tail = item.prev; item.prev = item.next = NULL; item.list = NULL; } // end zmq::norm_engine_t::NormRxStreamState::List::Remove() zmq::norm_engine_t::NormRxStreamState::List::Iterator::Iterator ( const List &list) : next_item (list.head) { } zmq::norm_engine_t::NormRxStreamState * zmq::norm_engine_t::NormRxStreamState::List::Iterator::GetNextItem () { NormRxStreamState *nextItem = next_item; if (NULL != nextItem) next_item = nextItem->next; return nextItem; } // end zmq::norm_engine_t::NormRxStreamState::List::Iterator::GetNextItem() const char *zmq::norm_engine_t::get_endpoint () const { return ""; } #endif // ZMQ_HAVE_NORM zeromq-4.2.5/src/own.cpp0000664000372000037200000001341413255253220016041 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "own.hpp" #include "err.hpp" #include "io_thread.hpp" zmq::own_t::own_t (class ctx_t *parent_, uint32_t tid_) : object_t (parent_, tid_), terminating (false), sent_seqnum (0), processed_seqnum (0), owner (NULL), term_acks (0) { } zmq::own_t::own_t (io_thread_t *io_thread_, const options_t &options_) : object_t (io_thread_), options (options_), terminating (false), sent_seqnum (0), processed_seqnum (0), owner (NULL), term_acks (0) { } zmq::own_t::~own_t () { } void zmq::own_t::set_owner (own_t *owner_) { zmq_assert (!owner); owner = owner_; } void zmq::own_t::inc_seqnum () { // This function may be called from a different thread! sent_seqnum.add (1); } void zmq::own_t::process_seqnum () { // Catch up with counter of processed commands. processed_seqnum++; // We may have catched up and still have pending terms acks. check_term_acks (); } void zmq::own_t::launch_child (own_t *object_) { // Specify the owner of the object. object_->set_owner (this); // Plug the object into the I/O thread. send_plug (object_); // Take ownership of the object. send_own (this, object_); } void zmq::own_t::term_child (own_t *object_) { process_term_req (object_); } void zmq::own_t::process_term_req (own_t *object_) { // When shutting down we can ignore termination requests from owned // objects. The termination request was already sent to the object. if (terminating) return; // If I/O object is well and alive let's ask it to terminate. owned_t::iterator it = std::find (owned.begin (), owned.end (), object_); // If not found, we assume that termination request was already sent to // the object so we can safely ignore the request. if (it == owned.end ()) return; owned.erase (it); register_term_acks (1); // Note that this object is the root of the (partial shutdown) thus, its // value of linger is used, rather than the value stored by the children. send_term (object_, options.linger.load ()); } void zmq::own_t::process_own (own_t *object_) { // If the object is already being shut down, new owned objects are // immediately asked to terminate. Note that linger is set to zero. if (terminating) { register_term_acks (1); send_term (object_, 0); return; } // Store the reference to the owned object. owned.insert (object_); } void zmq::own_t::terminate () { // If termination is already underway, there's no point // in starting it anew. if (terminating) return; // As for the root of the ownership tree, there's no one to terminate it, // so it has to terminate itself. if (!owner) { process_term (options.linger.load ()); return; } // If I am an owned object, I'll ask my owner to terminate me. send_term_req (owner, this); } bool zmq::own_t::is_terminating () { return terminating; } void zmq::own_t::process_term (int linger_) { // Double termination should never happen. zmq_assert (!terminating); // Send termination request to all owned objects. for (owned_t::iterator it = owned.begin (); it != owned.end (); ++it) send_term (*it, linger_); register_term_acks ((int) owned.size ()); owned.clear (); // Start termination process and check whether by chance we cannot // terminate immediately. terminating = true; check_term_acks (); } void zmq::own_t::register_term_acks (int count_) { term_acks += count_; } void zmq::own_t::unregister_term_ack () { zmq_assert (term_acks > 0); term_acks--; // This may be a last ack we are waiting for before termination... check_term_acks (); } void zmq::own_t::process_term_ack () { unregister_term_ack (); } void zmq::own_t::check_term_acks () { if (terminating && processed_seqnum == sent_seqnum.get () && term_acks == 0) { // Sanity check. There should be no active children at this point. zmq_assert (owned.empty ()); // The root object has nobody to confirm the termination to. // Other nodes will confirm the termination to the owner. if (owner) send_term_ack (owner); // Deallocate the resources. process_destroy (); } } void zmq::own_t::process_destroy () { delete this; } zeromq-4.2.5/src/mechanism.hpp0000664000372000037200000001151113255253220017203 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_MECHANISM_HPP_INCLUDED__ #define __ZMQ_MECHANISM_HPP_INCLUDED__ #include "stdint.hpp" #include "options.hpp" #include "blob.hpp" #include "metadata.hpp" namespace zmq { class msg_t; class session_base_t; // Abstract class representing security mechanism. // Different mechanism extends this class. class mechanism_t { public: enum status_t { handshaking, ready, error }; mechanism_t (const options_t &options_); virtual ~mechanism_t (); // Prepare next handshake command that is to be sent to the peer. virtual int next_handshake_command (msg_t *msg_) = 0; // Process the handshake command received from the peer. virtual int process_handshake_command (msg_t *msg_) = 0; virtual int encode (msg_t *) { return 0; } virtual int decode (msg_t *) { return 0; } // Notifies mechanism about availability of ZAP message. virtual int zap_msg_available () { return 0; } // Returns the status of this mechanism. virtual status_t status () const = 0; void set_peer_routing_id (const void *id_ptr, size_t id_size); void peer_routing_id (msg_t *msg_); void set_user_id (const void *user_id, size_t size); const blob_t &get_user_id () const; const metadata_t::dict_t &get_zmtp_properties () { return zmtp_properties; } const metadata_t::dict_t &get_zap_properties () { return zap_properties; } protected: // Only used to identify the socket for the Socket-Type // property in the wire protocol. const char *socket_type_string (int socket_type) const; static size_t add_property (unsigned char *ptr, size_t ptr_capacity, const char *name, const void *value, size_t value_len); static size_t property_len (const char *name, size_t value_len); size_t add_basic_properties (unsigned char *ptr, size_t ptr_capacity) const; size_t basic_properties_len () const; void make_command_with_basic_properties (msg_t *msg_, const char *prefix, size_t prefix_len) const; // Parses a metadata. // Metadata consists of a list of properties consisting of // name and value as size-specified strings. // Returns 0 on success and -1 on error, in which case errno is set. int parse_metadata (const unsigned char *ptr_, size_t length, bool zap_flag = false); // This is called by parse_property method whenever it // parses a new property. The function should return 0 // on success and -1 on error, in which case it should // set errno. Signaling error prevents parser from // parsing remaining data. // Derived classes are supposed to override this // method to handle custom processing. virtual int property (const std::string &name_, const void *value_, size_t length_); // Properties received from ZMTP peer. metadata_t::dict_t zmtp_properties; // Properties received from ZAP server. metadata_t::dict_t zap_properties; const options_t options; private: blob_t routing_id; blob_t user_id; // Returns true iff socket associated with the mechanism // is compatible with a given socket type 'type_'. bool check_socket_type (const char *type_, size_t len_) const; }; } #endif zeromq-4.2.5/src/router.hpp0000664000372000037200000001064713255253220016570 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_ROUTER_HPP_INCLUDED__ #define __ZMQ_ROUTER_HPP_INCLUDED__ #include #include "socket_base.hpp" #include "session_base.hpp" #include "stdint.hpp" #include "blob.hpp" #include "msg.hpp" #include "fq.hpp" namespace zmq { class ctx_t; class pipe_t; // TODO: This class uses O(n) scheduling. Rewrite it to use O(1) algorithm. class router_t : public socket_base_t { public: router_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~router_t (); // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsetsockopt (int option_, const void *optval_, size_t optvallen_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); int get_peer_state (const void *identity, size_t identity_size) const; protected: // Rollback any message parts that were sent but not yet flushed. int rollback (); const blob_t &get_credential () const; private: // Receive peer id and update lookup map bool identify_peer (pipe_t *pipe_); // Fair queueing object for inbound pipes. fq_t fq; // True iff there is a message held in the pre-fetch buffer. bool prefetched; // If true, the receiver got the message part with // the peer's identity. bool routing_id_sent; // Holds the prefetched identity. msg_t prefetched_id; // Holds the prefetched message. msg_t prefetched_msg; // The pipe we are currently reading from zmq::pipe_t *current_in; // Should current_in should be terminate after all parts received? bool terminate_current_in; // If true, more incoming message parts are expected. bool more_in; struct outpipe_t { zmq::pipe_t *pipe; bool active; }; // We keep a set of pipes that have not been identified yet. std::set anonymous_pipes; // Outbound pipes indexed by the peer IDs. typedef std::map outpipes_t; outpipes_t outpipes; // The pipe we are currently writing to. zmq::pipe_t *current_out; // If true, more outgoing message parts are expected. bool more_out; // Routing IDs are generated. It's a simple increment and wrap-over // algorithm. This value is the next ID to use (if not used already). uint32_t next_integral_routing_id; // If true, report EAGAIN to the caller instead of silently dropping // the message targeting an unknown peer. bool mandatory; bool raw_socket; // if true, send an empty message to every connected router peer bool probe_router; // If true, the router will reassign an identity upon encountering a // name collision. The new pipe will take the identity, the old pipe // will be terminated. bool handover; router_t (const router_t &); const router_t &operator= (const router_t &); }; } #endif zeromq-4.2.5/src/select.hpp0000664000372000037200000001137613255253220016527 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SELECT_HPP_INCLUDED__ #define __ZMQ_SELECT_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_SELECT #include #include #include #if defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_OPENVMS #include #include #else #include #endif #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" namespace zmq { struct i_poll_events; // Implements socket polling mechanism using POSIX.1-2001 select() // function. class select_t : public worker_poller_base_t { public: typedef fd_t handle_t; select_t (const thread_ctx_t &ctx_); ~select_t (); // "poller" concept. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void stop (); static int max_fds (); private: // Main event loop. void loop (); // Internal state. struct fds_set_t { fds_set_t (); fds_set_t (const fds_set_t &other_); fds_set_t &operator= (const fds_set_t &other_); // Convenience method to descriptor from all sets. void remove_fd (const fd_t &fd_); fd_set read; fd_set write; fd_set error; }; struct fd_entry_t { fd_t fd; zmq::i_poll_events *events; }; typedef std::vector fd_entries_t; void trigger_events (const fd_entries_t &fd_entries_, const fds_set_t &local_fds_set_, int event_count_); struct family_entry_t { family_entry_t (); fd_entries_t fd_entries; fds_set_t fds_set; bool has_retired; }; void select_family_entry (family_entry_t &family_entry_, int max_fd_, bool use_timeout_, struct timeval &tv_); #if defined ZMQ_HAVE_WINDOWS typedef std::map family_entries_t; struct wsa_events_t { wsa_events_t (); ~wsa_events_t (); // read, write, error and readwrite WSAEVENT events[4]; }; family_entries_t family_entries; // See loop for details. family_entries_t::iterator current_family_entry_it; int try_retire_fd_entry (family_entries_t::iterator family_entry_it, zmq::fd_t &handle_); static const size_t fd_family_cache_size = 8; std::pair fd_family_cache[fd_family_cache_size]; u_short get_fd_family (fd_t fd_); // Socket's family or AF_UNSPEC on error. static u_short determine_fd_family (fd_t fd_); #else // on non-Windows, we can treat all fds as one family family_entry_t family_entry; fd_t maxfd; #endif void cleanup_retired (); bool cleanup_retired (family_entry_t &family_entry_); // Checks if an fd_entry_t is retired. static bool is_retired_fd (const fd_entry_t &entry); static fd_entries_t::iterator find_fd_entry_by_handle (fd_entries_t &fd_entries, handle_t handle_); select_t (const select_t &); const select_t &operator= (const select_t &); }; typedef select_t poller_t; } #endif #endif zeromq-4.2.5/src/options.cpp0000664000372000037200000010072413255253220016732 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "options.hpp" #include "err.hpp" #include "macros.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #endif #if defined IFNAMSIZ #define BINDDEVSIZ IFNAMSIZ #else #define BINDDEVSIZ 16 #endif static int sockopt_invalid () { #if defined(ZMQ_ACT_MILITANT) zmq_assert (false); #endif errno = EINVAL; return -1; } int zmq::do_getsockopt (void *const optval_, size_t *const optvallen_, const std::string &value_) { return do_getsockopt (optval_, optvallen_, value_.c_str (), value_.size () + 1); } int zmq::do_getsockopt (void *const optval_, size_t *const optvallen_, const void *value_, const size_t value_len_) { // TODO behaviour is inconsistent with options_t::getsockopt; there, an // *exact* length match is required except for string-like (but not the // CURVE keys!) (and therefore null-ing remaining memory is a no-op, see // comment below) if (*optvallen_ < value_len_) { return sockopt_invalid (); } memcpy (optval_, value_, value_len_); // TODO why is the remaining memory null-ed? memset ((char *) optval_ + value_len_, 0, *optvallen_ - value_len_); *optvallen_ = value_len_; return 0; } #ifdef ZMQ_HAVE_CURVE static int do_getsockopt_curve_key (void *const optval_, size_t *const optvallen_, const uint8_t (&curve_key_)[CURVE_KEYSIZE]) { if (*optvallen_ == CURVE_KEYSIZE) { memcpy (optval_, curve_key_, CURVE_KEYSIZE); return 0; } else if (*optvallen_ == CURVE_KEYSIZE_Z85 + 1) { zmq_z85_encode ((char *) optval_, curve_key_, CURVE_KEYSIZE); return 0; } return sockopt_invalid (); } #endif template int do_setsockopt (const void *const optval_, const size_t optvallen_, T *const out_value_) { if (optvallen_ == sizeof (T)) { memcpy (out_value_, optval_, sizeof (T)); return 0; } return sockopt_invalid (); } int zmq::do_setsockopt_int_as_bool_strict (const void *const optval_, const size_t optvallen_, bool *const out_value_) { // TODO handling of values other than 0 or 1 is not consistent, // here it is disallowed, but for other options such as // ZMQ_ROUTER_RAW any positive value is accepted int value = -1; if (do_setsockopt (optval_, optvallen_, &value) == -1) return -1; if (value == 0 || value == 1) { *out_value_ = (value != 0); return 0; } return sockopt_invalid (); } int zmq::do_setsockopt_int_as_bool_relaxed (const void *const optval_, const size_t optvallen_, bool *const out_value_) { int value = -1; if (do_setsockopt (optval_, optvallen_, &value) == -1) return -1; *out_value_ = (value != 0); return 0; } static int do_setsockopt_string_allow_empty_strict (const void *const optval_, const size_t optvallen_, std::string *const out_value_, const size_t max_len_) { // TODO why is optval_ != NULL not allowed in case of optvallen_== 0? // TODO why are empty strings allowed for some socket options, but not for others? if (optval_ == NULL && optvallen_ == 0) { out_value_->clear (); return 0; } else if (optval_ != NULL && optvallen_ > 0 && optvallen_ <= max_len_) { out_value_->assign ((const char *) optval_, optvallen_); return 0; } return sockopt_invalid (); } static int do_setsockopt_string_allow_empty_relaxed (const void *const optval_, const size_t optvallen_, std::string *const out_value_, const size_t max_len_) { // TODO use either do_setsockopt_string_allow_empty_relaxed or // do_setsockopt_string_allow_empty_strict everywhere if (optvallen_ > 0 && optvallen_ <= max_len_) { out_value_->assign ((const char *) optval_, optvallen_); return 0; } return sockopt_invalid (); } template int do_setsockopt_set (const void *const optval_, const size_t optvallen_, std::set *const set_) { if (optvallen_ == 0 && optval_ == NULL) { set_->clear (); return 0; } else if (optvallen_ == sizeof (T) && optval_ != NULL) { set_->insert (*((const T *) optval_)); return 0; } return sockopt_invalid (); } zmq::options_t::options_t () : sndhwm (1000), rcvhwm (1000), affinity (0), routing_id_size (0), rate (100), recovery_ivl (10000), multicast_hops (1), multicast_maxtpdu (1500), sndbuf (-1), rcvbuf (-1), tos (0), type (-1), linger (-1), connect_timeout (0), tcp_maxrt (0), reconnect_ivl (100), reconnect_ivl_max (0), backlog (100), maxmsgsize (-1), rcvtimeo (-1), sndtimeo (-1), ipv6 (0), immediate (0), filter (false), invert_matching (false), recv_routing_id (false), raw_socket (false), raw_notify (true), tcp_keepalive (-1), tcp_keepalive_cnt (-1), tcp_keepalive_idle (-1), tcp_keepalive_intvl (-1), mechanism (ZMQ_NULL), as_server (0), gss_principal_nt (ZMQ_GSSAPI_NT_HOSTBASED), gss_service_principal_nt (ZMQ_GSSAPI_NT_HOSTBASED), gss_plaintext (false), socket_id (0), conflate (false), handshake_ivl (30000), connected (false), heartbeat_ttl (0), heartbeat_interval (0), heartbeat_timeout (-1), use_fd (-1), zap_enforce_domain (false), loopback_fastpath (false), zero_copy (true) { memset (curve_public_key, 0, CURVE_KEYSIZE); memset (curve_secret_key, 0, CURVE_KEYSIZE); memset (curve_server_key, 0, CURVE_KEYSIZE); #if defined ZMQ_HAVE_VMCI vmci_buffer_size = 0; vmci_buffer_min_size = 0; vmci_buffer_max_size = 0; vmci_connect_timeout = -1; #endif } int zmq::options_t::set_curve_key (uint8_t *destination, const void *optval_, size_t optvallen_) { switch (optvallen_) { case CURVE_KEYSIZE: memcpy (destination, optval_, optvallen_); mechanism = ZMQ_CURVE; return 0; case CURVE_KEYSIZE_Z85 + 1: if (zmq_z85_decode (destination, (char *) optval_)) { mechanism = ZMQ_CURVE; return 0; } break; case CURVE_KEYSIZE_Z85: char z85_key[CURVE_KEYSIZE_Z85 + 1]; memcpy (z85_key, (char *) optval_, optvallen_); z85_key[CURVE_KEYSIZE_Z85] = 0; if (zmq_z85_decode (destination, z85_key)) { mechanism = ZMQ_CURVE; return 0; } break; default: break; } return -1; } int zmq::options_t::setsockopt (int option_, const void *optval_, size_t optvallen_) { bool is_int = (optvallen_ == sizeof (int)); int value = 0; if (is_int) memcpy (&value, optval_, sizeof (int)); #if defined(ZMQ_ACT_MILITANT) bool malformed = true; // Did caller pass a bad option value? #endif switch (option_) { case ZMQ_SNDHWM: if (is_int && value >= 0) { sndhwm = value; return 0; } break; case ZMQ_RCVHWM: if (is_int && value >= 0) { rcvhwm = value; return 0; } break; case ZMQ_AFFINITY: return do_setsockopt (optval_, optvallen_, &affinity); case ZMQ_ROUTING_ID: // Routing id is any binary string from 1 to 255 octets if (optvallen_ > 0 && optvallen_ < 256) { routing_id_size = (unsigned char) optvallen_; memcpy (routing_id, optval_, routing_id_size); return 0; } break; case ZMQ_RATE: if (is_int && value > 0) { rate = value; return 0; } break; case ZMQ_RECOVERY_IVL: if (is_int && value >= 0) { recovery_ivl = value; return 0; } break; case ZMQ_SNDBUF: if (is_int && value >= -1) { sndbuf = value; return 0; } break; case ZMQ_RCVBUF: if (is_int && value >= -1) { rcvbuf = value; return 0; } break; case ZMQ_TOS: if (is_int && value >= 0) { tos = value; return 0; } break; case ZMQ_LINGER: if (is_int && value >= -1) { linger.store (value); return 0; } break; case ZMQ_CONNECT_TIMEOUT: if (is_int && value >= 0) { connect_timeout = value; return 0; } break; case ZMQ_TCP_MAXRT: if (is_int && value >= 0) { tcp_maxrt = value; return 0; } break; case ZMQ_RECONNECT_IVL: if (is_int && value >= -1) { reconnect_ivl = value; return 0; } break; case ZMQ_RECONNECT_IVL_MAX: if (is_int && value >= 0) { reconnect_ivl_max = value; return 0; } break; case ZMQ_BACKLOG: if (is_int && value >= 0) { backlog = value; return 0; } break; case ZMQ_MAXMSGSIZE: return do_setsockopt (optval_, optvallen_, &maxmsgsize); case ZMQ_MULTICAST_HOPS: if (is_int && value > 0) { multicast_hops = value; return 0; } break; case ZMQ_MULTICAST_MAXTPDU: if (is_int && value > 0) { multicast_maxtpdu = value; return 0; } break; case ZMQ_RCVTIMEO: if (is_int && value >= -1) { rcvtimeo = value; return 0; } break; case ZMQ_SNDTIMEO: if (is_int && value >= -1) { sndtimeo = value; return 0; } break; /* Deprecated in favor of ZMQ_IPV6 */ case ZMQ_IPV4ONLY: { bool value; int rc = do_setsockopt_int_as_bool_strict (optval_, optvallen_, &value); if (rc == 0) ipv6 = !value; return rc; } /* To replace the somewhat surprising IPV4ONLY */ case ZMQ_IPV6: return do_setsockopt_int_as_bool_strict (optval_, optvallen_, &ipv6); case ZMQ_SOCKS_PROXY: return do_setsockopt_string_allow_empty_strict ( optval_, optvallen_, &socks_proxy_address, SIZE_MAX); case ZMQ_TCP_KEEPALIVE: if (is_int && (value == -1 || value == 0 || value == 1)) { tcp_keepalive = value; return 0; } break; case ZMQ_TCP_KEEPALIVE_CNT: if (is_int && (value == -1 || value >= 0)) { tcp_keepalive_cnt = value; return 0; } break; case ZMQ_TCP_KEEPALIVE_IDLE: if (is_int && (value == -1 || value >= 0)) { tcp_keepalive_idle = value; return 0; } break; case ZMQ_TCP_KEEPALIVE_INTVL: if (is_int && (value == -1 || value >= 0)) { tcp_keepalive_intvl = value; return 0; } break; case ZMQ_IMMEDIATE: // TODO why is immediate not bool (and called non_immediate, as its meaning appears to be reversed) if (is_int && (value == 0 || value == 1)) { immediate = value; return 0; } break; case ZMQ_TCP_ACCEPT_FILTER: { std::string filter_str; int rc = do_setsockopt_string_allow_empty_strict ( optval_, optvallen_, &filter_str, 255); if (rc == 0) { if (filter_str.empty ()) { tcp_accept_filters.clear (); } else { tcp_address_mask_t mask; rc = mask.resolve (filter_str.c_str (), ipv6); if (rc == 0) { tcp_accept_filters.push_back (mask); } } } return rc; } #if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED case ZMQ_IPC_FILTER_UID: return do_setsockopt_set (optval_, optvallen_, &ipc_uid_accept_filters); case ZMQ_IPC_FILTER_GID: return do_setsockopt_set (optval_, optvallen_, &ipc_gid_accept_filters); #endif #if defined ZMQ_HAVE_SO_PEERCRED case ZMQ_IPC_FILTER_PID: return do_setsockopt_set (optval_, optvallen_, &ipc_pid_accept_filters); #endif case ZMQ_PLAIN_SERVER: if (is_int && (value == 0 || value == 1)) { as_server = value; mechanism = value ? ZMQ_PLAIN : ZMQ_NULL; return 0; } break; case ZMQ_PLAIN_USERNAME: if (optvallen_ == 0 && optval_ == NULL) { mechanism = ZMQ_NULL; return 0; } else if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { plain_username.assign ((const char *) optval_, optvallen_); as_server = 0; mechanism = ZMQ_PLAIN; return 0; } break; case ZMQ_PLAIN_PASSWORD: if (optvallen_ == 0 && optval_ == NULL) { mechanism = ZMQ_NULL; return 0; } else if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { plain_password.assign ((const char *) optval_, optvallen_); as_server = 0; mechanism = ZMQ_PLAIN; return 0; } break; case ZMQ_ZAP_DOMAIN: return do_setsockopt_string_allow_empty_relaxed ( optval_, optvallen_, &zap_domain, 255); break; // If curve encryption isn't built, these options provoke EINVAL #ifdef ZMQ_HAVE_CURVE case ZMQ_CURVE_SERVER: if (is_int && (value == 0 || value == 1)) { as_server = value; mechanism = value ? ZMQ_CURVE : ZMQ_NULL; return 0; } break; case ZMQ_CURVE_PUBLICKEY: if (0 == set_curve_key (curve_public_key, optval_, optvallen_)) { return 0; } break; case ZMQ_CURVE_SECRETKEY: if (0 == set_curve_key (curve_secret_key, optval_, optvallen_)) { return 0; } break; case ZMQ_CURVE_SERVERKEY: if (0 == set_curve_key (curve_server_key, optval_, optvallen_)) { as_server = 0; return 0; } break; #endif case ZMQ_CONFLATE: return do_setsockopt_int_as_bool_strict (optval_, optvallen_, &conflate); // If libgssapi isn't installed, these options provoke EINVAL #ifdef HAVE_LIBGSSAPI_KRB5 case ZMQ_GSSAPI_SERVER: if (is_int && (value == 0 || value == 1)) { as_server = value; mechanism = ZMQ_GSSAPI; return 0; } break; case ZMQ_GSSAPI_PRINCIPAL: if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { gss_principal.assign ((const char *) optval_, optvallen_); mechanism = ZMQ_GSSAPI; return 0; } break; case ZMQ_GSSAPI_SERVICE_PRINCIPAL: if (optvallen_ > 0 && optvallen_ < 256 && optval_ != NULL) { gss_service_principal.assign ((const char *) optval_, optvallen_); mechanism = ZMQ_GSSAPI; as_server = 0; return 0; } break; case ZMQ_GSSAPI_PLAINTEXT: return do_setsockopt_int_as_bool_strict (optval_, optvallen_, &gss_plaintext); case ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: if (is_int && (value == ZMQ_GSSAPI_NT_HOSTBASED || value == ZMQ_GSSAPI_NT_USER_NAME || value == ZMQ_GSSAPI_NT_KRB5_PRINCIPAL)) { gss_principal_nt = value; return 0; } break; case ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: if (is_int && (value == ZMQ_GSSAPI_NT_HOSTBASED || value == ZMQ_GSSAPI_NT_USER_NAME || value == ZMQ_GSSAPI_NT_KRB5_PRINCIPAL)) { gss_service_principal_nt = value; return 0; } break; #endif case ZMQ_HANDSHAKE_IVL: if (is_int && value >= 0) { handshake_ivl = value; return 0; } break; case ZMQ_INVERT_MATCHING: return do_setsockopt_int_as_bool_relaxed (optval_, optvallen_, &invert_matching); case ZMQ_HEARTBEAT_IVL: if (is_int && value >= 0) { heartbeat_interval = value; return 0; } break; case ZMQ_HEARTBEAT_TTL: // Convert this to deciseconds from milliseconds value = value / 100; if (is_int && value >= 0 && value <= 6553) { heartbeat_ttl = (uint16_t) value; return 0; } break; case ZMQ_HEARTBEAT_TIMEOUT: if (is_int && value >= 0) { heartbeat_timeout = value; return 0; } break; #ifdef ZMQ_HAVE_VMCI case ZMQ_VMCI_BUFFER_SIZE: return do_setsockopt (optval_, optvallen_, &vmci_buffer_size); case ZMQ_VMCI_BUFFER_MIN_SIZE: return do_setsockopt (optval_, optvallen_, &vmci_buffer_min_size); case ZMQ_VMCI_BUFFER_MAX_SIZE: return do_setsockopt (optval_, optvallen_, &vmci_buffer_max_size); case ZMQ_VMCI_CONNECT_TIMEOUT: return do_setsockopt (optval_, optvallen_, &vmci_connect_timeout); #endif case ZMQ_USE_FD: if (is_int && value >= -1) { use_fd = value; return 0; } break; case ZMQ_BINDTODEVICE: return do_setsockopt_string_allow_empty_strict ( optval_, optvallen_, &bound_device, BINDDEVSIZ); case ZMQ_ZAP_ENFORCE_DOMAIN: return do_setsockopt_int_as_bool_relaxed (optval_, optvallen_, &zap_enforce_domain); case ZMQ_LOOPBACK_FASTPATH: return do_setsockopt_int_as_bool_relaxed (optval_, optvallen_, &loopback_fastpath); case ZMQ_METADATA: if (optvallen_ > 0 && !is_int) { std::string s ((char *) optval_); size_t pos = 0; std::string key, val, delimiter = ":"; pos = s.find (delimiter); if (pos != std::string::npos && pos != 0 && pos != s.length () - 1) { key = s.substr (0, pos); if (key.compare (0, 2, "X-") == 0 && key.length () < 256) { val = s.substr (pos + 1, s.length ()); app_metadata.insert ( std::pair (key, val)); return 0; } } } errno = EINVAL; return -1; break; default: #if defined(ZMQ_ACT_MILITANT) // There are valid scenarios for probing with unknown socket option // values, e.g. to check if security is enabled or not. This will not // provoke a militant assert. However, passing bad values to a valid // socket option will, if ZMQ_ACT_MILITANT is defined. malformed = false; #endif break; } // TODO mechanism should either be set explicitly, or determined when // connecting. currently, it depends on the order of setsockopt calls // if there is some inconsistency, which is confusing. in addition, // the assumed or set mechanism should be queryable (as a socket option) #if defined(ZMQ_ACT_MILITANT) // There is no valid use case for passing an error back to the application // when it sent malformed arguments to a socket option. Use ./configure // --with-militant to enable this checking. if (malformed) zmq_assert (false); #endif errno = EINVAL; return -1; } int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_) const { bool is_int = (*optvallen_ == sizeof (int)); int *value = (int *) optval_; #if defined(ZMQ_ACT_MILITANT) bool malformed = true; // Did caller pass a bad option value? #endif switch (option_) { case ZMQ_SNDHWM: if (is_int) { *value = sndhwm; return 0; } break; case ZMQ_RCVHWM: if (is_int) { *value = rcvhwm; return 0; } break; case ZMQ_AFFINITY: if (*optvallen_ == sizeof (uint64_t)) { *((uint64_t *) optval_) = affinity; return 0; } break; case ZMQ_ROUTING_ID: return do_getsockopt (optval_, optvallen_, routing_id, routing_id_size); break; case ZMQ_RATE: if (is_int) { *value = rate; return 0; } break; case ZMQ_RECOVERY_IVL: if (is_int) { *value = recovery_ivl; return 0; } break; case ZMQ_SNDBUF: if (is_int) { *value = sndbuf; return 0; } break; case ZMQ_RCVBUF: if (is_int) { *value = rcvbuf; return 0; } break; case ZMQ_TOS: if (is_int) { *value = tos; return 0; } break; case ZMQ_TYPE: if (is_int) { *value = type; return 0; } break; case ZMQ_LINGER: if (is_int) { *value = linger.load (); return 0; } break; case ZMQ_CONNECT_TIMEOUT: if (is_int) { *value = connect_timeout; return 0; } break; case ZMQ_TCP_MAXRT: if (is_int) { *value = tcp_maxrt; return 0; } break; case ZMQ_RECONNECT_IVL: if (is_int) { *value = reconnect_ivl; return 0; } break; case ZMQ_RECONNECT_IVL_MAX: if (is_int) { *value = reconnect_ivl_max; return 0; } break; case ZMQ_BACKLOG: if (is_int) { *value = backlog; return 0; } break; case ZMQ_MAXMSGSIZE: if (*optvallen_ == sizeof (int64_t)) { *((int64_t *) optval_) = maxmsgsize; *optvallen_ = sizeof (int64_t); return 0; } break; case ZMQ_MULTICAST_HOPS: if (is_int) { *value = multicast_hops; return 0; } break; case ZMQ_MULTICAST_MAXTPDU: if (is_int) { *value = multicast_maxtpdu; return 0; } break; case ZMQ_RCVTIMEO: if (is_int) { *value = rcvtimeo; return 0; } break; case ZMQ_SNDTIMEO: if (is_int) { *value = sndtimeo; return 0; } break; case ZMQ_IPV4ONLY: if (is_int) { *value = 1 - ipv6; return 0; } break; case ZMQ_IPV6: if (is_int) { *value = ipv6; return 0; } break; case ZMQ_IMMEDIATE: if (is_int) { *value = immediate; return 0; } break; case ZMQ_SOCKS_PROXY: return do_getsockopt (optval_, optvallen_, socks_proxy_address); break; case ZMQ_TCP_KEEPALIVE: if (is_int) { *value = tcp_keepalive; return 0; } break; case ZMQ_TCP_KEEPALIVE_CNT: if (is_int) { *value = tcp_keepalive_cnt; return 0; } break; case ZMQ_TCP_KEEPALIVE_IDLE: if (is_int) { *value = tcp_keepalive_idle; return 0; } break; case ZMQ_TCP_KEEPALIVE_INTVL: if (is_int) { *value = tcp_keepalive_intvl; return 0; } break; case ZMQ_MECHANISM: if (is_int) { *value = mechanism; return 0; } break; case ZMQ_PLAIN_SERVER: if (is_int) { *value = as_server && mechanism == ZMQ_PLAIN; return 0; } break; case ZMQ_PLAIN_USERNAME: return do_getsockopt (optval_, optvallen_, plain_username); break; case ZMQ_PLAIN_PASSWORD: return do_getsockopt (optval_, optvallen_, plain_password); break; case ZMQ_ZAP_DOMAIN: return do_getsockopt (optval_, optvallen_, zap_domain); break; // If curve encryption isn't built, these options provoke EINVAL #ifdef ZMQ_HAVE_CURVE case ZMQ_CURVE_SERVER: if (is_int) { *value = as_server && mechanism == ZMQ_CURVE; return 0; } break; case ZMQ_CURVE_PUBLICKEY: return do_getsockopt_curve_key (optval_, optvallen_, curve_public_key); break; case ZMQ_CURVE_SECRETKEY: return do_getsockopt_curve_key (optval_, optvallen_, curve_secret_key); break; case ZMQ_CURVE_SERVERKEY: return do_getsockopt_curve_key (optval_, optvallen_, curve_server_key); break; #endif case ZMQ_CONFLATE: if (is_int) { *value = conflate; return 0; } break; // If libgssapi isn't installed, these options provoke EINVAL #ifdef HAVE_LIBGSSAPI_KRB5 case ZMQ_GSSAPI_SERVER: if (is_int) { *value = as_server && mechanism == ZMQ_GSSAPI; return 0; } break; case ZMQ_GSSAPI_PRINCIPAL: return do_getsockopt (optval_, optvallen_, gss_principal); break; case ZMQ_GSSAPI_SERVICE_PRINCIPAL: return do_getsockopt (optval_, optvallen_, gss_service_principal); break; case ZMQ_GSSAPI_PLAINTEXT: if (is_int) { *value = gss_plaintext; return 0; } break; case ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: if (is_int) { *value = gss_principal_nt; return 0; } break; case ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: if (is_int) { *value = gss_service_principal_nt; return 0; } break; #endif case ZMQ_HANDSHAKE_IVL: if (is_int) { *value = handshake_ivl; return 0; } break; case ZMQ_INVERT_MATCHING: if (is_int) { *value = invert_matching; return 0; } break; case ZMQ_HEARTBEAT_IVL: if (is_int) { *value = heartbeat_interval; return 0; } break; case ZMQ_HEARTBEAT_TTL: if (is_int) { // Convert the internal deciseconds value to milliseconds *value = heartbeat_ttl * 100; return 0; } break; case ZMQ_HEARTBEAT_TIMEOUT: if (is_int) { *value = heartbeat_timeout; return 0; } break; case ZMQ_USE_FD: if (is_int) { *value = use_fd; return 0; } break; case ZMQ_BINDTODEVICE: return do_getsockopt (optval_, optvallen_, bound_device); break; case ZMQ_ZAP_ENFORCE_DOMAIN: if (is_int) { *value = zap_enforce_domain; return 0; } break; case ZMQ_LOOPBACK_FASTPATH: if (is_int) { *value = loopback_fastpath; return 0; } break; default: #if defined(ZMQ_ACT_MILITANT) malformed = false; #endif break; } #if defined(ZMQ_ACT_MILITANT) if (malformed) zmq_assert (false); #endif errno = EINVAL; return -1; } bool zmq::options_t::is_valid (int option_) const { LIBZMQ_UNUSED (option_); return true; } zeromq-4.2.5/src/stream_engine.cpp0000664000372000037200000010216513255253220020060 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include #ifndef ZMQ_HAVE_WINDOWS #include #endif #include #include #include "stream_engine.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "v1_encoder.hpp" #include "v1_decoder.hpp" #include "v2_encoder.hpp" #include "v2_decoder.hpp" #include "null_mechanism.hpp" #include "plain_client.hpp" #include "plain_server.hpp" #include "gssapi_client.hpp" #include "gssapi_server.hpp" #include "curve_client.hpp" #include "curve_server.hpp" #include "raw_decoder.hpp" #include "raw_encoder.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" #include "tcp.hpp" #include "likely.hpp" #include "wire.hpp" zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_, const std::string &endpoint_) : s (fd_), as_server (false), handle ((handle_t) NULL), inpos (NULL), insize (0), decoder (NULL), outpos (NULL), outsize (0), encoder (NULL), metadata (NULL), handshaking (true), greeting_size (v2_greeting_size), greeting_bytes_read (0), session (NULL), options (options_), endpoint (endpoint_), plugged (false), next_msg (&stream_engine_t::routing_id_msg), process_msg (&stream_engine_t::process_routing_id_msg), io_error (false), subscription_required (false), mechanism (NULL), input_stopped (false), output_stopped (false), has_handshake_timer (false), has_ttl_timer (false), has_timeout_timer (false), has_heartbeat_timer (false), heartbeat_timeout (0), socket (NULL) { int rc = tx_msg.init (); errno_assert (rc == 0); // Put the socket into non-blocking mode. unblock_socket (s); int family = get_peer_ip_address (s, peer_address); if (family == 0) peer_address.clear (); #if defined ZMQ_HAVE_SO_PEERCRED else if (family == PF_UNIX) { struct ucred cred; socklen_t size = sizeof (cred); if (!getsockopt (s, SOL_SOCKET, SO_PEERCRED, &cred, &size)) { std::ostringstream buf; buf << ":" << cred.uid << ":" << cred.gid << ":" << cred.pid; peer_address += buf.str (); } } #elif defined ZMQ_HAVE_LOCAL_PEERCRED else if (family == PF_UNIX) { struct xucred cred; socklen_t size = sizeof (cred); if (!getsockopt (s, 0, LOCAL_PEERCRED, &cred, &size) && cred.cr_version == XUCRED_VERSION) { std::ostringstream buf; buf << ":" << cred.cr_uid << ":"; if (cred.cr_ngroups > 0) buf << cred.cr_groups[0]; buf << ":"; peer_address += buf.str (); } } #endif if (options.heartbeat_interval > 0) { heartbeat_timeout = options.heartbeat_timeout; if (heartbeat_timeout == -1) heartbeat_timeout = options.heartbeat_interval; } } zmq::stream_engine_t::~stream_engine_t () { zmq_assert (!plugged); if (s != retired_fd) { #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else int rc = close (s); #if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) // FreeBSD may return ECONNRESET on close() under load but this is not // an error. if (rc == -1 && errno == ECONNRESET) rc = 0; #endif errno_assert (rc == 0); #endif s = retired_fd; } int rc = tx_msg.close (); errno_assert (rc == 0); // Drop reference to metadata and destroy it if we are // the only user. if (metadata != NULL) { if (metadata->drop_ref ()) { LIBZMQ_DELETE (metadata); } } LIBZMQ_DELETE (encoder); LIBZMQ_DELETE (decoder); LIBZMQ_DELETE (mechanism); } void zmq::stream_engine_t::plug (io_thread_t *io_thread_, session_base_t *session_) { zmq_assert (!plugged); plugged = true; // Connect to session object. zmq_assert (!session); zmq_assert (session_); session = session_; socket = session->get_socket (); // Connect to I/O threads poller object. io_object_t::plug (io_thread_); handle = add_fd (s); io_error = false; if (options.raw_socket) { // no handshaking for raw sock, instantiate raw encoder and decoders encoder = new (std::nothrow) raw_encoder_t (out_batch_size); alloc_assert (encoder); decoder = new (std::nothrow) raw_decoder_t (in_batch_size); alloc_assert (decoder); // disable handshaking for raw socket handshaking = false; next_msg = &stream_engine_t::pull_msg_from_session; process_msg = &stream_engine_t::push_raw_msg_to_session; properties_t properties; if (init_properties (properties)) { // Compile metadata. zmq_assert (metadata == NULL); metadata = new (std::nothrow) metadata_t (properties); alloc_assert (metadata); } if (options.raw_notify) { // For raw sockets, send an initial 0-length message to the // application so that it knows a peer has connected. msg_t connector; connector.init (); push_raw_msg_to_session (&connector); connector.close (); session->flush (); } } else { // start optional timer, to prevent handshake hanging on no input set_handshake_timer (); // Send the 'length' and 'flags' fields of the routing id message. // The 'length' field is encoded in the long format. outpos = greeting_send; outpos[outsize++] = 0xff; put_uint64 (&outpos[outsize], options.routing_id_size + 1); outsize += 8; outpos[outsize++] = 0x7f; } set_pollin (handle); set_pollout (handle); // Flush all the data that may have been already received downstream. in_event (); } void zmq::stream_engine_t::unplug () { zmq_assert (plugged); plugged = false; // Cancel all timers. if (has_handshake_timer) { cancel_timer (handshake_timer_id); has_handshake_timer = false; } if (has_ttl_timer) { cancel_timer (heartbeat_ttl_timer_id); has_ttl_timer = false; } if (has_timeout_timer) { cancel_timer (heartbeat_timeout_timer_id); has_timeout_timer = false; } if (has_heartbeat_timer) { cancel_timer (heartbeat_ivl_timer_id); has_heartbeat_timer = false; } // Cancel all fd subscriptions. if (!io_error) rm_fd (handle); // Disconnect from I/O threads poller object. io_object_t::unplug (); session = NULL; } void zmq::stream_engine_t::terminate () { unplug (); delete this; } void zmq::stream_engine_t::in_event () { zmq_assert (!io_error); // If still handshaking, receive and process the greeting message. if (unlikely (handshaking)) if (!handshake ()) return; zmq_assert (decoder); // If there has been an I/O error, stop polling. if (input_stopped) { rm_fd (handle); io_error = true; return; } // If there's no data to process in the buffer... if (!insize) { // Retrieve the buffer and read as much data as possible. // Note that buffer can be arbitrarily large. However, we assume // the underlying TCP layer has fixed buffer size and thus the // number of bytes read will be always limited. size_t bufsize = 0; decoder->get_buffer (&inpos, &bufsize); const int rc = tcp_read (s, inpos, bufsize); if (rc == 0) { // connection closed by peer errno = EPIPE; error (connection_error); return; } if (rc == -1) { if (errno != EAGAIN) error (connection_error); return; } // Adjust input size insize = static_cast (rc); // Adjust buffer size to received bytes decoder->resize_buffer (insize); } int rc = 0; size_t processed = 0; while (insize > 0) { rc = decoder->decode (inpos, insize, processed); zmq_assert (processed <= insize); inpos += processed; insize -= processed; if (rc == 0 || rc == -1) break; rc = (this->*process_msg) (decoder->msg ()); if (rc == -1) break; } // Tear down the connection if we have failed to decode input data // or the session has rejected the message. if (rc == -1) { if (errno != EAGAIN) { error (protocol_error); return; } input_stopped = true; reset_pollin (handle); } session->flush (); } void zmq::stream_engine_t::out_event () { zmq_assert (!io_error); // If write buffer is empty, try to read new data from the encoder. if (!outsize) { // Even when we stop polling as soon as there is no // data to send, the poller may invoke out_event one // more time due to 'speculative write' optimisation. if (unlikely (encoder == NULL)) { zmq_assert (handshaking); return; } outpos = NULL; outsize = encoder->encode (&outpos, 0); while (outsize < (size_t) out_batch_size) { if ((this->*next_msg) (&tx_msg) == -1) break; encoder->load_msg (&tx_msg); unsigned char *bufptr = outpos + outsize; size_t n = encoder->encode (&bufptr, out_batch_size - outsize); zmq_assert (n > 0); if (outpos == NULL) outpos = bufptr; outsize += n; } // If there is no data to send, stop polling for output. if (outsize == 0) { output_stopped = true; reset_pollout (handle); return; } } // If there are any data to write in write buffer, write as much as // possible to the socket. Note that amount of data to write can be // arbitrarily large. However, we assume that underlying TCP layer has // limited transmission buffer and thus the actual number of bytes // written should be reasonably modest. const int nbytes = tcp_write (s, outpos, outsize); // IO error has occurred. We stop waiting for output events. // The engine is not terminated until we detect input error; // this is necessary to prevent losing incoming messages. if (nbytes == -1) { reset_pollout (handle); return; } outpos += nbytes; outsize -= nbytes; // If we are still handshaking and there are no data // to send, stop polling for output. if (unlikely (handshaking)) if (outsize == 0) reset_pollout (handle); } void zmq::stream_engine_t::restart_output () { if (unlikely (io_error)) return; if (likely (output_stopped)) { set_pollout (handle); output_stopped = false; } // Speculative write: The assumption is that at the moment new message // was sent by the user the socket is probably available for writing. // Thus we try to write the data to socket avoiding polling for POLLOUT. // Consequently, the latency should be better in request/reply scenarios. out_event (); } void zmq::stream_engine_t::restart_input () { zmq_assert (input_stopped); zmq_assert (session != NULL); zmq_assert (decoder != NULL); int rc = (this->*process_msg) (decoder->msg ()); if (rc == -1) { if (errno == EAGAIN) session->flush (); else error (protocol_error); return; } while (insize > 0) { size_t processed = 0; rc = decoder->decode (inpos, insize, processed); zmq_assert (processed <= insize); inpos += processed; insize -= processed; if (rc == 0 || rc == -1) break; rc = (this->*process_msg) (decoder->msg ()); if (rc == -1) break; } if (rc == -1 && errno == EAGAIN) session->flush (); else if (io_error) error (connection_error); else if (rc == -1) error (protocol_error); else { input_stopped = false; set_pollin (handle); session->flush (); // Speculative read. in_event (); } } bool zmq::stream_engine_t::handshake () { zmq_assert (handshaking); zmq_assert (greeting_bytes_read < greeting_size); // Receive the greeting. while (greeting_bytes_read < greeting_size) { const int n = tcp_read (s, greeting_recv + greeting_bytes_read, greeting_size - greeting_bytes_read); if (n == 0) { errno = EPIPE; error (connection_error); return false; } if (n == -1) { if (errno != EAGAIN) error (connection_error); return false; } greeting_bytes_read += n; // We have received at least one byte from the peer. // If the first byte is not 0xff, we know that the // peer is using unversioned protocol. if (greeting_recv[0] != 0xff) break; if (greeting_bytes_read < signature_size) continue; // Inspect the right-most bit of the 10th byte (which coincides // with the 'flags' field if a regular message was sent). // Zero indicates this is a header of a routing id message // (i.e. the peer is using the unversioned protocol). if (!(greeting_recv[9] & 0x01)) break; // The peer is using versioned protocol. // Send the major version number. if (outpos + outsize == greeting_send + signature_size) { if (outsize == 0) set_pollout (handle); outpos[outsize++] = 3; // Major version number } if (greeting_bytes_read > signature_size) { if (outpos + outsize == greeting_send + signature_size + 1) { if (outsize == 0) set_pollout (handle); // Use ZMTP/2.0 to talk to older peers. if (greeting_recv[10] == ZMTP_1_0 || greeting_recv[10] == ZMTP_2_0) outpos[outsize++] = options.type; else { outpos[outsize++] = 0; // Minor version number memset (outpos + outsize, 0, 20); zmq_assert (options.mechanism == ZMQ_NULL || options.mechanism == ZMQ_PLAIN || options.mechanism == ZMQ_CURVE || options.mechanism == ZMQ_GSSAPI); if (options.mechanism == ZMQ_NULL) memcpy (outpos + outsize, "NULL", 4); else if (options.mechanism == ZMQ_PLAIN) memcpy (outpos + outsize, "PLAIN", 5); else if (options.mechanism == ZMQ_GSSAPI) memcpy (outpos + outsize, "GSSAPI", 6); else if (options.mechanism == ZMQ_CURVE) memcpy (outpos + outsize, "CURVE", 5); outsize += 20; memset (outpos + outsize, 0, 32); outsize += 32; greeting_size = v3_greeting_size; } } } } // Position of the revision field in the greeting. const size_t revision_pos = 10; // Is the peer using ZMTP/1.0 with no revision number? // If so, we send and receive rest of routing id message if (greeting_recv[0] != 0xff || !(greeting_recv[9] & 0x01)) { if (session->zap_enabled ()) { // reject ZMTP 1.0 connections if ZAP is enabled error (protocol_error); return false; } encoder = new (std::nothrow) v1_encoder_t (out_batch_size); alloc_assert (encoder); decoder = new (std::nothrow) v1_decoder_t (in_batch_size, options.maxmsgsize); alloc_assert (decoder); // We have already sent the message header. // Since there is no way to tell the encoder to // skip the message header, we simply throw that // header data away. const size_t header_size = options.routing_id_size + 1 >= 255 ? 10 : 2; unsigned char tmp[10], *bufferp = tmp; // Prepare the routing id message and load it into encoder. // Then consume bytes we have already sent to the peer. const int rc = tx_msg.init_size (options.routing_id_size); zmq_assert (rc == 0); memcpy (tx_msg.data (), options.routing_id, options.routing_id_size); encoder->load_msg (&tx_msg); size_t buffer_size = encoder->encode (&bufferp, header_size); zmq_assert (buffer_size == header_size); // Make sure the decoder sees the data we have already received. inpos = greeting_recv; insize = greeting_bytes_read; // To allow for interoperability with peers that do not forward // their subscriptions, we inject a phantom subscription message // message into the incoming message stream. if (options.type == ZMQ_PUB || options.type == ZMQ_XPUB) subscription_required = true; // We are sending our routing id now and the next message // will come from the socket. next_msg = &stream_engine_t::pull_msg_from_session; // We are expecting routing id message. process_msg = &stream_engine_t::process_routing_id_msg; } else if (greeting_recv[revision_pos] == ZMTP_1_0) { if (session->zap_enabled ()) { // reject ZMTP 1.0 connections if ZAP is enabled error (protocol_error); return false; } encoder = new (std::nothrow) v1_encoder_t (out_batch_size); alloc_assert (encoder); decoder = new (std::nothrow) v1_decoder_t (in_batch_size, options.maxmsgsize); alloc_assert (decoder); } else if (greeting_recv[revision_pos] == ZMTP_2_0) { if (session->zap_enabled ()) { // reject ZMTP 2.0 connections if ZAP is enabled error (protocol_error); return false; } encoder = new (std::nothrow) v2_encoder_t (out_batch_size); alloc_assert (encoder); decoder = new (std::nothrow) v2_decoder_t (in_batch_size, options.maxmsgsize, options.zero_copy); alloc_assert (decoder); } else { encoder = new (std::nothrow) v2_encoder_t (out_batch_size); alloc_assert (encoder); decoder = new (std::nothrow) v2_decoder_t (in_batch_size, options.maxmsgsize, options.zero_copy); alloc_assert (decoder); if (options.mechanism == ZMQ_NULL && memcmp (greeting_recv + 12, "NULL\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) { mechanism = new (std::nothrow) null_mechanism_t (session, peer_address, options); alloc_assert (mechanism); } else if (options.mechanism == ZMQ_PLAIN && memcmp (greeting_recv + 12, "PLAIN\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) { if (options.as_server) mechanism = new (std::nothrow) plain_server_t (session, peer_address, options); else mechanism = new (std::nothrow) plain_client_t (session, options); alloc_assert (mechanism); } #ifdef ZMQ_HAVE_CURVE else if (options.mechanism == ZMQ_CURVE && memcmp (greeting_recv + 12, "CURVE\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) { if (options.as_server) mechanism = new (std::nothrow) curve_server_t (session, peer_address, options); else mechanism = new (std::nothrow) curve_client_t (session, options); alloc_assert (mechanism); } #endif #ifdef HAVE_LIBGSSAPI_KRB5 else if (options.mechanism == ZMQ_GSSAPI && memcmp (greeting_recv + 12, "GSSAPI\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) == 0) { if (options.as_server) mechanism = new (std::nothrow) gssapi_server_t (session, peer_address, options); else mechanism = new (std::nothrow) gssapi_client_t (session, options); alloc_assert (mechanism); } #endif else { session->get_socket ()->event_handshake_failed_protocol ( session->get_endpoint (), ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH); error (protocol_error); return false; } next_msg = &stream_engine_t::next_handshake_command; process_msg = &stream_engine_t::process_handshake_command; } // Start polling for output if necessary. if (outsize == 0) set_pollout (handle); // Handshaking was successful. // Switch into the normal message flow. handshaking = false; if (has_handshake_timer) { cancel_timer (handshake_timer_id); has_handshake_timer = false; } return true; } int zmq::stream_engine_t::routing_id_msg (msg_t *msg_) { int rc = msg_->init_size (options.routing_id_size); errno_assert (rc == 0); if (options.routing_id_size > 0) memcpy (msg_->data (), options.routing_id, options.routing_id_size); next_msg = &stream_engine_t::pull_msg_from_session; return 0; } int zmq::stream_engine_t::process_routing_id_msg (msg_t *msg_) { if (options.recv_routing_id) { msg_->set_flags (msg_t::routing_id); int rc = session->push_msg (msg_); errno_assert (rc == 0); } else { int rc = msg_->close (); errno_assert (rc == 0); rc = msg_->init (); errno_assert (rc == 0); } if (subscription_required) { msg_t subscription; // Inject the subscription message, so that also // ZMQ 2.x peers receive published messages. int rc = subscription.init_size (1); errno_assert (rc == 0); *(unsigned char *) subscription.data () = 1; rc = session->push_msg (&subscription); errno_assert (rc == 0); } process_msg = &stream_engine_t::push_msg_to_session; return 0; } int zmq::stream_engine_t::next_handshake_command (msg_t *msg_) { zmq_assert (mechanism != NULL); if (mechanism->status () == mechanism_t::ready) { mechanism_ready (); return pull_and_encode (msg_); } else if (mechanism->status () == mechanism_t::error) { errno = EPROTO; return -1; } else { const int rc = mechanism->next_handshake_command (msg_); if (rc == 0) msg_->set_flags (msg_t::command); return rc; } } int zmq::stream_engine_t::process_handshake_command (msg_t *msg_) { zmq_assert (mechanism != NULL); const int rc = mechanism->process_handshake_command (msg_); if (rc == 0) { if (mechanism->status () == mechanism_t::ready) mechanism_ready (); else if (mechanism->status () == mechanism_t::error) { errno = EPROTO; return -1; } if (output_stopped) restart_output (); } return rc; } void zmq::stream_engine_t::zap_msg_available () { zmq_assert (mechanism != NULL); const int rc = mechanism->zap_msg_available (); if (rc == -1) { error (protocol_error); return; } if (input_stopped) restart_input (); if (output_stopped) restart_output (); } const char *zmq::stream_engine_t::get_endpoint () const { return endpoint.c_str (); } void zmq::stream_engine_t::mechanism_ready () { if (options.heartbeat_interval > 0) { add_timer (options.heartbeat_interval, heartbeat_ivl_timer_id); has_heartbeat_timer = true; } if (options.recv_routing_id) { msg_t routing_id; mechanism->peer_routing_id (&routing_id); const int rc = session->push_msg (&routing_id); if (rc == -1 && errno == EAGAIN) { // If the write is failing at this stage with // an EAGAIN the pipe must be being shut down, // so we can just bail out of the routing id set. return; } errno_assert (rc == 0); session->flush (); } next_msg = &stream_engine_t::pull_and_encode; process_msg = &stream_engine_t::write_credential; // Compile metadata. properties_t properties; init_properties (properties); // Add ZAP properties. const properties_t &zap_properties = mechanism->get_zap_properties (); properties.insert (zap_properties.begin (), zap_properties.end ()); // Add ZMTP properties. const properties_t &zmtp_properties = mechanism->get_zmtp_properties (); properties.insert (zmtp_properties.begin (), zmtp_properties.end ()); zmq_assert (metadata == NULL); if (!properties.empty ()) { metadata = new (std::nothrow) metadata_t (properties); alloc_assert (metadata); } #ifdef ZMQ_BUILD_DRAFT_API socket->event_handshake_succeeded (endpoint, 0); #endif } int zmq::stream_engine_t::pull_msg_from_session (msg_t *msg_) { return session->pull_msg (msg_); } int zmq::stream_engine_t::push_msg_to_session (msg_t *msg_) { return session->push_msg (msg_); } int zmq::stream_engine_t::push_raw_msg_to_session (msg_t *msg_) { if (metadata && metadata != msg_->metadata ()) msg_->set_metadata (metadata); return push_msg_to_session (msg_); } int zmq::stream_engine_t::write_credential (msg_t *msg_) { zmq_assert (mechanism != NULL); zmq_assert (session != NULL); const blob_t &credential = mechanism->get_user_id (); if (credential.size () > 0) { msg_t msg; int rc = msg.init_size (credential.size ()); zmq_assert (rc == 0); memcpy (msg.data (), credential.data (), credential.size ()); msg.set_flags (msg_t::credential); rc = session->push_msg (&msg); if (rc == -1) { rc = msg.close (); errno_assert (rc == 0); return -1; } } process_msg = &stream_engine_t::decode_and_push; return decode_and_push (msg_); } int zmq::stream_engine_t::pull_and_encode (msg_t *msg_) { zmq_assert (mechanism != NULL); if (session->pull_msg (msg_) == -1) return -1; if (mechanism->encode (msg_) == -1) return -1; return 0; } int zmq::stream_engine_t::decode_and_push (msg_t *msg_) { zmq_assert (mechanism != NULL); if (mechanism->decode (msg_) == -1) return -1; if (has_timeout_timer) { has_timeout_timer = false; cancel_timer (heartbeat_timeout_timer_id); } if (has_ttl_timer) { has_ttl_timer = false; cancel_timer (heartbeat_ttl_timer_id); } if (msg_->flags () & msg_t::command) { uint8_t cmd_id = *((uint8_t *) msg_->data ()); if (cmd_id == 4) process_heartbeat_message (msg_); } if (metadata) msg_->set_metadata (metadata); if (session->push_msg (msg_) == -1) { if (errno == EAGAIN) process_msg = &stream_engine_t::push_one_then_decode_and_push; return -1; } return 0; } int zmq::stream_engine_t::push_one_then_decode_and_push (msg_t *msg_) { const int rc = session->push_msg (msg_); if (rc == 0) process_msg = &stream_engine_t::decode_and_push; return rc; } void zmq::stream_engine_t::error (error_reason_t reason) { if (options.raw_socket && options.raw_notify) { // For raw sockets, send a final 0-length message to the application // so that it knows the peer has been disconnected. msg_t terminator; terminator.init (); (this->*process_msg) (&terminator); terminator.close (); } zmq_assert (session); #ifdef ZMQ_BUILD_DRAFT_API // protocol errors have been signaled already at the point where they occurred if (reason != protocol_error && (mechanism == NULL || mechanism->status () == mechanism_t::handshaking)) { int err = errno; socket->event_handshake_failed_no_detail (endpoint, err); } #endif socket->event_disconnected (endpoint, s); session->flush (); session->engine_error (reason); unplug (); delete this; } void zmq::stream_engine_t::set_handshake_timer () { zmq_assert (!has_handshake_timer); if (!options.raw_socket && options.handshake_ivl > 0) { add_timer (options.handshake_ivl, handshake_timer_id); has_handshake_timer = true; } } bool zmq::stream_engine_t::init_properties (properties_t &properties) { if (peer_address.empty ()) return false; properties.ZMQ_MAP_INSERT_OR_EMPLACE (ZMQ_MSG_PROPERTY_PEER_ADDRESS, peer_address); // Private property to support deprecated SRCFD std::ostringstream stream; stream << (int) s; std::string fd_string = stream.str (); properties.ZMQ_MAP_INSERT_OR_EMPLACE ("__fd", ZMQ_MOVE (fd_string)); return true; } void zmq::stream_engine_t::timer_event (int id_) { if (id_ == handshake_timer_id) { has_handshake_timer = false; // handshake timer expired before handshake completed, so engine fail error (timeout_error); } else if (id_ == heartbeat_ivl_timer_id) { next_msg = &stream_engine_t::produce_ping_message; out_event (); add_timer (options.heartbeat_interval, heartbeat_ivl_timer_id); } else if (id_ == heartbeat_ttl_timer_id) { has_ttl_timer = false; error (timeout_error); } else if (id_ == heartbeat_timeout_timer_id) { has_timeout_timer = false; error (timeout_error); } else // There are no other valid timer ids! assert (false); } int zmq::stream_engine_t::produce_ping_message (msg_t *msg_) { int rc = 0; zmq_assert (mechanism != NULL); // 16-bit TTL + \4PING == 7 rc = msg_->init_size (7); errno_assert (rc == 0); msg_->set_flags (msg_t::command); // Copy in the command message memcpy (msg_->data (), "\4PING", 5); uint16_t ttl_val = htons (options.heartbeat_ttl); memcpy (((uint8_t *) msg_->data ()) + 5, &ttl_val, sizeof (ttl_val)); rc = mechanism->encode (msg_); next_msg = &stream_engine_t::pull_and_encode; if (!has_timeout_timer && heartbeat_timeout > 0) { add_timer (heartbeat_timeout, heartbeat_timeout_timer_id); has_timeout_timer = true; } return rc; } int zmq::stream_engine_t::produce_pong_message (msg_t *msg_) { int rc = 0; zmq_assert (mechanism != NULL); rc = msg_->init_size (5); errno_assert (rc == 0); msg_->set_flags (msg_t::command); memcpy (msg_->data (), "\4PONG", 5); rc = mechanism->encode (msg_); next_msg = &stream_engine_t::pull_and_encode; return rc; } int zmq::stream_engine_t::process_heartbeat_message (msg_t *msg_) { if (memcmp (msg_->data (), "\4PING", 5) == 0) { uint16_t remote_heartbeat_ttl; // Get the remote heartbeat TTL to setup the timer memcpy (&remote_heartbeat_ttl, (uint8_t *) msg_->data () + 5, 2); remote_heartbeat_ttl = ntohs (remote_heartbeat_ttl); // The remote heartbeat is in 10ths of a second // so we multiply it by 100 to get the timer interval in ms. remote_heartbeat_ttl *= 100; if (!has_ttl_timer && remote_heartbeat_ttl > 0) { add_timer (remote_heartbeat_ttl, heartbeat_ttl_timer_id); has_ttl_timer = true; } next_msg = &stream_engine_t::produce_pong_message; out_event (); } return 0; } zeromq-4.2.5/src/mtrie.cpp0000664000372000037200000000303113255253220016350 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "mtrie.hpp" #include "generic_mtrie_impl.hpp" namespace zmq { template class generic_mtrie_t; } zeromq-4.2.5/src/pipe.hpp0000664000372000037200000002125413255253220016201 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PIPE_HPP_INCLUDED__ #define __ZMQ_PIPE_HPP_INCLUDED__ #include "msg.hpp" #include "ypipe_base.hpp" #include "config.hpp" #include "object.hpp" #include "stdint.hpp" #include "array.hpp" #include "blob.hpp" namespace zmq { class object_t; class pipe_t; // Create a pipepair for bi-directional transfer of messages. // First HWM is for messages passed from first pipe to the second pipe. // Second HWM is for messages passed from second pipe to the first pipe. // Delay specifies how the pipe behaves when the peer terminates. If true // pipe receives all the pending messages before terminating, otherwise it // terminates straight away. // If conflate is true, only the most recently arrived message could be // read (older messages are discarded) int pipepair (zmq::object_t *parents_[2], zmq::pipe_t *pipes_[2], int hwms_[2], bool conflate_[2]); struct i_pipe_events { virtual ~i_pipe_events () {} virtual void read_activated (zmq::pipe_t *pipe_) = 0; virtual void write_activated (zmq::pipe_t *pipe_) = 0; virtual void hiccuped (zmq::pipe_t *pipe_) = 0; virtual void pipe_terminated (zmq::pipe_t *pipe_) = 0; }; // Note that pipe can be stored in three different arrays. // The array of inbound pipes (1), the array of outbound pipes (2) and // the generic array of pipes to be deallocated (3). class pipe_t : public object_t, public array_item_t<1>, public array_item_t<2>, public array_item_t<3> { // This allows pipepair to create pipe objects. friend int pipepair (zmq::object_t *parents_[2], zmq::pipe_t *pipes_[2], int hwms_[2], bool conflate_[2]); public: // Specifies the object to send events to. void set_event_sink (i_pipe_events *sink_); // Pipe endpoint can store an routing ID to be used by its clients. void set_server_socket_routing_id (uint32_t routing_id_); uint32_t get_server_socket_routing_id (); // Pipe endpoint can store an opaque ID to be used by its clients. void set_router_socket_routing_id (const blob_t &identity_); const blob_t &get_routing_id (); const blob_t &get_credential () const; // Returns true if there is at least one message to read in the pipe. bool check_read (); // Reads a message to the underlying pipe. bool read (msg_t *msg_); // Checks whether messages can be written to the pipe. If the pipe is // closed or if writing the message would cause high watermark the // function returns false. bool check_write (); // Writes a message to the underlying pipe. Returns false if the // message does not pass check_write. If false, the message object // retains ownership of its message buffer. bool write (msg_t *msg_); // Remove unfinished parts of the outbound message from the pipe. void rollback (); // Flush the messages downstream. void flush (); // Temporarily disconnects the inbound message stream and drops // all the messages on the fly. Causes 'hiccuped' event to be generated // in the peer. void hiccup (); // Ensure the pipe won't block on receiving pipe_term. void set_nodelay (); // Ask pipe to terminate. The termination will happen asynchronously // and user will be notified about actual deallocation by 'terminated' // event. If delay is true, the pending messages will be processed // before actual shutdown. void terminate (bool delay_); // Set the high water marks. void set_hwms (int inhwm_, int outhwm_); // Set the boost to high water marks, used by inproc sockets so total hwm are sum of connect and bind sockets watermarks void set_hwms_boost (int inhwmboost_, int outhwmboost_); // send command to peer for notify the change of hwm void send_hwms_to_peer (int inhwm_, int outhwm_); // Returns true if HWM is not reached bool check_hwm () const; private: // Type of the underlying lock-free pipe. typedef ypipe_base_t upipe_t; // Command handlers. void process_activate_read (); void process_activate_write (uint64_t msgs_read_); void process_hiccup (void *pipe_); void process_pipe_term (); void process_pipe_term_ack (); void process_pipe_hwm (int inhwm_, int outhwm_); // Handler for delimiter read from the pipe. void process_delimiter (); // Constructor is private. Pipe can only be created using // pipepair function. pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, int inhwm_, int outhwm_, bool conflate_); // Pipepair uses this function to let us know about // the peer pipe object. void set_peer (pipe_t *pipe_); // Destructor is private. Pipe objects destroy themselves. ~pipe_t (); // Underlying pipes for both directions. upipe_t *inpipe; upipe_t *outpipe; // Can the pipe be read from / written to? bool in_active; bool out_active; // High watermark for the outbound pipe. int hwm; // Low watermark for the inbound pipe. int lwm; // boosts for high and low watermarks, used with inproc sockets so hwm are sum of send and recv hmws on each side of pipe int inhwmboost; int outhwmboost; // Number of messages read and written so far. uint64_t msgs_read; uint64_t msgs_written; // Last received peer's msgs_read. The actual number in the peer // can be higher at the moment. uint64_t peers_msgs_read; // The pipe object on the other side of the pipepair. pipe_t *peer; // Sink to send events to. i_pipe_events *sink; // States of the pipe endpoint: // active: common state before any termination begins, // delimiter_received: delimiter was read from pipe before // term command was received, // waiting_for_delimiter: term command was already received // from the peer but there are still pending messages to read, // term_ack_sent: all pending messages were already read and // all we are waiting for is ack from the peer, // term_req_sent1: 'terminate' was explicitly called by the user, // term_req_sent2: user called 'terminate' and then we've got // term command from the peer as well. enum { active, delimiter_received, waiting_for_delimiter, term_ack_sent, term_req_sent1, term_req_sent2 } state; // If true, we receive all the pending inbound messages before // terminating. If false, we terminate immediately when the peer // asks us to. bool delay; // Routing id of the writer. Used uniquely by the reader side. blob_t router_socket_routing_id; // Routing id of the writer. Used uniquely by the reader side. int server_socket_routing_id; // Pipe's credential. blob_t credential; // Returns true if the message is delimiter; false otherwise. static bool is_delimiter (const msg_t &msg_); // Computes appropriate low watermark from the given high watermark. static int compute_lwm (int hwm_); const bool conflate; // Disable copying. pipe_t (const pipe_t &); const pipe_t &operator= (const pipe_t &); }; } #endif zeromq-4.2.5/src/signaler.cpp0000664000372000037200000002753713255253220017055 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ // On AIX, poll.h has to be included before zmq.h to get consistent // definition of pollfd structure (AIX uses 'reqevents' and 'retnevents' // instead of 'events' and 'revents' and defines macros to map from POSIX-y // names to AIX-specific names). // zmq.h must be included *after* poll.h for AIX to build properly. // precompiled.hpp includes include/zmq.h #if defined ZMQ_POLL_BASED_ON_POLL && defined ZMQ_HAVE_AIX #include #endif #include "precompiled.hpp" #include "poller.hpp" #if defined ZMQ_POLL_BASED_ON_POLL #if !defined ZMQ_HAVE_WINDOWS && !defined ZMQ_HAVE_AIX #include #endif #elif defined ZMQ_POLL_BASED_ON_SELECT #if defined ZMQ_HAVE_WINDOWS #elif defined ZMQ_HAVE_HPUX #include #include #include #elif defined ZMQ_HAVE_OPENVMS #include #include #elif defined ZMQ_HAVE_VXWORKS #include #include #include #include #else #include #endif #endif #include "signaler.hpp" #include "likely.hpp" #include "stdint.hpp" #include "config.hpp" #include "err.hpp" #include "fd.hpp" #include "ip.hpp" #include "tcp.hpp" #if !defined ZMQ_HAVE_WINDOWS #include #include #include #include #endif #if !defined(ZMQ_HAVE_WINDOWS) // Helper to sleep for specific number of milliseconds (or until signal) // static int sleep_ms (unsigned int ms_) { if (ms_ == 0) return 0; #if defined ZMQ_HAVE_WINDOWS Sleep (ms_ > 0 ? ms_ : INFINITE); return 0; #elif defined ZMQ_HAVE_ANDROID usleep (ms_ * 1000); return 0; #elif defined ZMQ_HAVE_VXWORKS struct timespec ns_; ns_.tv_sec = ms_ / 1000; ns_.tv_nsec = ms_ % 1000 * 1000000; return nanosleep (&ns_, 0); #else return usleep (ms_ * 1000); #endif } // Helper to wait on close(), for non-blocking sockets, until it completes // If EAGAIN is received, will sleep briefly (1-100ms) then try again, until // the overall timeout is reached. // static int close_wait_ms (int fd_, unsigned int max_ms_ = 2000) { unsigned int ms_so_far = 0; unsigned int step_ms = max_ms_ / 10; if (step_ms < 1) step_ms = 1; if (step_ms > 100) step_ms = 100; int rc = 0; // do not sleep on first attempt do { if (rc == -1 && errno == EAGAIN) { sleep_ms (step_ms); ms_so_far += step_ms; } rc = close (fd_); } while (ms_so_far < max_ms_ && rc == -1 && errno == EAGAIN); return rc; } #endif zmq::signaler_t::signaler_t () { // Create the socketpair for signaling. if (make_fdpair (&r, &w) == 0) { unblock_socket (w); unblock_socket (r); } #ifdef HAVE_FORK pid = getpid (); #endif } // This might get run after some part of construction failed, leaving one or // both of r and w retired_fd. zmq::signaler_t::~signaler_t () { #if defined ZMQ_HAVE_EVENTFD if (r == retired_fd) return; int rc = close_wait_ms (r); errno_assert (rc == 0); #elif defined ZMQ_HAVE_WINDOWS if (w != retired_fd) { const struct linger so_linger = {1, 0}; int rc = setsockopt (w, SOL_SOCKET, SO_LINGER, (const char *) &so_linger, sizeof so_linger); // Only check shutdown if WSASTARTUP was previously done if (rc == 0 || WSAGetLastError () != WSANOTINITIALISED) { wsa_assert (rc != SOCKET_ERROR); rc = closesocket (w); wsa_assert (rc != SOCKET_ERROR); if (r == retired_fd) return; rc = closesocket (r); wsa_assert (rc != SOCKET_ERROR); } } #else if (w != retired_fd) { int rc = close_wait_ms (w); errno_assert (rc == 0); } if (r != retired_fd) { int rc = close_wait_ms (r); errno_assert (rc == 0); } #endif } zmq::fd_t zmq::signaler_t::get_fd () const { return r; } void zmq::signaler_t::send () { #if defined HAVE_FORK if (unlikely (pid != getpid ())) { //printf("Child process %d signaler_t::send returning without sending #1\n", getpid()); return; // do not send anything in forked child context } #endif #if defined ZMQ_HAVE_EVENTFD const uint64_t inc = 1; ssize_t sz = write (w, &inc, sizeof (inc)); errno_assert (sz == sizeof (inc)); #elif defined ZMQ_HAVE_WINDOWS unsigned char dummy = 0; while (true) { int nbytes = ::send (w, (char *) &dummy, sizeof (dummy), 0); wsa_assert (nbytes != SOCKET_ERROR); if (unlikely (nbytes == SOCKET_ERROR)) continue; zmq_assert (nbytes == sizeof (dummy)); break; } #elif defined ZMQ_HAVE_VXWORKS unsigned char dummy = 0; while (true) { ssize_t nbytes = ::send (w, (char *) &dummy, sizeof (dummy), 0); if (unlikely (nbytes == -1 && errno == EINTR)) continue; #if defined(HAVE_FORK) if (unlikely (pid != getpid ())) { //printf("Child process %d signaler_t::send returning without sending #2\n", getpid()); errno = EINTR; break; } #endif zmq_assert (nbytes == sizeof dummy); break; } #else unsigned char dummy = 0; while (true) { ssize_t nbytes = ::send (w, &dummy, sizeof (dummy), 0); if (unlikely (nbytes == -1 && errno == EINTR)) continue; #if defined(HAVE_FORK) if (unlikely (pid != getpid ())) { //printf("Child process %d signaler_t::send returning without sending #2\n", getpid()); errno = EINTR; break; } #endif zmq_assert (nbytes == sizeof dummy); break; } #endif } int zmq::signaler_t::wait (int timeout_) { #ifdef HAVE_FORK if (unlikely (pid != getpid ())) { // we have forked and the file descriptor is closed. Emulate an interrupt // response. //printf("Child process %d signaler_t::wait returning simulating interrupt #1\n", getpid()); errno = EINTR; return -1; } #endif #ifdef ZMQ_POLL_BASED_ON_POLL struct pollfd pfd; pfd.fd = r; pfd.events = POLLIN; int rc = poll (&pfd, 1, timeout_); if (unlikely (rc < 0)) { errno_assert (errno == EINTR); return -1; } else if (unlikely (rc == 0)) { errno = EAGAIN; return -1; } #ifdef HAVE_FORK else if (unlikely (pid != getpid ())) { // we have forked and the file descriptor is closed. Emulate an interrupt // response. //printf("Child process %d signaler_t::wait returning simulating interrupt #2\n", getpid()); errno = EINTR; return -1; } #endif zmq_assert (rc == 1); zmq_assert (pfd.revents & POLLIN); return 0; #elif defined ZMQ_POLL_BASED_ON_SELECT fd_set fds; FD_ZERO (&fds); FD_SET (r, &fds); struct timeval timeout; if (timeout_ >= 0) { timeout.tv_sec = timeout_ / 1000; timeout.tv_usec = timeout_ % 1000 * 1000; } #ifdef ZMQ_HAVE_WINDOWS int rc = select (0, &fds, NULL, NULL, timeout_ >= 0 ? &timeout : NULL); wsa_assert (rc != SOCKET_ERROR); #else int rc = select (r + 1, &fds, NULL, NULL, timeout_ >= 0 ? &timeout : NULL); if (unlikely (rc < 0)) { errno_assert (errno == EINTR); return -1; } #endif if (unlikely (rc == 0)) { errno = EAGAIN; return -1; } zmq_assert (rc == 1); return 0; #else #error #endif } void zmq::signaler_t::recv () { // Attempt to read a signal. #if defined ZMQ_HAVE_EVENTFD uint64_t dummy; ssize_t sz = read (r, &dummy, sizeof (dummy)); errno_assert (sz == sizeof (dummy)); // If we accidentally grabbed the next signal(s) along with the current // one, return it back to the eventfd object. if (unlikely (dummy > 1)) { const uint64_t inc = dummy - 1; ssize_t sz2 = write (w, &inc, sizeof (inc)); errno_assert (sz2 == sizeof (inc)); return; } zmq_assert (dummy == 1); #else unsigned char dummy; #if defined ZMQ_HAVE_WINDOWS int nbytes = ::recv (r, (char *) &dummy, sizeof (dummy), 0); wsa_assert (nbytes != SOCKET_ERROR); #elif defined ZMQ_HAVE_VXWORKS ssize_t nbytes = ::recv (r, (char *) &dummy, sizeof (dummy), 0); errno_assert (nbytes >= 0); #else ssize_t nbytes = ::recv (r, &dummy, sizeof (dummy), 0); errno_assert (nbytes >= 0); #endif zmq_assert (nbytes == sizeof (dummy)); zmq_assert (dummy == 0); #endif } int zmq::signaler_t::recv_failable () { // Attempt to read a signal. #if defined ZMQ_HAVE_EVENTFD uint64_t dummy; ssize_t sz = read (r, &dummy, sizeof (dummy)); if (sz == -1) { errno_assert (errno == EAGAIN); return -1; } else { errno_assert (sz == sizeof (dummy)); // If we accidentally grabbed the next signal(s) along with the current // one, return it back to the eventfd object. if (unlikely (dummy > 1)) { const uint64_t inc = dummy - 1; ssize_t sz2 = write (w, &inc, sizeof (inc)); errno_assert (sz2 == sizeof (inc)); return 0; } zmq_assert (dummy == 1); } #else unsigned char dummy; #if defined ZMQ_HAVE_WINDOWS int nbytes = ::recv (r, (char *) &dummy, sizeof (dummy), 0); if (nbytes == SOCKET_ERROR) { const int last_error = WSAGetLastError (); if (last_error == WSAEWOULDBLOCK) { errno = EAGAIN; return -1; } wsa_assert (last_error == WSAEWOULDBLOCK); } #elif defined ZMQ_HAVE_VXWORKS ssize_t nbytes = ::recv (r, (char *) &dummy, sizeof (dummy), 0); if (nbytes == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { errno = EAGAIN; return -1; } errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR); } #else ssize_t nbytes = ::recv (r, &dummy, sizeof (dummy), 0); if (nbytes == -1) { if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) { errno = EAGAIN; return -1; } errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR); } #endif zmq_assert (nbytes == sizeof (dummy)); zmq_assert (dummy == 0); #endif return 0; } bool zmq::signaler_t::valid () const { return w != retired_fd; } #ifdef HAVE_FORK void zmq::signaler_t::forked () { // Close file descriptors created in the parent and create new pair close (r); close (w); make_fdpair (&r, &w); } #endif zeromq-4.2.5/src/pub.cpp0000664000372000037200000000413313255253220016022 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "pub.hpp" #include "pipe.hpp" #include "err.hpp" #include "msg.hpp" zmq::pub_t::pub_t (class ctx_t *parent_, uint32_t tid_, int sid_) : xpub_t (parent_, tid_, sid_) { options.type = ZMQ_PUB; } zmq::pub_t::~pub_t () { } void zmq::pub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { zmq_assert (pipe_); // Don't delay pipe termination as there is no one // to receive the delimiter. pipe_->set_nodelay (); xpub_t::xattach_pipe (pipe_, subscribe_to_all_); } int zmq::pub_t::xrecv (class msg_t *) { // Messages cannot be received from PUB socket. errno = ENOTSUP; return -1; } bool zmq::pub_t::xhas_in () { return false; } zeromq-4.2.5/src/pair.hpp0000664000372000037200000000447113255253220016201 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PAIR_HPP_INCLUDED__ #define __ZMQ_PAIR_HPP_INCLUDED__ #include "blob.hpp" #include "socket_base.hpp" #include "session_base.hpp" namespace zmq { class ctx_t; class msg_t; class pipe_t; class io_thread_t; class pair_t : public socket_base_t { public: pair_t (zmq::ctx_t *parent_, uint32_t tid_, int sid); ~pair_t (); // Overrides of functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_); int xsend (zmq::msg_t *msg_); int xrecv (zmq::msg_t *msg_); bool xhas_in (); bool xhas_out (); const blob_t &get_credential () const; void xread_activated (zmq::pipe_t *pipe_); void xwrite_activated (zmq::pipe_t *pipe_); void xpipe_terminated (zmq::pipe_t *pipe_); private: zmq::pipe_t *pipe; zmq::pipe_t *last_in; blob_t saved_credential; pair_t (const pair_t &); const pair_t &operator= (const pair_t &); }; } #endif zeromq-4.2.5/src/pull.cpp0000664000372000037200000000434213255253220016212 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "pull.hpp" #include "err.hpp" #include "msg.hpp" #include "pipe.hpp" zmq::pull_t::pull_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_) { options.type = ZMQ_PULL; } zmq::pull_t::~pull_t () { } void zmq::pull_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); fq.attach (pipe_); } void zmq::pull_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::pull_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); } int zmq::pull_t::xrecv (msg_t *msg_) { return fq.recv (msg_); } bool zmq::pull_t::xhas_in () { return fq.has_in (); } const zmq::blob_t &zmq::pull_t::get_credential () const { return fq.get_credential (); } zeromq-4.2.5/src/io_thread.cpp0000664000372000037200000000617313255253220017200 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include "macros.hpp" #include "io_thread.hpp" #include "err.hpp" #include "ctx.hpp" zmq::io_thread_t::io_thread_t (ctx_t *ctx_, uint32_t tid_) : object_t (ctx_, tid_), mailbox_handle ((poller_t::handle_t) NULL) { poller = new (std::nothrow) poller_t (*ctx_); alloc_assert (poller); if (mailbox.get_fd () != retired_fd) { mailbox_handle = poller->add_fd (mailbox.get_fd (), this); poller->set_pollin (mailbox_handle); } } zmq::io_thread_t::~io_thread_t () { LIBZMQ_DELETE (poller); } void zmq::io_thread_t::start () { // Start the underlying I/O thread. poller->start (); } void zmq::io_thread_t::stop () { send_stop (); } zmq::mailbox_t *zmq::io_thread_t::get_mailbox () { return &mailbox; } int zmq::io_thread_t::get_load () { return poller->get_load (); } void zmq::io_thread_t::in_event () { // TODO: Do we want to limit number of commands I/O thread can // process in a single go? command_t cmd; int rc = mailbox.recv (&cmd, 0); while (rc == 0 || errno == EINTR) { if (rc == 0) cmd.destination->process_command (cmd); rc = mailbox.recv (&cmd, 0); } errno_assert (rc != 0 && errno == EAGAIN); } void zmq::io_thread_t::out_event () { // We are never polling for POLLOUT here. This function is never called. zmq_assert (false); } void zmq::io_thread_t::timer_event (int) { // No timers here. This function is never called. zmq_assert (false); } zmq::poller_t *zmq::io_thread_t::get_poller () { zmq_assert (poller); return poller; } void zmq::io_thread_t::process_stop () { zmq_assert (mailbox_handle); poller->rm_fd (mailbox_handle); poller->stop (); } zeromq-4.2.5/src/config.hpp0000664000372000037200000001011013255253220016476 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_CONFIG_HPP_INCLUDED__ #define __ZMQ_CONFIG_HPP_INCLUDED__ namespace zmq { // Compile-time settings. enum { // Number of new messages in message pipe needed to trigger new memory // allocation. Setting this parameter to 256 decreases the impact of // memory allocation by approximately 99.6% message_pipe_granularity = 256, // Commands in pipe per allocation event. command_pipe_granularity = 16, // Determines how often does socket poll for new commands when it // still has unprocessed messages to handle. Thus, if it is set to 100, // socket will process 100 inbound messages before doing the poll. // If there are no unprocessed messages available, poll is done // immediately. Decreasing the value trades overall latency for more // real-time behaviour (less latency peaks). inbound_poll_rate = 100, // Maximal batching size for engines with receiving functionality. // So, if there are 10 messages that fit into the batch size, all of // them may be read by a single 'recv' system call, thus avoiding // unnecessary network stack traversals. in_batch_size = 8192, // Maximal batching size for engines with sending functionality. // So, if there are 10 messages that fit into the batch size, all of // them may be written by a single 'send' system call, thus avoiding // unnecessary network stack traversals. out_batch_size = 8192, // Maximal delta between high and low watermark. max_wm_delta = 1024, // Maximum number of events the I/O thread can process in one go. max_io_events = 256, // Maximal delay to process command in API thread (in CPU ticks). // 3,000,000 ticks equals to 1 - 2 milliseconds on current CPUs. // Note that delay is only applied when there is continuous stream of // messages to process. If not so, commands are processed immediately. max_command_delay = 3000000, // Low-precision clock precision in CPU ticks. 1ms. Value of 1000000 // should be OK for CPU frequencies above 1GHz. If should work // reasonably well for CPU frequencies above 500MHz. For lower CPU // frequencies you may consider lowering this value to get best // possible latencies. clock_precision = 1000000, // On some OSes the signaler has to be emulated using a TCP // connection. In such cases following port is used. // If 0, it lets the OS choose a free port without requiring use of a // global mutex. The original implementation of a Windows signaler // socket used port 5905 instead of letting the OS choose a free port. // https://github.com/zeromq/libzmq/issues/1542 signaler_port = 0 }; } #endif zeromq-4.2.5/src/rep.cpp0000664000372000037200000000747713255253220016040 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "rep.hpp" #include "err.hpp" #include "msg.hpp" zmq::rep_t::rep_t (class ctx_t *parent_, uint32_t tid_, int sid_) : router_t (parent_, tid_, sid_), sending_reply (false), request_begins (true) { options.type = ZMQ_REP; } zmq::rep_t::~rep_t () { } int zmq::rep_t::xsend (msg_t *msg_) { // If we are in the middle of receiving a request, we cannot send reply. if (!sending_reply) { errno = EFSM; return -1; } bool more = msg_->flags () & msg_t::more ? true : false; // Push message to the reply pipe. int rc = router_t::xsend (msg_); if (rc != 0) return rc; // If the reply is complete flip the FSM back to request receiving state. if (!more) sending_reply = false; return 0; } int zmq::rep_t::xrecv (msg_t *msg_) { // If we are in middle of sending a reply, we cannot receive next request. if (sending_reply) { errno = EFSM; return -1; } // First thing to do when receiving a request is to copy all the labels // to the reply pipe. if (request_begins) { while (true) { int rc = router_t::xrecv (msg_); if (rc != 0) return rc; if ((msg_->flags () & msg_t::more)) { // Empty message part delimits the traceback stack. bool bottom = (msg_->size () == 0); // Push it to the reply pipe. rc = router_t::xsend (msg_); errno_assert (rc == 0); if (bottom) break; } else { // If the traceback stack is malformed, discard anything // already sent to pipe (we're at end of invalid message). rc = router_t::rollback (); errno_assert (rc == 0); } } request_begins = false; } // Get next message part to return to the user. int rc = router_t::xrecv (msg_); if (rc != 0) return rc; // If whole request is read, flip the FSM to reply-sending state. if (!(msg_->flags () & msg_t::more)) { sending_reply = true; request_begins = true; } return 0; } bool zmq::rep_t::xhas_in () { if (sending_reply) return false; return router_t::xhas_in (); } bool zmq::rep_t::xhas_out () { if (!sending_reply) return false; return router_t::xhas_out (); } zeromq-4.2.5/src/sub.hpp0000664000372000037200000000363113255253220016034 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_SUB_HPP_INCLUDED__ #define __ZMQ_SUB_HPP_INCLUDED__ #include "xsub.hpp" namespace zmq { class ctx_t; class msg_t; class io_thread_t; class socket_base_t; class sub_t : public xsub_t { public: sub_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~sub_t (); protected: int xsetsockopt (int option_, const void *optval_, size_t optvallen_); int xsend (zmq::msg_t *msg_); bool xhas_out (); private: sub_t (const sub_t &); const sub_t &operator= (const sub_t &); }; } #endif zeromq-4.2.5/src/tcp_address.cpp0000664000372000037200000007015513255253220017536 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include #include #include "macros.hpp" #include "tcp_address.hpp" #include "stdint.hpp" #include "err.hpp" #include "ip.hpp" #ifndef ZMQ_HAVE_WINDOWS #include #include #include #include #include #include #include #include #endif #ifdef ZMQ_HAVE_SOLARIS #include // On Solaris platform, network interface name can be queried by ioctl. int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { // TODO: Unused parameter, IPv6 support not implemented for Solaris. LIBZMQ_UNUSED (ipv6_); // Create a socket. const int fd = open_socket (AF_INET, SOCK_DGRAM, 0); errno_assert (fd != -1); // Retrieve number of interfaces. lifnum ifn; ifn.lifn_family = AF_INET; ifn.lifn_flags = 0; int rc = ioctl (fd, SIOCGLIFNUM, (char *) &ifn); errno_assert (rc != -1); // Allocate memory to get interface names. const size_t ifr_size = sizeof (struct lifreq) * ifn.lifn_count; char *ifr = (char *) malloc (ifr_size); alloc_assert (ifr); // Retrieve interface names. lifconf ifc; ifc.lifc_family = AF_INET; ifc.lifc_flags = 0; ifc.lifc_len = ifr_size; ifc.lifc_buf = ifr; rc = ioctl (fd, SIOCGLIFCONF, (char *) &ifc); errno_assert (rc != -1); // Find the interface with the specified name and AF_INET family. bool found = false; lifreq *ifrp = ifc.lifc_req; for (int n = 0; n < (int) (ifc.lifc_len / sizeof (lifreq)); n++, ifrp++) { if (!strcmp (nic_, ifrp->lifr_name)) { rc = ioctl (fd, SIOCGLIFADDR, (char *) ifrp); errno_assert (rc != -1); if (ifrp->lifr_addr.ss_family == AF_INET) { if (is_src_) source_address.ipv4 = *(sockaddr_in *) &ifrp->lifr_addr; else address.ipv4 = *(sockaddr_in *) &ifrp->lifr_addr; found = true; break; } } } // Clean-up. free (ifr); close (fd); if (!found) { errno = ENODEV; return -1; } return 0; } #elif defined ZMQ_HAVE_AIX || defined ZMQ_HAVE_HPUX \ || defined ZMQ_HAVE_ANDROID || defined ZMQ_HAVE_VXWORKS #include #ifdef ZMQ_HAVE_VXWORKS #include #endif int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { #if defined ZMQ_HAVE_AIX || defined ZMQ_HAVE_HPUX // IPv6 support not implemented for AIX or HP/UX. if (ipv6_) { errno = ENODEV; return -1; } #endif // Create a socket. const int sd = open_socket (ipv6_ ? AF_INET6 : AF_INET, SOCK_DGRAM, 0); errno_assert (sd != -1); struct ifreq ifr; // Copy interface name for ioctl get. strncpy (ifr.ifr_name, nic_, sizeof (ifr.ifr_name)); // Fetch interface address. const int rc = ioctl (sd, SIOCGIFADDR, (caddr_t) &ifr, sizeof (ifr)); // Clean up. close (sd); if (rc == -1) { errno = ENODEV; return -1; } const int family = ifr.ifr_addr.sa_family; if (family == (ipv6_ ? AF_INET6 : AF_INET) && !strcmp (nic_, ifr.ifr_name)) { if (is_src_) memcpy (&source_address, &ifr.ifr_addr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); else memcpy (&address, &ifr.ifr_addr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); } else { errno = ENODEV; return -1; } return 0; } #elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD \ || defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD \ || defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD \ || defined ZMQ_HAVE_DRAGONFLY || defined ZMQ_HAVE_GNU) \ && defined ZMQ_HAVE_IFADDRS) #include // On these platforms, network interface name can be queried // using getifaddrs function. int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { // Get the addresses. ifaddrs *ifa = NULL; int rc = 0; const int max_attempts = 10; const int backoff_msec = 1; for (int i = 0; i < max_attempts; i++) { rc = getifaddrs (&ifa); if (rc == 0 || (rc < 0 && errno != ECONNREFUSED)) break; usleep ((backoff_msec << i) * 1000); } if (rc != 0 && ((errno == EINVAL) || (errno == EOPNOTSUPP))) { // Windows Subsystem for Linux compatibility LIBZMQ_UNUSED (nic_); LIBZMQ_UNUSED (ipv6_); errno = ENODEV; return -1; } errno_assert (rc == 0); zmq_assert (ifa != NULL); // Find the corresponding network interface. bool found = false; for (ifaddrs *ifp = ifa; ifp != NULL; ifp = ifp->ifa_next) { if (ifp->ifa_addr == NULL) continue; const int family = ifp->ifa_addr->sa_family; if (family == (ipv6_ ? AF_INET6 : AF_INET) && !strcmp (nic_, ifp->ifa_name)) { if (is_src_) memcpy (&source_address, ifp->ifa_addr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); else memcpy (&address, ifp->ifa_addr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); found = true; break; } } // Clean-up; freeifaddrs (ifa); if (!found) { errno = ENODEV; return -1; } return 0; } #elif (defined ZMQ_HAVE_WINDOWS) #include int zmq::tcp_address_t::get_interface_name (unsigned long index, char **dest) const { #ifdef ZMQ_HAVE_WINDOWS_UWP char *buffer = (char *) malloc (1024); #else char *buffer = (char *) malloc (IF_MAX_STRING_SIZE); #endif alloc_assert (buffer); char *if_name_result = NULL; #if !defined ZMQ_HAVE_WINDOWS_TARGET_XP && !defined ZMQ_HAVE_WINDOWS_UWP if_name_result = if_indextoname (index, buffer); #endif if (if_name_result == NULL) { free (buffer); return -1; } *dest = buffer; return 0; } int zmq::tcp_address_t::wchar_to_utf8 (const WCHAR *src, char **dest) const { int rc; int buffer_len = WideCharToMultiByte (CP_UTF8, 0, src, -1, NULL, 0, NULL, 0); char *buffer = (char *) malloc (buffer_len); alloc_assert (buffer); rc = WideCharToMultiByte (CP_UTF8, 0, src, -1, buffer, buffer_len, NULL, 0); if (rc == 0) { free (buffer); return -1; } *dest = buffer; return 0; } int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { int rc; bool found = false; const int max_attempts = 10; int iterations = 0; IP_ADAPTER_ADDRESSES *addresses = NULL; IP_ADAPTER_ADDRESSES *current_addresses = NULL; unsigned long out_buf_len = sizeof (IP_ADAPTER_ADDRESSES); do { addresses = (IP_ADAPTER_ADDRESSES *) malloc (out_buf_len); alloc_assert (addresses); rc = GetAdaptersAddresses (AF_UNSPEC, GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST | GAA_FLAG_SKIP_DNS_SERVER, NULL, addresses, &out_buf_len); if (rc == ERROR_BUFFER_OVERFLOW) { free (addresses); addresses = NULL; } else { break; } iterations++; } while ((rc == ERROR_BUFFER_OVERFLOW) && (iterations < max_attempts)); if (rc == 0) { current_addresses = addresses; while (current_addresses) { char *if_name = NULL; char *if_friendly_name = NULL; int str_rc1, str_rc2; str_rc1 = get_interface_name (current_addresses->IfIndex, &if_name); str_rc2 = wchar_to_utf8 (current_addresses->FriendlyName, &if_friendly_name); // Find a network adapter by its "name" or "friendly name" if (((str_rc1 == 0) && (!strcmp (nic_, if_name))) || ((str_rc2 == 0) && (!strcmp (nic_, if_friendly_name)))) { // Iterate over all unicast addresses bound to the current network interface IP_ADAPTER_UNICAST_ADDRESS *unicast_address = current_addresses->FirstUnicastAddress; IP_ADAPTER_UNICAST_ADDRESS *current_unicast_address = unicast_address; while (current_unicast_address) { ADDRESS_FAMILY family = current_unicast_address->Address.lpSockaddr->sa_family; if (family == (ipv6_ ? AF_INET6 : AF_INET)) { if (is_src_) memcpy (&source_address, current_unicast_address->Address.lpSockaddr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); else memcpy (&address, current_unicast_address->Address.lpSockaddr, (family == AF_INET) ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr_in6)); found = true; break; } current_unicast_address = current_unicast_address->Next; } if (found) break; } if (str_rc1 == 0) free (if_name); if (str_rc2 == 0) free (if_friendly_name); current_addresses = current_addresses->Next; } free (addresses); } if (!found) { errno = ENODEV; return -1; } return 0; } #else // On other platforms we assume there are no sane interface names. int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_) { LIBZMQ_UNUSED (nic_); LIBZMQ_UNUSED (ipv6_); errno = ENODEV; return -1; } #endif int zmq::tcp_address_t::resolve_interface (const char *interface_, bool ipv6_, bool is_src_) { // Initialize temporary output pointers with storage address. sockaddr_storage ss; sockaddr *out_addr = (sockaddr *) &ss; size_t out_addrlen; // Initialise IP-format family/port and populate temporary output pointers // with the address. if (ipv6_) { sockaddr_in6 ip6_addr; memset (&ip6_addr, 0, sizeof (ip6_addr)); ip6_addr.sin6_family = AF_INET6; #ifdef ZMQ_HAVE_VXWORKS struct in6_addr newaddr = IN6ADDR_ANY_INIT; memcpy (&ip6_addr.sin6_addr, &newaddr, sizeof (in6_addr)); #else memcpy (&ip6_addr.sin6_addr, &in6addr_any, sizeof (in6addr_any)); #endif out_addrlen = sizeof (ip6_addr); memcpy (out_addr, &ip6_addr, out_addrlen); } else { sockaddr_in ip4_addr; memset (&ip4_addr, 0, sizeof (ip4_addr)); ip4_addr.sin_family = AF_INET; ip4_addr.sin_addr.s_addr = htonl (INADDR_ANY); out_addrlen = sizeof (ip4_addr); memcpy (out_addr, &ip4_addr, out_addrlen); } // "*" resolves to INADDR_ANY or in6addr_any. if (strcmp (interface_, "*") == 0) { zmq_assert (out_addrlen <= sizeof (address)); if (is_src_) memcpy (&source_address, out_addr, out_addrlen); else memcpy (&address, out_addr, out_addrlen); return 0; } // Try to resolve the string as a NIC name. int rc = resolve_nic_name (interface_, ipv6_, is_src_); if (rc == 0 || errno != ENODEV) return rc; // There's no such interface name. Assume literal address. #if defined ZMQ_HAVE_OPENVMS && defined __ia64 __addrinfo64 *res = NULL; __addrinfo64 req; #else addrinfo *res = NULL; addrinfo req; #endif memset (&req, 0, sizeof (req)); // Choose IPv4 or IPv6 protocol family. Note that IPv6 allows for // IPv4-in-IPv6 addresses. req.ai_family = ipv6_ ? AF_INET6 : AF_INET; // Arbitrary, not used in the output, but avoids duplicate results. req.ai_socktype = SOCK_STREAM; // Restrict hostname/service to literals to avoid any DNS lookups or // service-name irregularity due to indeterminate socktype. req.ai_flags = AI_PASSIVE | AI_NUMERICHOST; #if defined AI_V4MAPPED // In this API we only require IPv4-mapped addresses when // no native IPv6 interfaces are available (~AI_ALL). // This saves an additional DNS roundtrip for IPv4 addresses. if (req.ai_family == AF_INET6) req.ai_flags |= AI_V4MAPPED; #endif // Resolve the literal address. Some of the error info is lost in case // of error, however, there's no way to report EAI errors via errno. rc = getaddrinfo (interface_, NULL, &req, &res); #if defined AI_V4MAPPED // Some OS do have AI_V4MAPPED defined but it is not supported in getaddrinfo() // returning EAI_BADFLAGS. Detect this and retry if (rc == EAI_BADFLAGS && (req.ai_flags & AI_V4MAPPED)) { req.ai_flags &= ~AI_V4MAPPED; rc = getaddrinfo (interface_, NULL, &req, &res); } #endif #if defined ZMQ_HAVE_WINDOWS // Resolve specific case on Windows platform when using IPv4 address // with ZMQ_IPv6 socket option. if ((req.ai_family == AF_INET6) && (rc == WSAHOST_NOT_FOUND)) { req.ai_family = AF_INET; rc = getaddrinfo (interface_, NULL, &req, &res); } #endif if (rc) { errno = ENODEV; return -1; } // Use the first result. zmq_assert (res != NULL); zmq_assert ((size_t) res->ai_addrlen <= sizeof (address)); if (is_src_) memcpy (&source_address, res->ai_addr, res->ai_addrlen); else memcpy (&address, res->ai_addr, res->ai_addrlen); // Cleanup getaddrinfo after copying the possibly referenced result. freeaddrinfo (res); return 0; } int zmq::tcp_address_t::resolve_hostname (const char *hostname_, bool ipv6_, bool is_src_) { // Set up the query. #if defined ZMQ_HAVE_OPENVMS && defined __ia64 && __INITIAL_POINTER_SIZE == 64 __addrinfo64 req; #else addrinfo req; #endif memset (&req, 0, sizeof (req)); // Choose IPv4 or IPv6 protocol family. Note that IPv6 allows for // IPv4-in-IPv6 addresses. req.ai_family = ipv6_ ? AF_INET6 : AF_INET; // Need to choose one to avoid duplicate results from getaddrinfo() - this // doesn't really matter, since it's not included in the addr-output. req.ai_socktype = SOCK_STREAM; #if defined AI_V4MAPPED // In this API we only require IPv4-mapped addresses when // no native IPv6 interfaces are available. // This saves an additional DNS roundtrip for IPv4 addresses. if (req.ai_family == AF_INET6) req.ai_flags |= AI_V4MAPPED; #endif // Resolve host name. Some of the error info is lost in case of error, // however, there's no way to report EAI errors via errno. #if defined ZMQ_HAVE_OPENVMS && defined __ia64 && __INITIAL_POINTER_SIZE == 64 __addrinfo64 *res; #else addrinfo *res; #endif int rc = getaddrinfo (hostname_, NULL, &req, &res); #if defined AI_V4MAPPED // Some OS do have AI_V4MAPPED defined but it is not supported in getaddrinfo() // returning EAI_BADFLAGS. Detect this and retry if (rc == EAI_BADFLAGS && (req.ai_flags & AI_V4MAPPED)) { req.ai_flags &= ~AI_V4MAPPED; rc = getaddrinfo (hostname_, NULL, &req, &res); } #endif if (rc) { switch (rc) { case EAI_MEMORY: errno = ENOMEM; break; default: errno = EINVAL; break; } return -1; } // Copy first result to output addr with hostname and service. zmq_assert ((size_t) res->ai_addrlen <= sizeof (address)); if (is_src_) memcpy (&source_address, res->ai_addr, res->ai_addrlen); else memcpy (&address, res->ai_addr, res->ai_addrlen); freeaddrinfo (res); return 0; } zmq::tcp_address_t::tcp_address_t () : _has_src_addr (false) { memset (&address, 0, sizeof (address)); memset (&source_address, 0, sizeof (source_address)); } zmq::tcp_address_t::tcp_address_t (const sockaddr *sa, socklen_t sa_len) : _has_src_addr (false) { zmq_assert (sa && sa_len > 0); memset (&address, 0, sizeof (address)); memset (&source_address, 0, sizeof (source_address)); if (sa->sa_family == AF_INET && sa_len >= (socklen_t) sizeof (address.ipv4)) memcpy (&address.ipv4, sa, sizeof (address.ipv4)); else if (sa->sa_family == AF_INET6 && sa_len >= (socklen_t) sizeof (address.ipv6)) memcpy (&address.ipv6, sa, sizeof (address.ipv6)); } zmq::tcp_address_t::~tcp_address_t () { } int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv6_, bool is_src_) { if (!is_src_) { // Test the ';' to know if we have a source address in name_ const char *src_delimiter = strrchr (name_, ';'); if (src_delimiter) { std::string src_name (name_, src_delimiter - name_); const int rc = resolve (src_name.c_str (), local_, ipv6_, true); if (rc != 0) return -1; name_ = src_delimiter + 1; _has_src_addr = true; } } // Find the ':' at end that separates address from the port number. const char *delimiter = strrchr (name_, ':'); if (!delimiter) { errno = EINVAL; return -1; } // Separate the address/port. std::string addr_str (name_, delimiter - name_); std::string port_str (delimiter + 1); // Remove square brackets around the address, if any, as used in IPv6 if (addr_str.size () >= 2 && addr_str[0] == '[' && addr_str[addr_str.size () - 1] == ']') addr_str = addr_str.substr (1, addr_str.size () - 2); // Test the '%' to know if we have an interface name / zone_id in the address // Reference: https://tools.ietf.org/html/rfc4007 std::size_t pos = addr_str.rfind ('%'); uint32_t zone_id = 0; if (pos != std::string::npos) { std::string if_str = addr_str.substr (pos + 1); addr_str = addr_str.substr (0, pos); if (isalpha (if_str.at (0))) #if !defined ZMQ_HAVE_WINDOWS_TARGET_XP && !defined ZMQ_HAVE_WINDOWS_UWP \ && !defined ZMQ_HAVE_VXWORKS zone_id = if_nametoindex (if_str.c_str ()); #else // The function 'if_nametoindex' is not supported on Windows XP. // If we are targeting XP using a vxxx_xp toolset then fail. // This is brutal as this code could be run on later windows clients // meaning the IPv6 zone_id cannot have an interface name. // This could be fixed with a runtime check. zone_id = 0; #endif else zone_id = (uint32_t) atoi (if_str.c_str ()); if (zone_id == 0) { errno = EINVAL; return -1; } } // Allow 0 specifically, to detect invalid port error in atoi if not uint16_t port; if (port_str == "*" || port_str == "0") // Resolve wildcard to 0 to allow autoselection of port port = 0; else { // Parse the port number (0 is not a valid port). port = (uint16_t) atoi (port_str.c_str ()); if (port == 0) { errno = EINVAL; return -1; } } // Resolve the IP address. int rc; if (local_ || is_src_) rc = resolve_interface (addr_str.c_str (), ipv6_, is_src_); else rc = resolve_hostname (addr_str.c_str (), ipv6_, is_src_); if (rc != 0) return -1; // Set the port into the address structure. if (is_src_) { if (source_address.generic.sa_family == AF_INET6) { source_address.ipv6.sin6_port = htons (port); source_address.ipv6.sin6_scope_id = zone_id; } else source_address.ipv4.sin_port = htons (port); } else { if (address.generic.sa_family == AF_INET6) { address.ipv6.sin6_port = htons (port); address.ipv6.sin6_scope_id = zone_id; } else address.ipv4.sin_port = htons (port); } return 0; } int zmq::tcp_address_t::to_string (std::string &addr_) { if (address.generic.sa_family != AF_INET && address.generic.sa_family != AF_INET6) { addr_.clear (); return -1; } // Not using service resolving because of // https://github.com/zeromq/libzmq/commit/1824574f9b5a8ce786853320e3ea09fe1f822bc4 char hbuf[NI_MAXHOST]; int rc = getnameinfo (addr (), addrlen (), hbuf, sizeof (hbuf), NULL, 0, NI_NUMERICHOST); if (rc != 0) { addr_.clear (); return rc; } if (address.generic.sa_family == AF_INET6) { std::stringstream s; s << "tcp://[" << hbuf << "]:" << ntohs (address.ipv6.sin6_port); addr_ = s.str (); } else { std::stringstream s; s << "tcp://" << hbuf << ":" << ntohs (address.ipv4.sin_port); addr_ = s.str (); } return 0; } const sockaddr *zmq::tcp_address_t::addr () const { return &address.generic; } socklen_t zmq::tcp_address_t::addrlen () const { if (address.generic.sa_family == AF_INET6) return (socklen_t) sizeof (address.ipv6); else return (socklen_t) sizeof (address.ipv4); } const sockaddr *zmq::tcp_address_t::src_addr () const { return &source_address.generic; } socklen_t zmq::tcp_address_t::src_addrlen () const { if (address.generic.sa_family == AF_INET6) return (socklen_t) sizeof (source_address.ipv6); else return (socklen_t) sizeof (source_address.ipv4); } bool zmq::tcp_address_t::has_src_addr () const { return _has_src_addr; } #if defined ZMQ_HAVE_WINDOWS unsigned short zmq::tcp_address_t::family () const #else sa_family_t zmq::tcp_address_t::family () const #endif { return address.generic.sa_family; } zmq::tcp_address_mask_t::tcp_address_mask_t () : tcp_address_t (), address_mask (-1) { } int zmq::tcp_address_mask_t::mask () const { return address_mask; } int zmq::tcp_address_mask_t::resolve (const char *name_, bool ipv6_) { // Find '/' at the end that separates address from the cidr mask number. // Allow empty mask clause and treat it like '/32' for ipv4 or '/128' for ipv6. std::string addr_str, mask_str; const char *delimiter = strrchr (name_, '/'); if (delimiter != NULL) { addr_str.assign (name_, delimiter - name_); mask_str.assign (delimiter + 1); if (mask_str.empty ()) { errno = EINVAL; return -1; } } else addr_str.assign (name_); // Parse address part using standard routines. const int rc = tcp_address_t::resolve_hostname (addr_str.c_str (), ipv6_); if (rc != 0) return rc; // Parse the cidr mask number. if (mask_str.empty ()) { if (address.generic.sa_family == AF_INET6) address_mask = 128; else address_mask = 32; } else if (mask_str == "0") address_mask = 0; else { const int mask = atoi (mask_str.c_str ()); if ((mask < 1) || (address.generic.sa_family == AF_INET6 && mask > 128) || (address.generic.sa_family != AF_INET6 && mask > 32)) { errno = EINVAL; return -1; } address_mask = mask; } return 0; } int zmq::tcp_address_mask_t::to_string (std::string &addr_) { if (address.generic.sa_family != AF_INET && address.generic.sa_family != AF_INET6) { addr_.clear (); return -1; } if (address_mask == -1) { addr_.clear (); return -1; } char hbuf[NI_MAXHOST]; int rc = getnameinfo (addr (), addrlen (), hbuf, sizeof (hbuf), NULL, 0, NI_NUMERICHOST); if (rc != 0) { addr_.clear (); return rc; } if (address.generic.sa_family == AF_INET6) { std::stringstream s; s << "[" << hbuf << "]/" << address_mask; addr_ = s.str (); } else { std::stringstream s; s << hbuf << "/" << address_mask; addr_ = s.str (); } return 0; } bool zmq::tcp_address_mask_t::match_address (const struct sockaddr *ss, const socklen_t ss_len) const { zmq_assert (address_mask != -1 && ss != NULL && ss_len >= (socklen_t) sizeof (struct sockaddr)); if (ss->sa_family != address.generic.sa_family) return false; if (address_mask > 0) { int mask; const uint8_t *our_bytes, *their_bytes; if (ss->sa_family == AF_INET6) { zmq_assert (ss_len == sizeof (struct sockaddr_in6)); their_bytes = (const uint8_t *) &( ((const struct sockaddr_in6 *) ss)->sin6_addr); our_bytes = (const uint8_t *) &address.ipv6.sin6_addr; mask = sizeof (struct in6_addr) * 8; } else { zmq_assert (ss_len == sizeof (struct sockaddr_in)); their_bytes = (const uint8_t *) &(((const struct sockaddr_in *) ss)->sin_addr); our_bytes = (const uint8_t *) &address.ipv4.sin_addr; mask = sizeof (struct in_addr) * 8; } if (address_mask < mask) mask = address_mask; const size_t full_bytes = mask / 8; if (memcmp (our_bytes, their_bytes, full_bytes)) return false; const uint8_t last_byte_bits = 0xffU << (8 - mask % 8); if (last_byte_bits) { if ((their_bytes[full_bytes] & last_byte_bits) != (our_bytes[full_bytes] & last_byte_bits)) return false; } } return true; } zeromq-4.2.5/src/pub.hpp0000664000372000037200000000371513255253220016034 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_PUB_HPP_INCLUDED__ #define __ZMQ_PUB_HPP_INCLUDED__ #include "xpub.hpp" namespace zmq { class ctx_t; class io_thread_t; class socket_base_t; class msg_t; class pub_t : public xpub_t { public: pub_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_); ~pub_t (); // Implementations of virtual functions from socket_base_t. void xattach_pipe (zmq::pipe_t *pipe_, bool subscribe_to_all_ = false); int xrecv (zmq::msg_t *msg_); bool xhas_in (); private: pub_t (const pub_t &); const pub_t &operator= (const pub_t &); }; } #endif zeromq-4.2.5/src/i_engine.hpp0000664000372000037200000000446213255253220017023 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_I_ENGINE_HPP_INCLUDED__ #define __ZMQ_I_ENGINE_HPP_INCLUDED__ namespace zmq { class io_thread_t; // Abstract interface to be implemented by various engines. struct i_engine { virtual ~i_engine () {} // Plug the engine to the session. virtual void plug (zmq::io_thread_t *io_thread_, class session_base_t *session_) = 0; // Terminate and deallocate the engine. Note that 'detached' // events are not fired on termination. virtual void terminate () = 0; // This method is called by the session to signalise that more // messages can be written to the pipe. virtual void restart_input () = 0; // This method is called by the session to signalise that there // are messages to send available. virtual void restart_output () = 0; virtual void zap_msg_available () = 0; virtual const char *get_endpoint () const = 0; }; } #endif zeromq-4.2.5/src/tcp.hpp0000664000372000037200000000544313255253220016034 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_TCP_HPP_INCLUDED__ #define __ZMQ_TCP_HPP_INCLUDED__ #include "fd.hpp" namespace zmq { // Tunes the supplied TCP socket for the best latency. int tune_tcp_socket (fd_t s_); // Sets the socket send buffer size. int set_tcp_send_buffer (fd_t sockfd_, int bufsize_); // Sets the socket receive buffer size. int set_tcp_receive_buffer (fd_t sockfd_, int bufsize_); // Tunes TCP keep-alives int tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_); // Tunes TCP max retransmit timeout int tune_tcp_maxrt (fd_t sockfd_, int timeout_); // Writes data to the socket. Returns the number of bytes actually // written (even zero is to be considered to be a success). In case // of error or orderly shutdown by the other peer -1 is returned. int tcp_write (fd_t s_, const void *data_, size_t size_); // Reads data from the socket (up to 'size' bytes). // Returns the number of bytes actually read or -1 on error. // Zero indicates the peer has closed the connection. int tcp_read (fd_t s_, void *data_, size_t size_); // Asserts that an internal error did not occur. Does not assert // on network errors such as reset or aborted connections. void tcp_assert_tuning_error (fd_t s_, int rc_); void tcp_tune_loopback_fast_path (fd_t socket_); } #endif zeromq-4.2.5/src/kqueue.cpp0000664000372000037200000001415513255253220016540 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "kqueue.hpp" #if defined ZMQ_USE_KQUEUE #include #include #include #include #include #include #include #include "macros.hpp" #include "kqueue.hpp" #include "err.hpp" #include "config.hpp" #include "i_poll_events.hpp" #include "likely.hpp" // NetBSD defines (struct kevent).udata as intptr_t, everyone else // as void *. #if defined ZMQ_HAVE_NETBSD #define kevent_udata_t intptr_t #else #define kevent_udata_t void * #endif zmq::kqueue_t::kqueue_t (const zmq::thread_ctx_t &ctx_) : worker_poller_base_t (ctx_) { // Create event queue kqueue_fd = kqueue (); errno_assert (kqueue_fd != -1); #ifdef HAVE_FORK pid = getpid (); #endif } zmq::kqueue_t::~kqueue_t () { stop_worker (); close (kqueue_fd); } void zmq::kqueue_t::kevent_add (fd_t fd_, short filter_, void *udata_) { check_thread (); struct kevent ev; EV_SET (&ev, fd_, filter_, EV_ADD, 0, 0, (kevent_udata_t) udata_); int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL); errno_assert (rc != -1); } void zmq::kqueue_t::kevent_delete (fd_t fd_, short filter_) { struct kevent ev; EV_SET (&ev, fd_, filter_, EV_DELETE, 0, 0, 0); int rc = kevent (kqueue_fd, &ev, 1, NULL, 0, NULL); errno_assert (rc != -1); } zmq::kqueue_t::handle_t zmq::kqueue_t::add_fd (fd_t fd_, i_poll_events *reactor_) { check_thread (); poll_entry_t *pe = new (std::nothrow) poll_entry_t; alloc_assert (pe); pe->fd = fd_; pe->flag_pollin = 0; pe->flag_pollout = 0; pe->reactor = reactor_; adjust_load (1); return pe; } void zmq::kqueue_t::rm_fd (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; if (pe->flag_pollin) kevent_delete (pe->fd, EVFILT_READ); if (pe->flag_pollout) kevent_delete (pe->fd, EVFILT_WRITE); pe->fd = retired_fd; retired.push_back (pe); adjust_load (-1); } void zmq::kqueue_t::set_pollin (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (!pe->flag_pollin)) { pe->flag_pollin = true; kevent_add (pe->fd, EVFILT_READ, pe); } } void zmq::kqueue_t::reset_pollin (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (pe->flag_pollin)) { pe->flag_pollin = false; kevent_delete (pe->fd, EVFILT_READ); } } void zmq::kqueue_t::set_pollout (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (!pe->flag_pollout)) { pe->flag_pollout = true; kevent_add (pe->fd, EVFILT_WRITE, pe); } } void zmq::kqueue_t::reset_pollout (handle_t handle_) { check_thread (); poll_entry_t *pe = (poll_entry_t *) handle_; if (likely (pe->flag_pollout)) { pe->flag_pollout = false; kevent_delete (pe->fd, EVFILT_WRITE); } } void zmq::kqueue_t::stop () { } int zmq::kqueue_t::max_fds () { return -1; } void zmq::kqueue_t::loop () { while (true) { // Execute any due timers. int timeout = (int) execute_timers (); if (get_load () == 0) { if (timeout == 0) break; // TODO sleep for timeout continue; } // Wait for events. struct kevent ev_buf[max_io_events]; timespec ts = {timeout / 1000, (timeout % 1000) * 1000000}; int n = kevent (kqueue_fd, NULL, 0, &ev_buf[0], max_io_events, timeout ? &ts : NULL); #ifdef HAVE_FORK if (unlikely (pid != getpid ())) { //printf("zmq::kqueue_t::loop aborting on forked child %d\n", (int)getpid()); // simply exit the loop in a forked process. return; } #endif if (n == -1) { errno_assert (errno == EINTR); continue; } for (int i = 0; i < n; i++) { poll_entry_t *pe = (poll_entry_t *) ev_buf[i].udata; if (pe->fd == retired_fd) continue; if (ev_buf[i].flags & EV_EOF) pe->reactor->in_event (); if (pe->fd == retired_fd) continue; if (ev_buf[i].filter == EVFILT_WRITE) pe->reactor->out_event (); if (pe->fd == retired_fd) continue; if (ev_buf[i].filter == EVFILT_READ) pe->reactor->in_event (); } // Destroy retired event sources. for (retired_t::iterator it = retired.begin (); it != retired.end (); ++it) { LIBZMQ_DELETE (*it); } retired.clear (); } } #endif zeromq-4.2.5/src/lb.hpp0000664000372000037200000000533713255253220015645 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_LB_HPP_INCLUDED__ #define __ZMQ_LB_HPP_INCLUDED__ #include "array.hpp" #include "pipe.hpp" namespace zmq { // This class manages a set of outbound pipes. On send it load balances // messages fairly among the pipes. class lb_t { public: lb_t (); ~lb_t (); void attach (pipe_t *pipe_); void activated (pipe_t *pipe_); void pipe_terminated (pipe_t *pipe_); int send (msg_t *msg_); // Sends a message and stores the pipe that was used in pipe_. // It is possible for this function to return success but keep pipe_ // unset if the rest of a multipart message to a terminated pipe is // being dropped. For the first frame, this will never happen. int sendpipe (msg_t *msg_, pipe_t **pipe_); bool has_out (); private: // List of outbound pipes. typedef array_t pipes_t; pipes_t pipes; // Number of active pipes. All the active pipes are located at the // beginning of the pipes array. pipes_t::size_type active; // Points to the last pipe that the most recent message was sent to. pipes_t::size_type current; // True if last we are in the middle of a multipart message. bool more; // True if we are dropping current message. bool dropping; lb_t (const lb_t &); const lb_t &operator= (const lb_t &); }; } #endif zeromq-4.2.5/src/libzmq.pc.in0000664000372000037200000000040613255253220016756 0ustar00travistravis00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: libzmq Description: 0MQ c++ library Version: @VERSION@ Libs: -L${libdir} -lzmq Libs.private: -lstdc++ @pkg_config_libs_private@ Cflags: -I${includedir} @pkg_config_defines@ zeromq-4.2.5/src/pollset.hpp0000664000372000037200000000642113255253220016725 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_POLLSET_HPP_INCLUDED__ #define __ZMQ_POLLSET_HPP_INCLUDED__ // poller.hpp decides which polling mechanism to use. #include "poller.hpp" #if defined ZMQ_USE_POLLSET #include #include #include #include "ctx.hpp" #include "fd.hpp" #include "thread.hpp" #include "poller_base.hpp" namespace zmq { struct i_poll_events; // This class implements socket polling mechanism using the AIX-specific // pollset mechanism. class pollset_t : public poller_base_t { public: typedef void *handle_t; pollset_t (const thread_ctx_t &ctx_); ~pollset_t (); // "poller" concept. handle_t add_fd (fd_t fd_, zmq::i_poll_events *events_); void rm_fd (handle_t handle_); void set_pollin (handle_t handle_); void reset_pollin (handle_t handle_); void set_pollout (handle_t handle_); void reset_pollout (handle_t handle_); void start (); void stop (); static int max_fds (); private: // Main worker thread routine. static void worker_routine (void *arg_); // Main event loop. void loop (); // Reference to ZMQ context. const thread_ctx_t &ctx; // Main pollset file descriptor ::pollset_t pollset_fd; struct poll_entry_t { fd_t fd; bool flag_pollin; bool flag_pollout; zmq::i_poll_events *events; }; // List of retired event sources. typedef std::vector retired_t; retired_t retired; // This table stores data for registered descriptors. typedef std::vector fd_table_t; fd_table_t fd_table; // If true, thread is in the process of shutting down. bool stopping; // Handle of the physical thread doing the I/O work. thread_t worker; pollset_t (const pollset_t &); const pollset_t &operator= (const pollset_t &); }; typedef pollset_t poller_t; } #endif #endif zeromq-4.2.5/src/mailbox.cpp0000664000372000037200000000616713255253220016700 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "mailbox.hpp" #include "err.hpp" zmq::mailbox_t::mailbox_t () { // Get the pipe into passive state. That way, if the users starts by // polling on the associated file descriptor it will get woken up when // new command is posted. const bool ok = cpipe.read (NULL); zmq_assert (!ok); active = false; } zmq::mailbox_t::~mailbox_t () { // TODO: Retrieve and deallocate commands inside the cpipe. // Work around problem that other threads might still be in our // send() method, by waiting on the mutex before disappearing. sync.lock (); sync.unlock (); } zmq::fd_t zmq::mailbox_t::get_fd () const { return signaler.get_fd (); } void zmq::mailbox_t::send (const command_t &cmd_) { sync.lock (); cpipe.write (cmd_, false); const bool ok = cpipe.flush (); sync.unlock (); if (!ok) signaler.send (); } int zmq::mailbox_t::recv (command_t *cmd_, int timeout_) { // Try to get the command straight away. if (active) { if (cpipe.read (cmd_)) return 0; // If there are no more commands available, switch into passive state. active = false; } // Wait for signal from the command sender. int rc = signaler.wait (timeout_); if (rc == -1) { errno_assert (errno == EAGAIN || errno == EINTR); return -1; } // Receive the signal. rc = signaler.recv_failable (); if (rc == -1) { errno_assert (errno == EAGAIN); return -1; } // Switch into active state. active = true; // Get a command. const bool ok = cpipe.read (cmd_); zmq_assert (ok); return 0; } bool zmq::mailbox_t::valid () const { return signaler.valid (); } zeromq-4.2.5/src/ypipe.hpp0000664000372000037200000001613413255253220016373 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_YPIPE_HPP_INCLUDED__ #define __ZMQ_YPIPE_HPP_INCLUDED__ #include "atomic_ptr.hpp" #include "yqueue.hpp" #include "ypipe_base.hpp" namespace zmq { // Lock-free queue implementation. // Only a single thread can read from the pipe at any specific moment. // Only a single thread can write to the pipe at any specific moment. // T is the type of the object in the queue. // N is granularity of the pipe, i.e. how many items are needed to // perform next memory allocation. template class ypipe_t : public ypipe_base_t { public: // Initialises the pipe. inline ypipe_t () { // Insert terminator element into the queue. queue.push (); // Let all the pointers to point to the terminator. // (unless pipe is dead, in which case c is set to NULL). r = w = f = &queue.back (); c.set (&queue.back ()); } // The destructor doesn't have to be virtual. It is made virtual // just to keep ICC and code checking tools from complaining. inline virtual ~ypipe_t () {} // Following function (write) deliberately copies uninitialised data // when used with zmq_msg. Initialising the VSM body for // non-VSM messages won't be good for performance. #ifdef ZMQ_HAVE_OPENVMS #pragma message save #pragma message disable(UNINIT) #endif // Write an item to the pipe. Don't flush it yet. If incomplete is // set to true the item is assumed to be continued by items // subsequently written to the pipe. Incomplete items are never // flushed down the stream. inline void write (const T &value_, bool incomplete_) { // Place the value to the queue, add new terminator element. queue.back () = value_; queue.push (); // Move the "flush up to here" poiter. if (!incomplete_) f = &queue.back (); } #ifdef ZMQ_HAVE_OPENVMS #pragma message restore #endif // Pop an incomplete item from the pipe. Returns true if such // item exists, false otherwise. inline bool unwrite (T *value_) { if (f == &queue.back ()) return false; queue.unpush (); *value_ = queue.back (); return true; } // Flush all the completed items into the pipe. Returns false if // the reader thread is sleeping. In that case, caller is obliged to // wake the reader up before using the pipe again. inline bool flush () { // If there are no un-flushed items, do nothing. if (w == f) return true; // Try to set 'c' to 'f'. if (c.cas (w, f) != w) { // Compare-and-swap was unseccessful because 'c' is NULL. // This means that the reader is asleep. Therefore we don't // care about thread-safeness and update c in non-atomic // manner. We'll return false to let the caller know // that reader is sleeping. c.set (f); w = f; return false; } // Reader is alive. Nothing special to do now. Just move // the 'first un-flushed item' pointer to 'f'. w = f; return true; } // Check whether item is available for reading. inline bool check_read () { // Was the value prefetched already? If so, return. if (&queue.front () != r && r) return true; // There's no prefetched value, so let us prefetch more values. // Prefetching is to simply retrieve the // pointer from c in atomic fashion. If there are no // items to prefetch, set c to NULL (using compare-and-swap). r = c.cas (&queue.front (), NULL); // If there are no elements prefetched, exit. // During pipe's lifetime r should never be NULL, however, // it can happen during pipe shutdown when items // are being deallocated. if (&queue.front () == r || !r) return false; // There was at least one value prefetched. return true; } // Reads an item from the pipe. Returns false if there is no value. // available. inline bool read (T *value_) { // Try to prefetch a value. if (!check_read ()) return false; // There was at least one value prefetched. // Return it to the caller. *value_ = queue.front (); queue.pop (); return true; } // Applies the function fn to the first elemenent in the pipe // and returns the value returned by the fn. // The pipe mustn't be empty or the function crashes. inline bool probe (bool (*fn) (const T &)) { bool rc = check_read (); zmq_assert (rc); return (*fn) (queue.front ()); } protected: // Allocation-efficient queue to store pipe items. // Front of the queue points to the first prefetched item, back of // the pipe points to last un-flushed item. Front is used only by // reader thread, while back is used only by writer thread. yqueue_t queue; // Points to the first un-flushed item. This variable is used // exclusively by writer thread. T *w; // Points to the first un-prefetched item. This variable is used // exclusively by reader thread. T *r; // Points to the first item to be flushed in the future. T *f; // The single point of contention between writer and reader thread. // Points past the last flushed item. If it is NULL, // reader is asleep. This pointer should be always accessed using // atomic operations. atomic_ptr_t c; // Disable copying of ypipe object. ypipe_t (const ypipe_t &); const ypipe_t &operator= (const ypipe_t &); }; } #endif zeromq-4.2.5/src/stream_engine.hpp0000664000372000037200000001454113255253220020065 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_STREAM_ENGINE_HPP_INCLUDED__ #define __ZMQ_STREAM_ENGINE_HPP_INCLUDED__ #include #include "fd.hpp" #include "i_engine.hpp" #include "io_object.hpp" #include "i_encoder.hpp" #include "i_decoder.hpp" #include "options.hpp" #include "socket_base.hpp" #include "metadata.hpp" namespace zmq { // Protocol revisions enum { ZMTP_1_0 = 0, ZMTP_2_0 = 1 }; class io_thread_t; class msg_t; class session_base_t; class mechanism_t; // This engine handles any socket with SOCK_STREAM semantics, // e.g. TCP socket or an UNIX domain socket. class stream_engine_t : public io_object_t, public i_engine { public: enum error_reason_t { protocol_error, connection_error, timeout_error }; stream_engine_t (fd_t fd_, const options_t &options_, const std::string &endpoint); ~stream_engine_t (); // i_engine interface implementation. void plug (zmq::io_thread_t *io_thread_, zmq::session_base_t *session_); void terminate (); void restart_input (); void restart_output (); void zap_msg_available (); const char *get_endpoint () const; // i_poll_events interface implementation. void in_event (); void out_event (); void timer_event (int id_); private: // Unplug the engine from the session. void unplug (); // Function to handle network disconnections. void error (error_reason_t reason); // Receives the greeting message from the peer. int receive_greeting (); // Detects the protocol used by the peer. bool handshake (); int routing_id_msg (msg_t *msg_); int process_routing_id_msg (msg_t *msg_); int next_handshake_command (msg_t *msg); int process_handshake_command (msg_t *msg); int pull_msg_from_session (msg_t *msg_); int push_msg_to_session (msg_t *msg); int push_raw_msg_to_session (msg_t *msg); int write_credential (msg_t *msg_); int pull_and_encode (msg_t *msg_); int decode_and_push (msg_t *msg_); int push_one_then_decode_and_push (msg_t *msg_); void mechanism_ready (); size_t add_property (unsigned char *ptr, const char *name, const void *value, size_t value_len); void set_handshake_timer (); typedef metadata_t::dict_t properties_t; bool init_properties (properties_t &properties); int produce_ping_message (msg_t *msg_); int process_heartbeat_message (msg_t *msg_); int produce_pong_message (msg_t *msg_); // Underlying socket. fd_t s; // True iff this is server's engine. bool as_server; msg_t tx_msg; handle_t handle; unsigned char *inpos; size_t insize; i_decoder *decoder; unsigned char *outpos; size_t outsize; i_encoder *encoder; // Metadata to be attached to received messages. May be NULL. metadata_t *metadata; // When true, we are still trying to determine whether // the peer is using versioned protocol, and if so, which // version. When false, normal message flow has started. bool handshaking; static const size_t signature_size = 10; // Size of ZMTP/1.0 and ZMTP/2.0 greeting message static const size_t v2_greeting_size = 12; // Size of ZMTP/3.0 greeting message static const size_t v3_greeting_size = 64; // Expected greeting size. size_t greeting_size; // Greeting received from, and sent to peer unsigned char greeting_recv[v3_greeting_size]; unsigned char greeting_send[v3_greeting_size]; // Size of greeting received so far unsigned int greeting_bytes_read; // The session this engine is attached to. zmq::session_base_t *session; const options_t options; // String representation of endpoint std::string endpoint; bool plugged; int (stream_engine_t::*next_msg) (msg_t *msg_); int (stream_engine_t::*process_msg) (msg_t *msg_); bool io_error; // Indicates whether the engine is to inject a phantom // subscription message into the incoming stream. // Needed to support old peers. bool subscription_required; mechanism_t *mechanism; // True iff the engine couldn't consume the last decoded message. bool input_stopped; // True iff the engine doesn't have any message to encode. bool output_stopped; // ID of the handshake timer enum { handshake_timer_id = 0x40 }; // True is linger timer is running. bool has_handshake_timer; // Heartbeat stuff enum { heartbeat_ivl_timer_id = 0x80, heartbeat_timeout_timer_id = 0x81, heartbeat_ttl_timer_id = 0x82 }; bool has_ttl_timer; bool has_timeout_timer; bool has_heartbeat_timer; int heartbeat_timeout; // Socket zmq::socket_base_t *socket; std::string peer_address; stream_engine_t (const stream_engine_t &); const stream_engine_t &operator= (const stream_engine_t &); }; } #endif zeromq-4.2.5/src/gather.cpp0000664000372000037200000000525213255253220016511 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "gather.hpp" #include "err.hpp" #include "msg.hpp" #include "pipe.hpp" zmq::gather_t::gather_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true) { options.type = ZMQ_GATHER; } zmq::gather_t::~gather_t () { } void zmq::gather_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); fq.attach (pipe_); } void zmq::gather_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::gather_t::xpipe_terminated (pipe_t *pipe_) { fq.pipe_terminated (pipe_); } int zmq::gather_t::xrecv (msg_t *msg_) { int rc = fq.recvpipe (msg_, NULL); // Drop any messages with more flag while (rc == 0 && msg_->flags () & msg_t::more) { // drop all frames of the current multi-frame message rc = fq.recvpipe (msg_, NULL); while (rc == 0 && msg_->flags () & msg_t::more) rc = fq.recvpipe (msg_, NULL); // get the new message if (rc == 0) rc = fq.recvpipe (msg_, NULL); } return rc; } bool zmq::gather_t::xhas_in () { return fq.has_in (); } const zmq::blob_t &zmq::gather_t::get_credential () const { return fq.get_credential (); } zeromq-4.2.5/src/null_mechanism.hpp0000664000372000037200000000470313255253220020242 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_NULL_MECHANISM_HPP_INCLUDED__ #define __ZMQ_NULL_MECHANISM_HPP_INCLUDED__ #include "mechanism.hpp" #include "options.hpp" #include "zap_client.hpp" namespace zmq { class msg_t; class session_base_t; class null_mechanism_t : public zap_client_t { public: null_mechanism_t (session_base_t *session_, const std::string &peer_address, const options_t &options_); virtual ~null_mechanism_t (); // mechanism implementation virtual int next_handshake_command (msg_t *msg_); virtual int process_handshake_command (msg_t *msg_); virtual int zap_msg_available (); virtual status_t status () const; private: bool ready_command_sent; bool error_command_sent; bool ready_command_received; bool error_command_received; bool zap_request_sent; bool zap_reply_received; int process_ready_command (const unsigned char *cmd_data, size_t data_size); int process_error_command (const unsigned char *cmd_data, size_t data_size); void send_zap_request (); }; } #endif zeromq-4.2.5/src/server.cpp0000664000372000037200000001223113255253220016540 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "macros.hpp" #include "server.hpp" #include "pipe.hpp" #include "wire.hpp" #include "random.hpp" #include "likely.hpp" #include "err.hpp" zmq::server_t::server_t (class ctx_t *parent_, uint32_t tid_, int sid_) : socket_base_t (parent_, tid_, sid_, true), next_routing_id (generate_random ()) { options.type = ZMQ_SERVER; } zmq::server_t::~server_t () { zmq_assert (outpipes.empty ()); } void zmq::server_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_) { LIBZMQ_UNUSED (subscribe_to_all_); zmq_assert (pipe_); uint32_t routing_id = next_routing_id++; if (!routing_id) routing_id = next_routing_id++; // Never use Routing ID zero pipe_->set_server_socket_routing_id (routing_id); // Add the record into output pipes lookup table outpipe_t outpipe = {pipe_, true}; bool ok = outpipes.ZMQ_MAP_INSERT_OR_EMPLACE (routing_id, outpipe).second; zmq_assert (ok); fq.attach (pipe_); } void zmq::server_t::xpipe_terminated (pipe_t *pipe_) { outpipes_t::iterator it = outpipes.find (pipe_->get_server_socket_routing_id ()); zmq_assert (it != outpipes.end ()); outpipes.erase (it); fq.pipe_terminated (pipe_); } void zmq::server_t::xread_activated (pipe_t *pipe_) { fq.activated (pipe_); } void zmq::server_t::xwrite_activated (pipe_t *pipe_) { outpipes_t::iterator it; for (it = outpipes.begin (); it != outpipes.end (); ++it) if (it->second.pipe == pipe_) break; zmq_assert (it != outpipes.end ()); zmq_assert (!it->second.active); it->second.active = true; } int zmq::server_t::xsend (msg_t *msg_) { // SERVER sockets do not allow multipart data (ZMQ_SNDMORE) if (msg_->flags () & msg_t::more) { errno = EINVAL; return -1; } // Find the pipe associated with the routing stored in the message. uint32_t routing_id = msg_->get_routing_id (); outpipes_t::iterator it = outpipes.find (routing_id); if (it != outpipes.end ()) { if (!it->second.pipe->check_write ()) { it->second.active = false; errno = EAGAIN; return -1; } } else { errno = EHOSTUNREACH; return -1; } // Message might be delivered over inproc, so we reset routing id int rc = msg_->reset_routing_id (); errno_assert (rc == 0); bool ok = it->second.pipe->write (msg_); if (unlikely (!ok)) { // Message failed to send - we must close it ourselves. rc = msg_->close (); errno_assert (rc == 0); } else it->second.pipe->flush (); // Detach the message from the data buffer. rc = msg_->init (); errno_assert (rc == 0); return 0; } int zmq::server_t::xrecv (msg_t *msg_) { pipe_t *pipe = NULL; int rc = fq.recvpipe (msg_, &pipe); // Drop any messages with more flag while (rc == 0 && msg_->flags () & msg_t::more) { // drop all frames of the current multi-frame message rc = fq.recvpipe (msg_, NULL); while (rc == 0 && msg_->flags () & msg_t::more) rc = fq.recvpipe (msg_, NULL); // get the new message if (rc == 0) rc = fq.recvpipe (msg_, &pipe); } if (rc != 0) return rc; zmq_assert (pipe != NULL); uint32_t routing_id = pipe->get_server_socket_routing_id (); msg_->set_routing_id (routing_id); return 0; } bool zmq::server_t::xhas_in () { return fq.has_in (); } bool zmq::server_t::xhas_out () { // In theory, SERVER socket is always ready for writing. Whether actual // attempt to write succeeds depends on which pipe the message is going // to be routed to. return true; } const zmq::blob_t &zmq::server_t::get_credential () const { return fq.get_credential (); } zeromq-4.2.5/src/raw_decoder.hpp0000664000372000037200000000440213255253220017516 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_RAW_DECODER_HPP_INCLUDED__ #define __ZMQ_RAW_DECODER_HPP_INCLUDED__ #include "err.hpp" #include "msg.hpp" #include "i_decoder.hpp" #include "stdint.hpp" #include "decoder_allocators.hpp" namespace zmq { // Decoder for 0MQ v1 framing protocol. Converts data stream into messages. class raw_decoder_t : public i_decoder { public: raw_decoder_t (size_t bufsize_); virtual ~raw_decoder_t (); // i_decoder interface. virtual void get_buffer (unsigned char **data_, size_t *size_); virtual int decode (const unsigned char *data_, size_t size_, size_t &processed); virtual msg_t *msg () { return &in_progress; } virtual void resize_buffer (size_t) {} private: msg_t in_progress; shared_message_memory_allocator allocator; raw_decoder_t (const raw_decoder_t &); void operator= (const raw_decoder_t &); }; } #endif zeromq-4.2.5/src/vmci_listener.cpp0000664000372000037200000001707113255253220020104 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "vmci_listener.hpp" #if defined ZMQ_HAVE_VMCI #include #include "stream_engine.hpp" #include "vmci_address.hpp" #include "io_thread.hpp" #include "session_base.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" #include "socket_base.hpp" #include "vmci.hpp" #if defined ZMQ_HAVE_WINDOWS #include "windows.hpp" #else #include #include #endif zmq::vmci_listener_t::vmci_listener_t (io_thread_t *io_thread_, socket_base_t *socket_, const options_t &options_) : own_t (io_thread_, options_), io_object_t (io_thread_), s (retired_fd), socket (socket_) { } zmq::vmci_listener_t::~vmci_listener_t () { zmq_assert (s == retired_fd); } void zmq::vmci_listener_t::process_plug () { // Start polling for incoming connections. handle = add_fd (s); set_pollin (handle); } void zmq::vmci_listener_t::process_term (int linger_) { rm_fd (handle); close (); own_t::process_term (linger_); } void zmq::vmci_listener_t::in_event () { fd_t fd = accept (); // If connection was reset by the peer in the meantime, just ignore it. if (fd == retired_fd) { socket->event_accept_failed (endpoint, zmq_errno ()); return; } tune_vmci_buffer_size (this->get_ctx (), fd, options.vmci_buffer_size, options.vmci_buffer_min_size, options.vmci_buffer_max_size); if (options.vmci_connect_timeout > 0) { #if defined ZMQ_HAVE_WINDOWS tune_vmci_connect_timeout (this->get_ctx (), fd, options.vmci_connect_timeout); #else struct timeval timeout = {0, options.vmci_connect_timeout * 1000}; tune_vmci_connect_timeout (this->get_ctx (), fd, timeout); #endif } // Create the engine object for this connection. stream_engine_t *engine = new (std::nothrow) stream_engine_t (fd, options, endpoint); alloc_assert (engine); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); // Create and launch a session object. session_base_t *session = session_base_t::create (io_thread, false, socket, options, NULL); errno_assert (session); session->inc_seqnum (); launch_child (session); send_attach (session, engine, false); socket->event_accepted (endpoint, fd); } int zmq::vmci_listener_t::get_address (std::string &addr_) { struct sockaddr_storage ss; #ifdef ZMQ_HAVE_HPUX int sl = sizeof (ss); #else socklen_t sl = sizeof (ss); #endif int rc = getsockname (s, (sockaddr *) &ss, &sl); if (rc != 0) { addr_.clear (); return rc; } vmci_address_t addr ((struct sockaddr *) &ss, sl, this->get_ctx ()); return addr.to_string (addr_); } int zmq::vmci_listener_t::set_address (const char *addr_) { // Create addr on stack for auto-cleanup std::string addr (addr_); // Initialise the address structure. vmci_address_t address (this->get_ctx ()); int rc = address.resolve (addr.c_str ()); if (rc != 0) return -1; // Create a listening socket. s = open_socket (this->get_ctx ()->get_vmci_socket_family (), SOCK_STREAM, 0); #ifdef ZMQ_HAVE_WINDOWS if (s == INVALID_SOCKET) { errno = wsa_error_to_errno (WSAGetLastError ()); return -1; } #if !defined _WIN32_WCE // On Windows, preventing sockets to be inherited by child processes. BOOL brc = SetHandleInformation ((HANDLE) s, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif #else if (s == -1) return -1; #endif address.to_string (endpoint); // Bind the socket. rc = bind (s, address.addr (), address.addrlen ()); #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { errno = wsa_error_to_errno (WSAGetLastError ()); goto error; } #else if (rc != 0) goto error; #endif // Listen for incoming connections. rc = listen (s, options.backlog); #ifdef ZMQ_HAVE_WINDOWS if (rc == SOCKET_ERROR) { errno = wsa_error_to_errno (WSAGetLastError ()); goto error; } #else if (rc != 0) goto error; #endif socket->event_listening (endpoint, s); return 0; error: int err = errno; close (); errno = err; return -1; } void zmq::vmci_listener_t::close () { zmq_assert (s != retired_fd); #ifdef ZMQ_HAVE_WINDOWS int rc = closesocket (s); wsa_assert (rc != SOCKET_ERROR); #else int rc = ::close (s); errno_assert (rc == 0); #endif socket->event_closed (endpoint, s); s = retired_fd; } zmq::fd_t zmq::vmci_listener_t::accept () { // Accept one connection and deal with different failure modes. // The situation where connection cannot be accepted due to insufficient // resources is considered valid and treated by ignoring the connection. zmq_assert (s != retired_fd); fd_t sock = ::accept (s, NULL, NULL); #ifdef ZMQ_HAVE_WINDOWS if (sock == INVALID_SOCKET) { wsa_assert (WSAGetLastError () == WSAEWOULDBLOCK || WSAGetLastError () == WSAECONNRESET || WSAGetLastError () == WSAEMFILE || WSAGetLastError () == WSAENOBUFS); return retired_fd; } #if !defined _WIN32_WCE // On Windows, preventing sockets to be inherited by child processes. BOOL brc = SetHandleInformation ((HANDLE) sock, HANDLE_FLAG_INHERIT, 0); win_assert (brc); #endif #else if (sock == -1) { errno_assert (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR || errno == ECONNABORTED || errno == EPROTO || errno == ENOBUFS || errno == ENOMEM || errno == EMFILE || errno == ENFILE); return retired_fd; } #endif // Race condition can cause socket not to be closed (if fork happens // between accept and this point). #ifdef FD_CLOEXEC int rc = fcntl (sock, F_SETFD, FD_CLOEXEC); errno_assert (rc != -1); #endif return sock; } #endif zeromq-4.2.5/src/vmci.cpp0000664000372000037200000000657113255253220016202 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #include "precompiled.hpp" #include "vmci.hpp" #if defined ZMQ_HAVE_VMCI #include #include void zmq::tune_vmci_buffer_size (ctx_t *context_, fd_t sockfd_, uint64_t default_size_, uint64_t min_size_, uint64_t max_size_) { int family = context_->get_vmci_socket_family (); assert (family != -1); if (default_size_ != 0) { int rc = setsockopt (sockfd_, family, SO_VMCI_BUFFER_SIZE, (char *) &default_size_, sizeof default_size_); #if defined ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif } if (min_size_ != 0) { int rc = setsockopt (sockfd_, family, SO_VMCI_BUFFER_SIZE, (char *) &min_size_, sizeof min_size_); #if defined ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif } if (max_size_ != 0) { int rc = setsockopt (sockfd_, family, SO_VMCI_BUFFER_SIZE, (char *) &max_size_, sizeof max_size_); #if defined ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif } } #if defined ZMQ_HAVE_WINDOWS void zmq::tune_vmci_connect_timeout (ctx_t *context_, fd_t sockfd_, DWORD timeout_) #else void zmq::tune_vmci_connect_timeout (ctx_t *context_, fd_t sockfd_, struct timeval timeout_) #endif { int family = context_->get_vmci_socket_family (); assert (family != -1); int rc = setsockopt (sockfd_, family, SO_VMCI_CONNECT_TIMEOUT, (char *) &timeout_, sizeof timeout_); #if defined ZMQ_HAVE_WINDOWS wsa_assert (rc != SOCKET_ERROR); #else errno_assert (rc == 0); #endif } #endif zeromq-4.2.5/src/own.hpp0000664000372000037200000001223713255253220016050 0ustar00travistravis00000000000000/* Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file This file is part of libzmq, the ZeroMQ core engine in C++. libzmq is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. As a special exception, the Contributors give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you must extend this exception to your version of the library. libzmq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . */ #ifndef __ZMQ_OWN_HPP_INCLUDED__ #define __ZMQ_OWN_HPP_INCLUDED__ #include #include #include "object.hpp" #include "options.hpp" #include "atomic_counter.hpp" #include "stdint.hpp" namespace zmq { class ctx_t; class io_thread_t; // Base class for objects forming a part of ownership hierarchy. // It handles initialisation and destruction of such objects. class own_t : public object_t { public: // Note that the owner is unspecified in the constructor. // It'll be supplied later on when the object is plugged in. // The object is not living within an I/O thread. It has it's own // thread outside of 0MQ infrastructure. own_t (zmq::ctx_t *parent_, uint32_t tid_); // The object is living within I/O thread. own_t (zmq::io_thread_t *io_thread_, const options_t &options_); // When another owned object wants to send command to this object // it calls this function to let it know it should not shut down // before the command is delivered. void inc_seqnum (); // Use following two functions to wait for arbitrary events before // terminating. Just add number of events to wait for using // register_tem_acks functions. When event occurs, call // remove_term_ack. When number of pending acks reaches zero // object will be deallocated. void register_term_acks (int count_); void unregister_term_ack (); protected: // Launch the supplied object and become its owner. void launch_child (own_t *object_); // Terminate owned object void term_child (own_t *object_); // Ask owner object to terminate this object. It may take a while // while actual termination is started. This function should not be // called more than once. void terminate (); // Returns true if the object is in process of termination. bool is_terminating (); // Derived object destroys own_t. There's no point in allowing // others to invoke the destructor. At the same time, it has to be // virtual so that generic own_t deallocation mechanism destroys // specific type of the owned object correctly. virtual ~own_t (); // Term handler is protected rather than private so that it can // be intercepted by the derived class. This is useful to add custom // steps to the beginning of the termination process. void process_term (int linger_); // A place to hook in when physical destruction of the object // is to be delayed. virtual void process_destroy (); // Socket options associated with this object. options_t options; private: // Set owner of the object void set_owner (own_t *owner_); // Handlers for incoming commands. void process_own (own_t *object_); void process_term_req (own_t *object_); void process_term_ack (); void process_seqnum (); // Check whether all the pending term acks were delivered. // If so, deallocate this object. void check_term_acks (); // True if termination was already initiated. If so, we can destroy // the object if there are no more child objects or pending term acks. bool terminating; // Sequence number of the last command sent to this object. atomic_counter_t sent_seqnum; // Sequence number of the last command processed by this object. uint64_t processed_seqnum; // Socket owning this object. It's responsible for shutting down // this object. own_t *owner; // List of all objects owned by this socket. We are responsible // for deallocating them before we quit. typedef std::set owned_t; owned_t owned; // Number of events we have to get before we can destroy the object. int term_acks; own_t (const own_t &); const own_t &operator= (const own_t &); }; } #endif